Trying to run stable diffusion with AMD GPU...Do I need private drivers?
Hi guys! I have a Desktop with Nobara, and open source mesa drivers for my 7800XT. When I try to run the webui.sh launcher, I get a segfault when trying to create the model. Is there a way to run it with open source drivers? Or without having to uninstall them? Can both privative and open source drivers coexist? This is mostly my gaming computer, but I'd like to be able to use it for stable diffusion as well.
You gotta be more precise with everything you just wrote.
trying to run the webui.sh launcher? I assume you mean the webui from automatic1111 ? there are many different stable diffusion webui's out there so you gotta tell us what exactly you use.
Private and Public drivers? What exactly do you mean with that?
If asking for technical help - always always attach as many logs as you can. In this case, attach the console output you get when trying to launch webui.sh
Sigh…I wrote that before going to sleep. Very half assed post and sorry for the crappy details.
1.- Yes that's correct. automatic111 it is.
2.- Sorry I meant open source vs AMD closed source binaries. I was not thinking very straight what I was typing. I believe I'm running Mesa 23.3.0, and I wouldn't want to change this with the privative binary as I've been told it might have a performance hit and additional trouble when gaming. But if rocm is an independent library/extension from the drivers and wont affect gaming I guess I can install it.
3.- Sure...it doesn't get too far. Launches, opens the browser to the UI interface, and then dies within a second or so.
$ ./webui.sh
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################
################################################################
Running on iturnedintoanewt user
################################################################
################################################################
python venv already activate or run without venv: /home/iturnedintoanewt/stable-diffusion/stable-diffusion-webui/venv
################################################################
################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
Python 3.11.6 (main, Oct 3 2023, 00:00:00) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)]
Version: v1.7.0
Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e
Launching Web UI with arguments:
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Style database not found: /home/iturnedintoanewt/stable-diffusion/stable-diffusion-webui/styles.csv
Calculating sha256 for /home/iturnedintoanewt/stable-diffusion/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors: Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
Startup time: 9.3s (prepare environment: 3.7s, import torch: 2.1s, import gradio: 0.5s, setup paths: 1.7s, other imports: 0.5s, load scripts: 0.1s, create ui: 0.3s, gradio launch: 0.2s).
6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa
Loading weights [6ce0161689] from /home/iturnedintoanewt/stable-diffusion/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Creating model from config: /home/iturnedintoanewt/stable-diffusion/stable-diffusion-webui/configs/v1-inference.yaml
./webui.sh: line 256: 778241 Segmentation fault (core dumped) "${python_cmd}" -u "${LAUNCH_SCRIPT}" "$@"
You might find more information if you look into "open source" and "proprietary" drivers instead of public and private, if that's what you mean. From what I've read unless you need very specific OpenGL drivers the open source AMD drivers that come likely installed will be your best option. As mentioned below some logs of what the error is would be useful.
I run stable diffusion in a docker container. Most kernels ships the required drivers, and you can install the rocm libraries inside a docker container to keep them from poluting the host.
Here's my docker image, feel free to take a look. I won't guarantee it'll work for you, but hopefully it will give you some hints in the right direction. https://codeberg.org/it-a-me/auto1111-webui_rocm
You need to build for rocm instead of cuda. I've done this in my Ubuntu box at home rx580.
Message me if you can't get it figured out with a stack overflow search.
I...think what I'm missing is the rocm. Does installing it override the open source Mesa libraries? I would want to keep my gaming PC being a gaming desktop, and I heard the AMD privative drivers come with a performance hit and additional mess to sort out. If ROCM is just an additional extension ala CUDA without installing the full driver, and can be used together with Mesa, then I guess I can go this route.