-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check #9970
Comments
This might be the same issue as described in this comment: #1742 (comment) |
Found it, it looks like Hopefully this issue will go away when whoever is in charge of their DNS fixes it, but if you have already downloaded the CPU version due to this bug you will need to manually delete the incorrect files. One way to check if this is your problem is to try going to https://download.pytorch.org/whl/cu118 in your browser. If it works you have a different issue. If it's ERR_NAME_NOT_RESOLVED or similar you have this one. |
amd gpu? I think you installed cuda, but amd requires rocm. You can run stable-diffusion-webui/webui.sh Lines 119 to 123 in 5ab7f21
or run |
I can confirm the pytorch.org link being unreacheable seems to be the issue. However I have switched from Cloudflare to Google and I still have the same issue. Waiting for an update on this. |
Same issue, spent all day messing about, I tried manually installing torch like described in [url]this(https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1742#issuecomment-1429476506[/url]post with no luck. Tried creating a new SD install and same issues. Keep getting the errors How does one change the DNS to be able to connect to the site to download? the links work intermittently for me, like if i delete my env eventually it connects in command prompt but the error still persists. (Full description of my issue here but yeah, it's the same problem I completely overlooked the issues page and mistakenly posted in this discussions: #10016) |
Following the exact same process, with Google DNS, worked for me (yay!). I had changed the DNS before and it didn't work. |
If you see a message along the lines of "WARNING: Retrying" ..., multiple tries and then it eventually works, I believe it actually is failing to connect and falling back to the incorrect version of the library. If it's using the correct version there should be no "Retrying" messages. Look for how to change your Operating System DNS to switch DNS provider. |
Same issue but I can access https://download.pytorch.org/whl/cu118. Running on PopOS with a 3080, and cuda and pytorch work in the project I'm working on in PyCharm. |
The problem for me was that it was detecting the iGPU on my laptop as the primary GPU and installing the ROCm (AMD) version :
The fix was to remove the following lines from webui.sh
|
This` issue have a perfect solution!!!,and i will show you how did I sovle it !!! Step 1)update your NVIDIA driver,and then confirm which series pack of CUDA do your driver capable,pic in there !!!Step 2)update your NVIDIA cuda with correct package.https://developer.nvidia.com/cuda-toolkit-archive !!!Step 3)choose the right torch from web https://pytorch.org/get-started/previous-versions/ !!! Step 4) torch.cuda.is_available() #check it |
Error: RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check The solution for me was: 1- Download Geforce Experience os: Windows 11, gpu: RTX 3060 12GB, drivers: 536.67 |
Let me simplify it:I faced this issue to when I started but now I know how to handle it and this is how you can do it too. For CPU Only:If you don't have a GPU and want to use it on CPU, follow these steps:
If you have a gpu and want to use it:All you need is an NVIDIA graphics card with at least 2 GB of memory. Some people say you need a card with more than 4 GB, but I have a card called MX300, which has 2 GB memory, and I can still use it without any issues for stable diffusion. The only drawback is that it takes 2 to 4 minutes to generate a picture, depending on a few factors. Btw there is a way to run it on AMD gpu too but I don’t know much about it. Steps to use it on gpu:
Step 3:
After the process is complete just run the "run.bat" file again and it will download some necessary library and after that you can use it. Note:The reason why people who have gpu but still cant run them on stable diffusion is that they have the wrong version of it and if you have more than one GPU and want to use a specific one of them go to the "webui-user.bat" file and add this line to it "set cuda_visible_devices=1" below the "set commandline_args=". By default stable diffusion will use the best GPU on its own but its a optional step and I don't think it will be nessary but if you still face problem using it on gpu you need to download CUDA from NVIDEA website on you computer It's the only remaining solution to try. It is also a good approach to have it installed on you Computer if you are using any A.I related model |
You save my day <3 |
Worked for me on Windows 10, NVIDIA GeForce GTX 1050 |
What worked for me on Windows 11, AMD Ryzen 5700U + Radeon Graphics was the following: webui.bat --skip-torch-cuda-test --use-directml --medvram Also turned down the CFG scale to 5 (which seems to have helped) |
Thank you, it worked for my 3060 too, but unfortunately it lost performance, don't do it now if possible, at least in this update now it loses performance on SD. To return the drive you can go to device manager and there you have the option to go to the previous drive but in fact it will return to the factory drive, from 2021, but the performance still returns |
Is there an existing issue for this?
What happened?
New update of A111 with Torch 2.0 results in the following error on startup:
venv "G:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Commit hash: 72cd27a
Traceback (most recent call last):
File "G:\stable-diffusion-webui\launch.py", line 352, in
prepare_environment()
File "G:\stable-diffusion-webui\launch.py", line 257, in prepare_environment
run_python("import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'")
File "G:\stable-diffusion-webui\launch.py", line 120, in run_python
return run(f'"{python}" -c "{code}"', desc, errdesc)
File "G:\stable-diffusion-webui\launch.py", line 96, in run
raise RuntimeError(message)
RuntimeError: Error running command.
Command: "G:\stable-diffusion-webui\venv\Scripts\python.exe" -c "import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'"
Error code: 1
stdout:
stderr: Traceback (most recent call last):
File "", line 1, in
AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
Press any key to continue . . .
I've tried a clean install by deleting venv and letting everything reinstall from scratch to no avail.
Steps to reproduce the problem
What should have happened?
Normal startup, using --skip-torch-cuda-test results in xformers failing due to the lack of torch with cuda support.
Commit where the problem happens
72cd27a
What platforms do you use to access the UI ?
Windows
What browsers do you use to access the UI ?
Mozilla Firefox
Command Line Arguments
List of extensions
Unrelated
Console logs
Additional information
No response
The text was updated successfully, but these errors were encountered: