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

RuntimeError: Your device does not support the current version of Torch/CUDA! after installing adetailer.

Open Our0b0r05 opened this issue 1 year ago • 2 comments

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f2.0.1v1.10.1-previous-527-g720b80da
Commit hash: 720b80daea9070aa7896d8ce2c4a6cf8daf927cf
Traceback (most recent call last):
  File "C:\AI\webui_forge_cu124_torch24\webui\launch.py", line 54, in <module>
    main()
  File "C:\AI\webui_forge_cu124_torch24\webui\launch.py", line 42, in main
    prepare_environment()
  File "C:\AI\webui_forge_cu124_torch24\webui\modules\launch_utils.py", line 434, in prepare_environment
    raise RuntimeError(
RuntimeError: Your device does not support the current version of Torch/CUDA! Consider download another version:

Using the prebuilt CUDA 12.4 + Pytorch 2.4 package The program runs as expected, closes, reopens with no issues. I tested installing vectorscope CC, no issues. The moment I install adetailer, forge won't launch. Removing the extension doesn't fix the problem. I suspect that there might be some instability with how the prepackaged torch works that breaks its compatibility with adetailer and possibly other extensions.

My guess is this part of the installation is causing issues with the prepackaged install:

Installing collected packages: py-cpuinfo, torch, ultralytics-thop, torchvision, seaborn, ultralytics
  Attempting uninstall: torch
    Found existing installation: torch 2.4.0+cu124
    Uninstalling torch-2.4.0+cu124:
      Successfully uninstalled torch-2.4.0+cu124
  Attempting uninstall: torchvision
    Found existing installation: torchvision 0.19.0+cu124
    Uninstalling torchvision-0.19.0+cu124:
      Successfully uninstalled torchvision-0.19.0+cu124
Successfully installed py-cpuinfo-9.0.0 seaborn-0.13.2 torch-2.4.1 torchvision-0.19.1 ultralytics-8.2.91 ultralytics-thop-2.0.6

Our0b0r05 avatar Sep 11 '24 08:09 Our0b0r05

Bump

Our0b0r05 avatar Sep 16 '24 20:09 Our0b0r05

looks like its installing torch compiled without cuda (meaning torch won't be able to use GPU), same with torchvision (which is what adetailer uses too i think) You can reinstall torch+CUDA using pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 --force-reinstall I don't know where forge, or an extension, does the pip commands to install torch without cuda so i'm not sure if it will do that again

DraconicDragon avatar Sep 16 '24 21:09 DraconicDragon

  1. Don't forget before (!) forcing a reinstall to clear the cache (!) folders in your Forge webui and in appdata-local-pip!

  2. Also: rename the 'install.py' file in your Adetailer extension folder: since it's installed it will work without checking again that file - it's the file that is somehow upgrading torch2.4.0 to torch2.4.1 (see OP "Successfully installed [...] torch-2.4.1" etc.) which gives u the error message about "Your device does not support the current version of Torch/CUDA" (coming from 'launch.py' in the OPs comment - but the source of it is in the 'install.py' file of Adetailer's ui, somehow linked to 'requirements_versions.txt' in Forge WEBUI I guess!).

  3. After renaming the file in Adetailer's extension folder to 'installOLD.py' or something like that go in your Forge-venv-scripts environment, activate it and do the

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 --force-reinstall

or

pip install --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

This should install a CUDA-compatible version of PyTorch.

  1. However you may see the following error message (related to 'requirements_versions.txt' in Forge WEBUI):

blendmodes 2022 requires Pillow<10,>=9.0.0, but you have pillow 10.2.0 which is incompatible. open-clip-torch 2.20.0 requires protobuf<4, but you have protobuf 4.25.4 which is incompatible.

To avoid that do two further installs after your torch reinstall in the environment!

pip install blendmodes==2024.1.1

pip install open-clip-torch==2.26.1

  1. Upon your next restart everything should work fine.

I have to add I'm using the Forge WEBUI only, not the SYSTEM package, and I'm using only the webui-user.bat for it, updating only with 'git pull' in Forge WEBUI - not the updater.bat!

GlamoramaAttack avatar Sep 17 '24 17:09 GlamoramaAttack

I somehow messed up my whole folder trying to install the binaries over the pre-installed system bat files??

bbecausereasonss avatar Nov 08 '24 16:11 bbecausereasonss