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

i have big problem.
when i tried to set up “stable-diffusion-webui”,i have error message.
the message insits “Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check”.

i checked my cuda and torch . and then the prompt said

>> 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.
>>> import torch
>>> print(torch.__version__)
1.13.1+cu117
>>> print(torch.cuda.is_available())
False
>>> print(torch.cuda.device_count())
0
>>> exit()

so I checked my env. but i can’t understand what’s happened.

so please help me.


 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

unfortunately i tried “set CUDA_VISIBLE_DEVICES=3”.
however not working.

Why are you trying to set CUDA_VISIBLE_DEVICES=3?
Since PyTorch does not detect your GPU (assuming you did not mask it) it could point to a driver issue in your setup.

thank you reply.
i thought CUDA_VISIBLE_DEVICES is problem .but it is my mistake. i fixed it .(i was misreading this answer

what driver issue is there ?
i read this info. i cant find issue.

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      |
+-----------------------------------------------------------------------------+

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.
E.g. here is a similar error caused by an installation issue.

I had RE-installed cuda .but available is false .
i checked my paths.and i found other issue.
when i coded " where nvcc"in Powershell,I cant found path

PS C:\Users\taked> where nvcc
PS C:\Users\taked>

However ,
When i did it in Anaconda ,I find the path .

(base) C:\Users\taked>where nvcc
F:\Users\anaconda3\bin\nvcc.exe
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\nvcc.exe

What should i do ? i set up ithe nitalization sevral times
Available is still false

1 Like