[Feature Request]: Documentation
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What would your feature do ?
Install stable-diffusion-webui with latest Torch/CUDA.
The install instructions for stable-diffusion-webui invite NVidia users to visit https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs
This is all fine and okay. But running the the webui.sh script in a fresh venv as instructed installs torch==2.0.1, which wants old CUDA 11.8, and downloads a lot of extra stuff for that. Which leads to endless problems with downloading old drivers, parallel installs of old CUDA, pickling and unpickling different sets of environment variables, and other unsupported stuff we don't really need. Not to mention all the extra support requests that generates.
Almost everybody is using Torch 2.3.0.x/CUDA 12.x now. And they work work absolutely fine with stable-diffusion-webui. There's no need to download and install all that old material!
Proposed workflow
First, make sure you have a gcc-12 compiler and toolchain set up. I used conda for this. Many Linux distros are on gcc13+ now. Users lured here for glamor of AI, who have no experience with pip, do not realize it invokes a compiler. And gcc-13 tosses in some hot patches for glibc that just won't work for building against CUDA (which has already implemented its own conflicting fixes). TL-DR. Just get CC to point to gcc-12 somehow.
export CC=/my/gcc-12/gcc
Then install python 3.10 and set it up in the venv environment inside the stable-diffusion-webui folder. I used
virtualenv venv --python=python3.10
. venv/bin/activate
Now, install torch nightly from https://pytorch.org/get-started/locally/ . We can even pip install xformers .
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121
If you already have cached packages from another venv, it will use those.
Finally, run webui.sh. It will see a better version of torch is already installed. And everything works perfectly.
Additional information
That's it! The installer works. It pops up a web page on http://127.0.0.1:7860/ as expected.
And we are go for launch.