Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Updated installation instructions for installing Stable Diffusion using ROCm (Linux) (Documentation and webui.sh needs updating) #16807

Open
2 of 6 tasks
theman23290 opened this issue Jan 21, 2025 · 3 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@theman23290
Copy link

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

Run the same instructions as the documentation says for the first part.
(Debian): sudo apt install git python3.10-venv -y
(Fedora): sudo dnf install python-3.10
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui && cd stable-diffusion-webui
python3.10 -m venv venv

Then update line 156 in webui.sh
pip install torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm5.7 --> pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.2

Run webui.sh with this command
HSA_OVERRIDE_GFX_VERSION=11.0.0 HIP_VISIBLE_DEVICES=0 ./webui.sh --precision full --no-half

VERSION=11.0.0 is specific to the 7900XTX, version number may change depending on GPU model so check ROCm documentation just in case. If you have a 7900XTX, follow instructions exactly.

Steps to reproduce the problem

  1. Follow the official documentation

What should have happened?

Documentation and ROCm in webui.sh needs updating to make webui.sh work error free.

What browsers do you use to access the UI ?

Brave

Sysinfo

Not needed as the program is running with all features when instructions above is followed.

Console logs

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on user user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
glibc version is 2.40
Check TCMalloc: libtcmalloc_minimal.so.4
libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/lib64/libtcmalloc_minimal.so.4
Python 3.10.16 (main, Dec  4 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
ControlNet init warning: Unable to install insightface automatically. Please try run `pip install insightface` manually.
Launching Web UI with arguments: --precision full --no-half
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
ControlNet preprocessor location: /home/user/AI/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2025-01-21 14:56:37,167 - ControlNet - INFO - ControlNet v1.1.455
Loading weights [a31be20e08] from /home/user/AI/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
2025-01-21 14:56:37,546 - ControlNet - INFO - ControlNet UI callback registered.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: /home/user/AI/stable-diffusion-webui/configs/v1-inference.yaml
Startup time: 12.6s (prepare environment: 7.1s, import torch: 1.7s, import gradio: 0.4s, setup paths: 1.6s, other imports: 0.3s, load scripts: 0.6s, create ui: 0.4s, gradio launch: 0.3s).

Additional information

No response

@theman23290 theman23290 added the bug-report Report of a bug, yet to be confirmed label Jan 21, 2025
@the-real-vortex-v
Copy link

You might be better off using this fork that is made to support AMD GPU's and ROCm:

https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu-forge

I'm using it with RX 6700 and some user compiled ROCm libs etc. It works well for me.

@hapwizard
Copy link

I second this with an AMD 7800XT. The rom5.7 nightly is not currently available anyway (403 error) and even installing rocm5.7 stable into the venv manually with pip doesn't work. For me, launch.py (and by extension webui.sh) will launch assuming there is a CUDA card involved, even with the HSA_GFX_OVERRIDE. Skipping the cuda check just causes more errors and the webui won't launch. Using pip to install torch and torchvision using the --index-url https://download.pytorch.org/whl/rocm6.2 argument was the only thing that worked. After installing those versions, I can launch using ./webui.sh without any arguments and image generation works.

As for @the-real-vortex-v recommendation to using stable-diffusion-webui-amdgpu-forge, I tried it and it doesn't work. Following the automatic installation instructions still yields the same issue where it assumes I have a CUDA card unless I install rocm6.2.4 manually. I believe this issue is specific to the RX7800 / Navi 3x series cards. I had a 6700xt and had no issues with webui. Everything went wrong when I upgraded my card to the 7800xt.

@hanspetzer
Copy link

hanspetzer commented Mar 1, 2025

Thank you for finding a solution for this, I haven't started Webui for a few months and suddenly i got an error when launching the webui.sh script: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check

Trying a new installation of webui failed too with a 403 error when downloading the rocm5.7 torch version.

Then I found your post and got my installation working again:

I changed the script from rocm5.7 to 6.2, manually uninstalled torch, torchvision and torchaudio with pip in the venv and manually installed the 6.2 version. The manuall part was probably unnecessary and changing the script and launching it would have been enough, but it's working again and I'm happy.

Hopefully this will be updated soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

4 participants