stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Help!Torch is not able to use gpu

Open CGangel opened this issue 2 years ago • 4 comments

Firstly,it seems that i didn't install torch correctly Screenshot_20221021_152032_com oray sunlogin Screenshot_20221021_152038_com oray sunlogin

however,torchvision is installed(0.13.1+cu113)

when i try to start webui,there is a mistake that “torch is not to use gpu” Screenshot_20221021_152050_com oray sunlogin

At first, it said that the torch installation failed, but finally, it also said that the installation was successful.The network is not working,however, a 3G sized torch 1.12.1+cu113 was added to the site-packages, but it failed to run,and it tells that“torch is not able to use gpu” How can I solve this problem?

Thanks for your help!

CGangel avatar Oct 21 '22 07:10 CGangel

Screenshot_20221021_155109_com oray sunlogin it seems that torch is installed,however,it couldn't work correctly.

CGangel avatar Oct 21 '22 07:10 CGangel

edit: nevermind

ghost avatar Oct 21 '22 07:10 ghost

Try this: pip install --force-reinstall --no-cache-dir -r requirements.txt pip install --force-reinstall --no-cache-dir -r requirements_versions.txt

Though I doubt this would help, Updated the repor today and torch isnt finding my GPU anymore.

  • edit

Also see if your cuda is updated and valid with nvidia-smi in console

image

Also check to see if your nvcc runtimes are valid aswell nvcc --version image

cyberofficial avatar Oct 21 '22 15:10 cyberofficial

Use nvcc -V to check that your cuda is installed correctly and that the version is compatible with torch. If you find that the cuda version using nvidia-smi is different from the version using nvcc -V, don't panic, the former refers to the highest cuda version supported by your current graphics card driver (think of it that way) and the latter is the cuda version you actually installed manually. As long as the latter version is compatible with the torch version you installed, you won't have the problem of not finding the GPU (probably).


nvcc -V检查一下你的cuda是否正确安装,并且版本是否和torch兼容。如果你发现使用nvidia-smi的cuda版本和nvcc -V的版本不同,不必惊慌,前者指的是你当前显卡驱动所支持的最高cuda版本(可以这么认为),后者是你实际手动安装的cuda版本。只要后者的版本能够和你安装的torch版本兼容就不会出现找不到GPU的问题了(大概)。

Small-tailqwq avatar Oct 22 '22 02:10 Small-tailqwq