1

I want to set up a stable-diffusion environment in Windows10. I downloaded the recommended graphics card driver version and cuda version, but running webui-user-bat still generates an error: Torch is not able to use the GPU. enter image description here enter image description here

I had suspected that the graphics driver version didn't match the cuda version, but I tried many versions and none of them worked. Some people say that the version of torch does not match. My current torch is the latest version on the official website.

talonmies
  • 70,661
  • 34
  • 192
  • 269
bluefox
  • 11
  • 1
  • 2

3 Answers3

0

Execute the webui.sh shell script in the root folder, then retry running the webui-user.bat.

There is a known issue I've been researching, and I think it boils down to the user needing to execute the script webui.sh in the root folder (execute with bash or similar) and it should install ROCM. I don't understand the specifics of any of this, but it allows the user to utilize an AMD GPU. Here is some more information:

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9970

0

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:

  • Navigate to your folder.
  • Find the "webui-user.bat" file.
  • Left click on it and choose "Edit."
  • Look for the line that says "set commandline_args=" and add "--skip-torch-cuda-test" to it (should look like set commandline_args= --skip-torch-cuda-test).

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:

  • First, download the special version of stable diffusion made for GPU use. You can find it here: https://github.com/automatic1111/stable-diffusion-webui/wiki/install-and-run-on-nvidia-gpus it also tells u how to download and use it but it is outdated information.
  • Open the downloaded folder and find the "run.bat" file.
  • Double-click on it and it will download torch with cuda enabled if it is just torch than go to step 3 btw I prefer you doing step 3 even if it downloading with cuda. As by default it downloads the old version of torch.

Step 3:

  • Before downloading "torch," close the file you are working on.
  • Go to this website: https://pytorch.org/get-started/previous-versions/
  • Find the right version of "torch" for your device on that website.
  • Open the Command Prompt (cmd).
  • Copy the path of the "run.bat" file.
  • Paste the path into the Command Prompt.
  • Add "-m" and the command for "torch" that you got from the website. It should look like this: "pathtothefile -m pip install torch==1.13.0+cu116..."
  • Now, run the command.

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

0

As mention above, after modefied the "webui-user.bat" file as per below syntax it's working my application as expected.

Navigate to your folder. Find the "webui-user.bat" file. Left click on it and choose "Edit." Look for the line that says "set commandline_args=" and add "--skip-torch-cuda-test" to it (should look like set commandline_args= --skip-torch-cuda-test).

Another Sources for same: - https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1742