AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: Automatic install on Archlinux fails because of non-matching packages. #14530

Open syntaxbullet opened 10 months ago

syntaxbullet commented 10 months ago

Checklist

What happened?

When running the automated install script as mentioned on an up to date arch linux installation, the process works fine until the pytorch installation version 5.4.2 happens, the following error gets displayed:

[3 lines of output]
      Looking in indexes: https://download.pytorch.org/whl/rocm5.4.2
      ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
      ERROR: No matching distribution found for setuptools>=40.8.0
      [end of output]

Steps to reproduce the problem

  1. install git, wget and python3
  2. download the script from the repository using wget
  3. run the script on arch linux with an AMD GPU

What should have happened?

WebUI should install successfully

What browsers do you use to access the UI ?

Mozilla Firefox, Google Chrome

Sysinfo

Intel Core i7 - 12700k, AMD Radeon RX6900XT, 32GB DDR4, Arch Linux x64

Console logs

error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      Looking in indexes: https://download.pytorch.org/whl/rocm5.4.2
      ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
      ERROR: No matching distribution found for setuptools>=40.8.0
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
  File "/home/syntaxbullet/stable-diffusion/stable-diffusion-webui/launch.py", line 48, in <module>
    main()
  File "/home/syntaxbullet/stable-diffusion/stable-diffusion-webui/launch.py", line 39, in main
    prepare_environment()
  File "/home/syntaxbullet/stable-diffusion/stable-diffusion-webui/modules/launch_utils.py", line 378, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "/home/syntaxbullet/stable-diffusion/stable-diffusion-webui/modules/launch_utils.py", line 116, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/home/syntaxbullet/stable-diffusion/stable-diffusion-webui/venv/bin/python3" -m pip install torch==2.0.1+rocm5.4.2 torchvision==0.15.2+rocm5.4.2 --index-url https://download.pytorch.org/whl/rocm5.4.2
Error code: 1


### Additional information

_No response_
jtaub commented 10 months ago

Exact same issue on Ubuntu 23.10, despite the following:

$ sudo apt-get install python3-setuptools

python3-setuptools is already the newest version (68.1.2-2).
desmond27 commented 10 months ago

I am facing this same issue.

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      Looking in indexes: https://download.pytorch.org/whl/rocm5.4.2
      ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
      ERROR: No matching distribution found for setuptools>=40.8.0
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
  File "/home/dd/Code/stable-diffusion/stable-diffusion-webui/launch.py", line 48, in <module>
    main()
  File "/home/dd/Code/stable-diffusion/stable-diffusion-webui/launch.py", line 39, in main
    prepare_environment()
  File "/home/dd/Code/stable-diffusion/stable-diffusion-webui/modules/launch_utils.py", line 378, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "/home/dd/Code/stable-diffusion/stable-diffusion-webui/modules/launch_utils.py", line 116, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/home/dd/Code/stable-diffusion/stable-diffusion-webui/venv/bin/python3" -m pip install torch==2.0.1+rocm5.4.2 torchvision==0.15.2+rocm5.4.2 --index-url https://download.pytorch.org/whl/rocm5.4.2
Error code: 1

The installed version of python-setuptools is 69.0.3-1:

➜  yay -S python-setuptools 
Sync Dependency (1): python-setuptools-1:69.0.3-1
[sudo] password for dd: 
warning: python-setuptools-1:69.0.3-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Package (1)              Old Version  New Version  Net Change

extra/python-setuptools  1:69.0.3-1   1:69.0.3-1     0.00 MiB

Total Installed Size:  4.68 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
syntaxbullet commented 10 months ago

Alright everyone! After a little bit of research I managed to fix the issue on my side.

Turns out what is happening is that while installing rocm5.4.2 pip encounters an error because there is no python 3.12 or 3.11 build of this package available for this version of rocm..

I got around this issue by confirming I was running python 3.11 or 3.12, and then manually installing rocm into the venv

# confirm your python version
python3 -V
# 1. change into the correct directory
cd ./stable-diffusion-webui
# 2. activate the venv
source venv/bin/activate
# install rocm
# AMD users can install rocm and pytorch with pip if you don't have it already installed, this is the command to install the stable version:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6

# This is the command to install the nightly with ROCm 5.7 which has a python 3.12 package and might have some performance improvements:

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.7

I personally installed the nightly build and afterwards i was able to run the script without any errors.

tilkinsc commented 9 months ago

This issue is indeed still apparent, trying patch https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/14530#issuecomment-1882874836 from above, for more detail https://download.pytorch.org/whl/rocm5.4.2 just doesn't exist (404) and there is nothing on that whl repo for a replacement, I got everything working in the end, thanks Chad!

DarthBrandon commented 8 months ago

Getting the same errors as in the OP, on Kubuntu 23.10.

I tried the workaround in https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/14530#issuecomment-1882874836. It did install, but it errors out trying to test CUDA, because I don't have any NVIDIA cards. If I disable the CUDA test, it runs, but says "No HIP GPUs are available."

On my system I have an AMD Ryzen 9 7900X CPU, which has integrated graphics. I also have an AMD Radeon RX 6500 XT GPU, which is Navi 24, I think. So I don't know if it's defaulting to the integrated GPU or just not seeing either GPU for some reason.

Either way, I can't figure out how to get it working as long as the automatic install is busted.

tilkinsc commented 8 months ago

Its very important to have the correct python version, which may fix your issue.