lshqqytiger / stable-diffusion-webui-amdgpu

Stable Diffusion web UI
GNU Affero General Public License v3.0
1.67k stars 174 forks source link

[Bug]: New zluda installations fail since latest commit + Temporary Fix #438

Closed CS1o closed 2 months ago

CS1o commented 2 months ago

Checklist

What happened?

Since the latest update from yesterday when launching the webui-user.bat with --use-zluda you get following error listed down below in the console log.

A temporary fix is also down below for anyone struggling with the installation right now.

Steps to reproduce the problem

Important step: Open up a cmd and run pip cache purge to clear all the downloaded whl files. Git clone the directml webui into a new folder. Edit the webui-user.bat with --use-zluda at the line COMMANDLINE_ARGS=

What should have happened?

The webui should normaly start to download and install the right pytorch whl file.

Sysinfo

AMD RX 7900XTX on Zluda 3.7 Windows 10 64bit AMD Adrenalin 24.3.1

Console logs

venv "D:\Programme\AI-Zeug\test\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
WARNING: ZLUDA works best with SD.Next. Please consider migrating to SD.Next.
Using ZLUDA in C:\Program Files\ZLUDA
fatal: No names found, cannot describe anything.
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: 1.8.0-RC
Commit hash: 1dbd549d46918bf04bea4c6a244a1bb576f6e0e3
Installing torch and torchvision
D:\Programme\AI-Zeug\test\stable-diffusion-webui-directml\venv\Scripts\python.exe: Error while finding module specification for 'torch==2.2.1' (ModuleNotFoundError: No module named 'torch==2')
Traceback (most recent call last):
  File "D:\Programme\AI-Zeug\test\stable-diffusion-webui-directml\launch.py", line 48, in <module>
    main()
  File "D:\Programme\AI-Zeug\test\stable-diffusion-webui-directml\launch.py", line 39, in main
    prepare_environment()
  File "D:\Programme\AI-Zeug\test\stable-diffusion-webui-directml\modules\launch_utils.py", line 586, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "D:\Programme\AI-Zeug\test\stable-diffusion-webui-directml\modules\launch_utils.py", line 121, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "D:\Programme\AI-Zeug\test\stable-diffusion-webui-directml\venv\Scripts\python.exe" -m torch==2.2.1 torchvision --index-url https://download.pytorch.org/whl/cu118
Error code: 1
Drücken Sie eine beliebige Taste . . .

Additional information

Temporary Fix

Navigate inside the stable-diffusion-webui-directml/venv/scripts folder. Open up a cmd by clicking into the Explorer bar (not searchbar) and type cmd and hit enter. Type: activate.bat and hit enter. Now copy and paste this line and hit enter: pip install torch==2.2.1 torchvision --index-url https://download.pytorch.org/whl/cu118

UnknownSz commented 2 months ago

By having that temp fix, in your opinion this issue come as a result of missing some installations either in the Zluda setup or the WebUi setup?

Edit : Didn't work for me as a fix still broken, "still looking for CUDA".

CS1o commented 2 months ago

Its an issue in the webui. My guess is that's an issue in the launch_utils.py file at the line 486. There is the command pip install missing infront of torch==2.2.1

Also the fix should work. I tested it on a clean install. You need to make sure you have the zluda files and also installed the AMD HIP 5.7.1 drivers. Aswell as being on AMD Adrenalin 24.1.1 or later.

Then you also need to make sure you have the zluda folder added to your system variables in PATH aswell as the entry %HIP_PATH%bin

And if you have an unsupported GPU (below 6800) then you need additional steps and the custom rocm library.