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

Your device does not support the current version of Torch/CUDA" error

Open MemeboiMustang opened this issue 7 months ago • 6 comments

I tried running Forge UI this morning and I got the error "Your device does not support the current version of Torch/CUDA" even though it was working perfectly fine yesterday and the day before. What happened? I know I did have my PC running all through the day before into yesterday and then shut off my PC last night. Did something happen while my PC was off?

Edit: Forgot to mention that the forge UI version is 12.1

MemeboiMustang avatar May 07 '25 14:05 MemeboiMustang

Forgot to mention that the forge UI version is 12.1

That looks more like the CUDA version. The Forge version should be similar to f2.0.1v1.10.1-previous-659-gc055f2d4. What GPU do you have? If it's an RTX 2000 or newer you can try running these commands to reinstall the latest version of Pytorch w/ CUDA (Open a powershell/cmd promptin the root folder of Forge):

venv/Scripts/activate
python -m pip uninstall torch torchvision torchaudio
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128

If you have an older GPU and notice it still doesn't quite work, you can repeat these steps but replace the cu128 at the end of the last line with 126, 121, or 118 until it works.

If it still doesn't work. Close and reopen Forge, then share the terminal output here and we can try to debug.

MisterChief95 avatar May 07 '25 18:05 MisterChief95

Forgot to mention that the forge UI version is 12.1

That looks more like the CUDA version. The Forge version should be similar to f2.0.1v1.10.1-previous-659-gc055f2d4. What GPU do you have? If it's an RTX 2000 or newer you can try running these commands to reinstall the latest version of Pytorch w/ CUDA (Open a powershell/cmd promptin the root folder of Forge):

venv/Scripts/activate python -m pip uninstall torch torchvision torchaudio python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128 If you have an older GPU and notice it still doesn't quite work, you can repeat these steps but replace the cu128 at the end of the last line with 126, 121, or 118 until it works.

If it still doesn't work. Close and reopen Forge, then share the terminal output here and we can try to debug.

I have an RTX 3050Ti I believe

MemeboiMustang avatar May 07 '25 19:05 MemeboiMustang

Forgot to mention that the forge UI version is 12.1

That looks more like the CUDA version. The Forge version should be similar to f2.0.1v1.10.1-previous-659-gc055f2d4. What GPU do you have? If it's an RTX 2000 or newer you can try running these commands to reinstall the latest version of Pytorch w/ CUDA (Open a powershell/cmd promptin the root folder of Forge):

venv/Scripts/activate python -m pip uninstall torch torchvision torchaudio python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128

If you have an older GPU and notice it still doesn't quite work, you can repeat these steps but replace the cu128 at the end of the last line with 126, 121, or 118 until it works.

If it still doesn't work. Close and reopen Forge, then share the terminal output here and we can try to debug.

Did that and I received:

Discarding https://download.pytorch.org/whl/typing_extensions-4.12.2-py3-none-any.whl#sha256=04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d (from https://download.pytorch.org/whl/cu128/typing-extensions/): Requested typing-extensions>=4.10.0 from https://download.pytorch.org/whl/typing_extensions-4.12.2-py3-none-any.whl#sha256=04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d (from torch) has inconsistent Name: expected 'typing-extensions', but metadata has 'typing_extensions'
ERROR: Could not find a version that satisfies the requirement typing-extensions>=4.10.0 (from torch) (from versions: 4.4.0, 4.8.0, 4.9.0, 4.12.2)
ERROR: No matching distribution found for typing-extensions>=4.10.0

Quick to mention that I'm not sure why you point out the "activate" script as it's doing nothing when I open it

(I have a 4070 if that matters for the context)

21broke avatar May 08 '25 08:05 21broke

@MemeboiMustang did those steps work out for you?

@21broke

Quick to mention that I'm not sure why you point out the "activate" script as it's doing nothing when I open it

The activate scripts activate the virtual environment. I should have mentioned you need to start Forge at least once to create the venv folder. If you're planning to use your global python install then this step isn't needed, otherwise, this is how you get it to install new packages into the virtual env. If you notice nothing happening, you can try activate.bat for command prompt or activate.ps1 for powershell. When correctly activated you will see the terminal line with the (venv) prefix, such as:

(venv) G:\AI\stable-diffusion-webui-forge>

As for your typing-extensions related error, you can try running the torch install command with --extra-index-url insead of --index-url, like so:

python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu128

I'm not 100% sure doing it this way will correctly install the CUDA version of torch though.

MisterChief95 avatar May 08 '25 18:05 MisterChief95

I was having the same error myself. I have an RTX 4060 Ti card. Forge was working perfectly fine yesterday; now suddenly I had the same error as above. I'm running Forge through StabilityMatrix.

In my case an OS restart solved the problem (at least temporarily). Worth noting that this was after a cuda crash, so it might have something to do with the drivers. This is a Linux Mint.

gellistvan avatar May 09 '25 03:05 gellistvan

I compiled one myself, which can customize variables and runs well in docker. You can try it.

https://github.com/amDosion/forage

Image

amDosion avatar May 11 '25 05:05 amDosion