Print(torch.cuda.is_available()) is False

902003b7648b9e4c4217: <p>i have big problem.<br>
when i tried to set up “stable-diffusion-webui”,i have error message.<br>
the message insits “Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check”.</p>
<p>i checked my cuda and torch . and then the prompt said</p>
<pre><code class="lang-auto">&gt;&gt; python
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; print(torch.__version__)
1.13.1+cu117
&gt;&gt;&gt; print(torch.cuda.is_available())
False
&gt;&gt;&gt; print(torch.cuda.device_count())
0
&gt;&gt;&gt; exit()
</code></pre>
<p>so I checked my env. but i can’t understand what’s happened.</p>
<p>so please help me.</p>
<pre><code class="lang-auto">
 python -m torch.utils.collect_env
Collecting environment information...
PyTorch version: 1.13.1+cu117
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Pro
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22000-SP0
Is CUDA available: False
CUDA runtime version: 11.7.64
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3050
Nvidia driver version: 528.49
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.24.0
[pip3] torch==1.13.1+cu117
[pip3] torchaudio==0.13.1+cu117
[pip3] torchvision==0.14.1+cu117
[conda] Could not collect
</code></pre>
<p>unfortunately i tried “set CUDA_VISIBLE_DEVICES=3”.<br>
however not working.</p>

ptrblck: <p>Why are you trying to set <code>CUDA_VISIBLE_DEVICES=3</code>?<br>
Since PyTorch does not detect your GPU (assuming you did not mask it) it could point to a driver issue in your setup.</p>

902003b7648b9e4c4217: <p>thank you reply.<br>
i thought  CUDA_VISIBLE_DEVICES is problem .but it is my mistake. i fixed it .(i was misreading this <a href="https://discuss.pytorch.org/t/torch-cant-use-gpu-but-it-could-before/170940/9">answer</a></p>
<p>what driver issue is there ?<br>
i read this info. i cant find issue.</p>
<pre><code class="lang-auto">Mon Feb 13 08:06:14 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 528.49       Driver Version: 528.49       CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ... WDDM  | 00000000:01:00.0  On |                  N/A |
| 34%   27C    P8    10W / 130W |    949MiB /  8192MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      9232    C+G   ...8wekyb3d8bbwe\GameBar.exe    N/A      |
|    0   N/A  N/A     10276    C+G   ...y\ShellExperienceHost.exe    N/A      |
|    0   N/A  N/A     11528    C+G   ...kyb3d8bbwe\HxAccounts.exe    N/A      |
|    0   N/A  N/A     11592    C+G   C:\Windows\explorer.exe         N/A      |
|    0   N/A  N/A     12652    C+G   ...t\GoogleIMEJaRenderer.exe    N/A      |
|    0   N/A  N/A     12880    C+G   ...artMenuExperienceHost.exe    N/A      |
|    0   N/A  N/A     12896    C+G   ...n1h2txyewy\SearchHost.exe    N/A      |
|    0   N/A  N/A     13052    C+G   ...8bbwe\WindowsTerminal.exe    N/A      |
|    0   N/A  N/A     13508    C+G   ...2txyewy\TextInputHost.exe    N/A      |
|    0   N/A  N/A     14456    C+G   ...cw5n1h2txyewy\LockApp.exe    N/A      |
|    0   N/A  N/A     15476    C+G   ...kzcwy\mcafee-security.exe    N/A      |
|    0   N/A  N/A     15600    C+G   ...obeNotificationClient.exe    N/A      |
|    0   N/A  N/A     15792    C+G   ...518.78\msedgewebview2.exe    N/A      |
|    0   N/A  N/A     15908    C+G   ...e\PhoneExperienceHost.exe    N/A      |
|    0   N/A  N/A     16264    C+G   ...perience\NVIDIA Share.exe    N/A      |
|    0   N/A  N/A     17524    C+G   ...ge\Application\msedge.exe    N/A      |
|    0   N/A  N/A     17888    C+G   ...oft OneDrive\OneDrive.exe    N/A      |
|    0   N/A  N/A     20196    C+G   ...lPanel\SystemSettings.exe    N/A      |
|    0   N/A  N/A     23888    C+G   ...ekyb3d8bbwe\HxOutlook.exe    N/A      |
+-----------------------------------------------------------------------------+
</code></pre>

ptrblck: <p>I don’t know what exactly failed, but would assume that the CUDA initialization is failing which is caused by a setup issue most of the times.<br>
E.g. <a href="https://discuss.pytorch.org/t/torch-cuda-is-not-available/74845/23">here</a> is a similar error caused by an installation issue.</p>

902003b7648b9e4c4217: <p>I had RE-installed cuda .but available is false .<br>
i checked my paths.and i found other issue.<br>
when i coded " where nvcc"in Powershell,I cant found path</p>
<pre><code class="lang-auto">PS C:\Users\taked&gt; where nvcc
PS C:\Users\taked&gt;
</code></pre>
<p>However ,<br>
When i did it in Anaconda ,I find the path .</p>
<pre><code class="lang-auto">(base) C:\Users\taked&gt;where nvcc
F:\Users\anaconda3\bin\nvcc.exe
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\nvcc.exe
</code></pre>
<p>What should i do ? i set up ithe nitalization sevral times<br>
Available is still false</p>