lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.29k stars 808 forks source link

Torch 2.4 error (Your device does not support the current version of Torch; 4080 Super). So which devices DO support Torch 2.4? #988

Open aoleg opened 2 months ago

aoleg commented 2 months ago

Fresh install from https://github.com/lllyasviel/stable-diffusion-webui-forge/releases/download/latest/webui_forge_cu124_torch24.7z updated to latest commit 86ee2d9462cc3baf8618430513e2fc0b6e4cabff. Unable to run with "Your device does not support the current version of Torch/CUDA" error.

Using RTX 4080 Super, Windows 11, latest GeForce drivers, CUDA 12.4 installed from https://developer.nvidia.com/cuda-12-4-0-download-archive

If Torch 2.4 is not supported on this hardware, which devices does it support then? Or am I missing something? (Yes, I can probably roll back to https://github.com/lllyasviel/stable-diffusion-webui-forge/releases/download/latest/webui_forge_cu121_torch21.7z, but I'd like to use the latest version of Torch).

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-223-g86ee2d94 Commit hash: 86ee2d9462cc3baf8618430513e2fc0b6e4cabff Traceback (most recent call last): File "C:\stable-diffusion\forge124\webui\launch.py", line 51, in main() File "C:\stable-diffusion\forge124\webui\launch.py", line 39, in main prepare_environment() File "C:\stable-diffusion\forge124\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: https://github.com/lllyasviel/stable-diffusion-webui-forge/releases/tag/latest Press any key to continue . . .

Ezgons123 commented 2 months ago

Same here, rtx 3060

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-223-g86ee2d94 Commit hash: 86ee2d9462cc3baf8618430513e2fc0b6e4cabff Traceback (most recent call last): File "C:\webuiForgeNew\webui\launch.py", line 51, in main() File "C:\webuiForgeNew\webui\launch.py", line 39, in main prepare_environment() File "C:\webuiForgeNew\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: https://github.com/lllyasviel/stable-diffusion-webui-forge/releases/tag/latest Pressione qualquer tecla para continuar. . .

pycms-nube commented 2 months ago

My RTX 2080 works fine, that’s weird. CUDA 12.4 do support RTX series I think. I log my configuration in this issue: #987 Not sure if the problem was from the "CUDA" in the prebuilt package.

MisterChief95 commented 2 months ago

Your device of course does support Torch 2.4 & CUDA 12.4. The issue is that there is a missing dependency with Windows. (see pytorch/pytorch#131662)

Basically, you need to install the latest MSVC build tools (https://aka.ms/vs/17/release/vs_BuildTools.exe). The specific component you need is MSVC v143 - VS 2022 C++ x64/x86 builds tools (latest). You can try running the command in the linked issue, but I personally think its easier to run the buildTools.exe and select the individual component:

image

Once that is done, just reboot your PC and you should be good to go.

@lllyasviel - perhaps a note for this could be added to readme?

aoleg commented 2 months ago

Many thanks, that worked! I did have MS build tools installed, yet missing this particular component.

warrockmill commented 2 months ago

Your device of course does support Torch 2.4 & CUDA 12.4. The issue is that there is a missing dependency with Windows. (see pytorch/pytorch#131662)

Basically, you need to install the latest MSVC build tools (https://aka.ms/vs/17/release/vs_BuildTools.exe). The specific component you need is MSVC v143 - VS 2022 C++ x64/x86 builds tools (latest). You can try running the command in the linked issue, but I personally think its easier to run the buildTools.exe and select the individual component:

image

Once that is done, just reboot your PC and you should be good to go.

@lllyasviel - perhaps a note for this could be added to readme?

Just to ask but i've got a 2060 super and apparently I can run upto CUDA 12.2

Would this be enough to run the latest version if I go through the BuildTools guide?

Ezgons123 commented 2 months ago

Your device of course does support Torch 2.4 & CUDA 12.4. The issue is that there is a missing dependency with Windows. (see pytorch/pytorch#131662)

Basically, you need to install the latest MSVC build tools (https://aka.ms/vs/17/release/vs_BuildTools.exe). The specific component you need is MSVC v143 - VS 2022 C++ x64/x86 builds tools (latest). You can try running the command in the linked issue, but I personally think its easier to run the buildTools.exe and select the individual component:

image

Once that is done, just reboot your PC and you should be good to go.

@lllyasviel - perhaps a note for this could be added to readme?

Thanks, it worked!

Necro-mancer commented 2 months ago

I also faced the same issue when trying to run the preinstalled package. Even installing Visual Studio didn't help. What did work, however, was installing forge via the old git clone method. I remember I faced the same issue few months ago too when I installed forge via the same pre-installed package but using the git pull method worked flawlessly (Maybe it has something to do with windows 11, I don't know). Now it is working perfectly with cu12.4. Also, if someone doesn't want to re-download python packages they can just re-use the packages from the installation zip by copying the site-packages folder from the zip into webui/venv/Lib directory.

alex13by commented 2 months ago

Will torch2.4 bring more performance changes?

wktra commented 2 months ago

I'm getting this error too and nobody gives a shit

zethfoxster commented 2 months ago

I'm getting this error too and nobody gives a shit

the fix is literally posted in this thread.....looks like you didnt even bother to read.

wktra commented 2 months ago

I'm getting this error too and nobody gives a shit

the fix is literally posted in this thread.....looks like you didnt even bother to read.

I read and I tried all of the "solutions" installing MS Build tools didn't work. Neither did reinstalling CUDA or putting a finger up your mom's butthole.

What did work just now was clicking on the "webui-user.bat" and NOT clicking on the RUN.BAT as suggested for people who used the zipped archive.

kutchek commented 2 months ago

**What did work just now was clicking on the "webui-user.bat"

Same way

sd321ca commented 2 months ago

I got the same error after updating to CUDA 12.4. The solutions above didn't work for me. In my case, the fix was to ensure that the Torch version being used was installed with CUDA 12.4 support. My Forge was configured to point to and make use of my old A1111 environment which was in a different folder, and that used a venv. So I went to the venv/scripts folder of that installation and ran "python" and in the python command line ran the following:

import torch
print(torch.version.cuda)

This showed that the CUDA version was none in my case. So I uninstalled torch. I think I used pip uninstall torch but can't remember for sure. I reinstalled with: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 (your install command may be different but you can get it from here: https://pytorch.org/get-started/locally/)

Forge worked fine after that. I am running a RTX 4060 8GB mobile on Windows (Intel)

martjay commented 2 months ago

不知道你是不是用了花儿大佬的一键启动器,在高级设置里找到安全性设置,关掉就好了

charlumau commented 2 months ago

Your device of course does support Torch 2.4 & CUDA 12.4. The issue is that there is a missing dependency with Windows. (see pytorch/pytorch#131662)

Basically, you need to install the latest MSVC build tools (https://aka.ms/vs/17/release/vs_BuildTools.exe). The specific component you need is MSVC v143 - VS 2022 C++ x64/x86 builds tools (latest). You can try running the command in the linked issue, but I personally think its easier to run the buildTools.exe and select the individual component:

image

Once that is done, just reboot your PC and you should be good to go.

@lllyasviel - perhaps a note for this could be added to readme?

Im trying to help someone installing forge but he ran into the same problem. we try the build box solution but it did not work. What else can we do?

LilithDragoness commented 2 months ago

The only way I can run Forge on a remote computer with an A6000 GPU is by using the following command:

pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 xformers --index-url https://download.pytorch.org/whl/cu118

Otherwise, I get the error message mentioned above. Version 1.21 doesn’t work. It’s a remote machine running Linux.

zethfoxster commented 2 months ago

I'm getting this error too and nobody gives a shit

the fix is literally posted in this thread.....looks like you didnt even bother to read.

I read and I tried all of the "solutions" installing MS Build tools didn't work. Neither did reinstalling CUDA or putting a finger up your mom's butthole.

What did work just now was clicking on the "webui-user.bat" and NOT clicking on the RUN.BAT as suggested for people who used the zipped archive.

LOL you're obviously a smooth brain clown, as of the moment you completed the suggested steps in this thread, using the RUN or the webui-user.bat would BOTH have worked. its ok, not everyone can be adept in simple one-click set ups LOL

lgwjames commented 2 months ago

Just found this post from a Google search, I installed forge, changed the web ui to share SD models and worked for 4 hours. on a reboot, got the error:

venv "C:\Users\jessi\Desktop\Forge\webui\venv\Scripts\Python.exe" 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-224-g90019688 Commit hash: 9001968 Traceback (most recent call last): File "C:\Users\jessi\Desktop\Forge\webui\launch.py", line 51, in main() File "C:\Users\jessi\Desktop\Forge\webui\launch.py", line 39, in main prepare_environment() File "C:\Users\jessi\Desktop\Forge\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: https://github.com/lllyasviel/stable-diffusion-webui-forge/releases/tag/latest

done as requested above, was even a update from 17.11.1 to 17.11.2

rebooting now to see if works

lawlessc commented 1 month ago

I am seeing this same error locally on Kubuntu with an RTX 2060 Super.

Previously i had forge working fine with this machine on Windows. Though that was likely a version from around April.

future2017 commented 1 month ago

更新到 CUDA 12.4 后,我遇到了同样的错误。上述解决方案对我不起作用。就我而言,解决方法是确保使用的 Torch 版本安装了 CUDA 12.4 支持。我的 Forge 配置为指向并使用我的旧 A1111 环境,该环境位于不同的文件夹中,并使用了 venv。因此,我转到该安装的 venv/scripts 文件夹并运行“python”,然后在 python 命令行中运行以下命令:

import torch
print(torch.version.cuda)

这表明我的 CUDA 版本为空。 所以我卸载了 torch。我想我用过,pip uninstall torch但记不清了。 我重新安装了:( pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 您的安装命令可能不同,但您可以从这里获取:https://pytorch.org/get-started/locally/

此后 Forge 运行良好。 我在 Windows (Intel) 上运行 RTX 4060 8GB 移动设备

试了一下,我的问题和你的一样,我试了同样的方式得到了解决

Alicyl commented 1 month ago

Your device of course does support Torch 2.4 & CUDA 12.4. The issue is that there is a missing dependency with Windows. (see pytorch/pytorch#131662)

Basically, you need to install the latest MSVC build tools (https://aka.ms/vs/17/release/vs_BuildTools.exe). The specific component you need is MSVC v143 - VS 2022 C++ x64/x86 builds tools (latest). You can try running the command in the linked issue, but I personally think its easier to run the buildTools.exe and select the individual component:

image

Once that is done, just reboot your PC and you should be good to go.

@lllyasviel - perhaps a note for this could be added to readme?

Is there a specific place the build tools need to go or are they supposed to fix the problem from their default installation? I installed the latest build tool as advised, restarted my computer, and tried to relaunch ForgeUI, but I encountered the same error as mentioned in the original post.

Did an update break something? ForgeUI was working just fine until yesterday, and I didn't change or touch anything besides update.bat.

Zati1980 commented 1 month ago

I have the same error what you have done did script install CUDA 12.6 Your device does not support the current version of Torch. Can you not push fault patches to the people ?

SilverSeed93 commented 1 month ago

I am getting the same thing. I have a 4080 Super as well.

What I have tried:

  1. Checked build tools is installed. It is.
  2. Uninstalled build tools.
  3. Restarted computer.
  4. Installed build tools.
  5. Restarted computer.
  6. Attempted to run; error.

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-535-gb20cb4bf Commit hash: b20cb4bf0e526f890fcd40a4d039da581cfebafa Traceback (most recent call last): File "C:\_AI\webui_forge_cu121_torch21\webui\launch.py", line 54, in <module> main() File "C:\_AI\webui_forge_cu121_torch21\webui\launch.py", line 42, in main prepare_environment() File "C:\_AI\webui_forge_cu121_torch21\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: https://github.com/lllyasviel/stable-diffusion-webui-forge/releases/tag/latest

At this point I have attempted all pre-baked archive installers.

NVCC: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Wed_Feb__8_05:53:42_Coordinated_Universal_Time_2023 Cuda compilation tools, release 12.1, V12.1.66 Build cuda_12.1.r12.1/compiler.32415258_0

There are no updates for CUDA 12.1 at the moment that I can run. I could only try downgrading it.

I'll go and try the old install method. But I'd love to know if anyone else has any ideas on this.

SilverSeed93 commented 1 month ago

FYI I solved this problem for myself by pre-creating a python env and preinstalling torch before launching for the first time.

cd D:_AI\forgeui python -m venv venv venv\scripts\activate pip install torch==2.3.1+cu121 torchaudio==2.3.1+cu121 --index-url https://download.pytorch.org/whl/cu121 webui-user.bat