Hey there! I am struggling to get Stable Diffusion to work here on NixOS. It is no problem on Garuda Linux on the same PC, so it should work in theory (at least i think so). I have this issue for month now and I can not find an answer for it. So I am just stuck at this point. The project i want to use is Stable Diffusion Webui by Automatic1111: GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI
Also i use this flake: GitHub - virchau13/automatic1111-webui-nix: AUTOMATIC1111/stable-diffusion-webui for CUDA and ROCm on NixOS
My GPU is an AMD ATI Radeon RX 6700 XT.
I can run the UI with the help of that flake and generate smaller images. But generating bigger images does not work. Here is my output:
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################
################################################################
Running on simon user
################################################################
################################################################
Repo already cloned, using it as install directory
################################################################
################################################################
Create and activate python venv
################################################################
################################################################
Launching launch.py...
################################################################
ldconfig: Can't open cache file /nix/store/aw2fw9ag10wr9pf0qk4nk5sxi0q0bn56-glibc-2.37-8/etc/ld.so.cache
: No such file or directory
Cannot locate TCMalloc (improves CPU memory usage)
Python 3.10.12 (main, Jun 6 2023, 22:43:10) [GCC 12.3.0]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments: --no-download-sd-model --api --no-half-vae --opt-split-attention
/home/simon/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/cuda/__init__.py:546: UserWarning: Can't initialize NVML
warnings.warn("Can't initialize NVML")
/opt/amdgpu/share/libdrm/amdgpu.ids: No such file or directory
/opt/amdgpu/share/libdrm/amdgpu.ids: No such file or directory
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Loading weights [ef76aa2332] from /home/simon/stable-diffusion-webui/models/Stable-diffusion/realisticVisionV51_v51VAE.safetensors
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/simon/stable-diffusion-webui/configs/v1-inference.yaml
Startup time: 12.4s (prepare environment: 3.8s, import torch: 3.0s, import gradio: 0.8s, setup paths: 0.8s, other imports: 0.6s, setu
p codeformer: 0.1s, load scripts: 0.4s, create ui: 0.8s, gradio launch: 2.1s).
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/simon/stable-diffusion-webui/venv/lib/python3.10/site-packages/c
v2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this proble
m.
Available platform plugins are: xcb, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, eglfs, linuxfb, minimal, m
inimalegl, offscreen, vnc.
/run/current-system/sw/bin/xdg-open: line 613: 166130 Aborted (core dumped) kde-open${KDE_SESSION_VERSION} "$1"
Applying attention optimization: Doggettx... done.
Model loaded in 10.0s (load weights from disk: 2.9s, create model: 0.4s, apply weights to model: 6.0s, calculate empty prompt: 0.5s).
MIOpen(HIP): Error [Compile] 'hiprtcCompileProgram(prog.get(), c_options.size(), c_options.data())' naive_conv.cpp: HIPRTC_ERROR_COMP
ILATION (6)
MIOpen(HIP): Error [BuildHip] HIPRTC status = HIPRTC_ERROR_COMPILATION (6), source file: naive_conv.cpp
MIOpen(HIP): Warning [BuildHip] /tmp/nix-shell.InWroS/comgr-0cd5eb/input/naive_conv.cpp:39:10: fatal error: 'limits' file not found
#include <limits> // std::numeric_limits
^~~~~~~~
1 error generated when compiling for gfx1030.
MIOpen Error: /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/MLOpen/src/hipoc/hipoc_program.cpp:304: Code object
build failed. Source: naive_conv.cpp
Exception in thread Thread-2 (load_model):
Traceback (most recent call last):
File "/nix/store/lx8vhp4fxclp494svlfis3sb2g8z4l9h-python3-3.10.12/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/nix/store/lx8vhp4fxclp494svlfis3sb2g8z4l9h-python3-3.10.12/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/simon/stable-diffusion-webui/modules/initialize.py", line 153, in load_model
devices.first_time_calculation()
File "/home/simon/stable-diffusion-webui/modules/devices.py", line 152, in first_time_calculation
conv2d(x)
File "/home/simon/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/simon/stable-diffusion-webui/extensions-builtin/Lora/networks.py", line 444, in network_Conv2d_forward
return originals.Conv2d_forward(self, input)
File "/home/simon/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/home/simon/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: miopenStatusUnknownError
0%| | 0/20 [00:00<?, ?it/s]
MIOpen(HIP): Error [Compile] 'hiprtcCompileProgram(prog.get(), c_options.size(), c_options.data())' naive_conv.cpp: HIPRTC_ERROR_COMP
ILATION (6)
MIOpen(HIP): Error [BuildHip] HIPRTC status = HIPRTC_ERROR_COMPILATION (6), source file: naive_conv.cpp
MIOpen(HIP): Warning [BuildHip] /tmp/nix-shell.InWroS/comgr-ebbdc4/input/naive_conv.cpp:39:10: fatal error: 'limits' file not found
#include <limits> // std::numeric_limits
^~~~~~~~
1 error generated when compiling for gfx1030.
terminate called after throwing an instance of 'miopen::Exception'
what(): /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/MLOpen/src/hipoc/hipoc_program.cpp:304: Code object bui
ld failed. Source: naive_conv.cpp
I can not run the UI without the flake:
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################
################################################################
Running on simon user
################################################################
################################################################
Repo already cloned, using it as install directory
################################################################
################################################################
Create and activate python venv
################################################################
################################################################
Launching launch.py...
################################################################
ldconfig: Can't open cache file /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/etc/ld.so.cache
: No such file or directory
Cannot locate TCMalloc (improves CPU memory usage)
Python 3.10.12 (main, Jun 6 2023, 22:43:10) [GCC 12.3.0]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Traceback (most recent call last):
File "/home/simon/stable-diffusion-webui/launch.py", line 48, in <module>
main()
File "/home/simon/stable-diffusion-webui/launch.py", line 39, in main
prepare_environment()
File "/home/simon/stable-diffusion-webui/modules/launch_utils.py", line 356, in prepare_environment
raise RuntimeError(
RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check?
with --skip-torch-cuda-test
:
./webui.sh --skip-torch-cuda-test
Bereits aktuell.
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################
################################################################
Running on simon user
################################################################
################################################################
Repo already cloned, using it as install directory
################################################################
################################################################
Create and activate python venv
################################################################
################################################################
Launching launch.py...
################################################################
ldconfig: Can't open cache file /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/etc/ld.so.cache
: No such file or directory
Cannot locate TCMalloc (improves CPU memory usage)
Python 3.10.12 (main, Jun 6 2023, 22:43:10) [GCC 12.3.0]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments: --skip-torch-cuda-test --no-download-sd-model --api --no-half-vae --opt-split-attention
Traceback (most recent call last):
File "/home/simon/stable-diffusion-webui/launch.py", line 48, in <module>
main()
File "/home/simon/stable-diffusion-webui/launch.py", line 44, in main
start()
File "/home/simon/stable-diffusion-webui/modules/launch_utils.py", line 432, in start
import webui
File "/home/simon/stable-diffusion-webui/webui.py", line 13, in <module>
initialize.imports()
File "/home/simon/stable-diffusion-webui/modules/initialize.py", line 14, in imports
import torch # noqa: F401
File "/home/simon/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/__init__.py", line 229, in <module>
from torch._C import * # noqa: F403
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
but libstdc++.so.6
should be on my system (right?):
nix-locate --top-level libstdc++.so.6
wasabibackend.out 2,206,888 r /nix/store/4cmwvpga2y2j94njlycld78j0fcy77f3-wasabibackend-2.0.2.1/lib/wasab
ibackend/Microservices/Binaries/lin64/Tor/libstdc++/libstdc++.so.6
wasabiwallet.out 2,206,888 r /nix/store/nh551a8kqfnhgjpl9qq07f0lbsrr9wvs-wasabiwallet-2.0.3/opt/wasabiwa
llet/Microservices/Binaries/lin64/Tor/libstdc++/libstdc++.so.6
tor-browser-bundle-bin.out 1,878,384 x /nix/store/4ckng76gnii7glc7nb3g405w2795xfd4-tor-browser-bundle-bin-12.5.4/s
hare/tor-browser/TorBrowser/Tor/libstdc++/libstdc++.so.6
tor-browser-bundle-bin.out 16,758,432 x /nix/store/4ckng76gnii7glc7nb3g405w2795xfd4-tor-browser-bundle-bin-12.5.4/s
hare/tor-browser/libstdc++/libstdc++.so.6
tor-browser-bundle-bin.out 16,758,432 x /nix/store/4ckng76gnii7glc7nb3g405w2795xfd4-tor-browser-bundle-bin-12.5.4/s
hare/tor-browser/libstdc++/libstdc++.so.6.0.28
tor-browser-bundle-bin.out 2,412 r /nix/store/4ckng76gnii7glc7nb3g405w2795xfd4-tor-browser-bundle-bin-12.5.4/s
hare/tor-browser/libstdc++/libstdc++.so.6.0.28-gdb.py
robo3t.out 0 s /nix/store/85m9g67x9fc7wwcqwj3639swx72s7hmy-robo3t-1.4.3/lib/robo3t/lib/lib
stdc++.so.6
robo3t.out 1,964,904 r /nix/store/85m9g67x9fc7wwcqwj3639swx72s7hmy-robo3t-1.4.3/lib/robo3t/lib/lib
stdc++.so.6.0.28
remarkable-toolchain.out 0 s /nix/store/cw01xn9j03vsflsvkr5a87hiwk84r2mz-remarkable-toolchain-3.1.2/sysr
oots/cortexa9hf-neon-remarkable-linux-gnueabi/usr/lib/libstdc++.so.6
remarkable-toolchain.out 1,561,028 x /nix/store/cw01xn9j03vsflsvkr5a87hiwk84r2mz-remarkable-toolchain-3.1.2/sysr
oots/cortexa9hf-neon-remarkable-linux-gnueabi/usr/lib/libstdc++.so.6.0.28
remarkable-toolchain.out 0 s /nix/store/cw01xn9j03vsflsvkr5a87hiwk84r2mz-remarkable-toolchain-3.1.2/sysr
oots/x86_64-codexsdk-linux/usr/lib/libstdc++.so.6
remarkable-toolchain.out 1,915,296 x /nix/store/cw01xn9j03vsflsvkr5a87hiwk84r2mz-remarkable-toolchain-3.1.2/sysr
oots/x86_64-codexsdk-linux/usr/lib/libstdc++.so.6.0.28
remarkable2-toolchain.out 0 s /nix/store/85bfb9p05mcyanvjpj1ry3zmn6pvjwr7-remarkable2-toolchain-3.1.2/sys
roots/cortexa7hf-neon-remarkable-linux-gnueabi/usr/lib/libstdc++.so.6
remarkable2-toolchain.out 1,556,920 x /nix/store/85bfb9p05mcyanvjpj1ry3zmn6pvjwr7-remarkable2-toolchain-3.1.2/sys
roots/cortexa7hf-neon-remarkable-linux-gnueabi/usr/lib/libstdc++.so.6.0.28
remarkable2-toolchain.out 0 s /nix/store/85bfb9p05mcyanvjpj1ry3zmn6pvjwr7-remarkable2-toolchain-3.1.2/sys
roots/x86_64-codexsdk-linux/usr/lib/libstdc++.so.6
remarkable2-toolchain.out 1,915,296 x /nix/store/85bfb9p05mcyanvjpj1ry3zmn6pvjwr7-remarkable2-toolchain-3.1.2/sys
roots/x86_64-codexsdk-linux/usr/lib/libstdc++.so.6.0.28
onlyoffice-bin.out 1,865,752 r /nix/store/a4zxmyrlh8xxp7mk79v546mc3kr5x6hs-onlyoffice-desktopeditors-7.2.0
/share/desktopeditors/converter/.system/libstdc++.so.6
onlyoffice-documentserver.out 1,566,440 r /nix/store/9as61l6jafqdg0bcdwcf5rnm971q7l9f-onlyoffice-documentserver-7.3.3
/var/www/onlyoffice/documentserver/server/FileConverter/bin/.system/libstdc++.so.6
mullvad-browser.out 16,758,432 x /nix/store/30rynvp242s4r2jhzxg17rd7n76brgq1-mullvad-browser-12.5.4/share/mu
llvad-browser/libstdc++/libstdc++.so.6
mullvad-browser.out 16,758,432 x /nix/store/30rynvp242s4r2jhzxg17rd7n76brgq1-mullvad-browser-12.5.4/share/mu
llvad-browser/libstdc++/libstdc++.so.6.0.28
mullvad-browser.out 2,412 r /nix/store/30rynvp242s4r2jhzxg17rd7n76brgq1-mullvad-browser-12.5.4/share/mu
llvad-browser/libstdc++/libstdc++.so.6.0.28-gdb.py
julia-bin.out 0 s /nix/store/jgxargzw8s24azfrg8af289l0rrznmsb-julia-bin-1.9.3/lib/julia/libst
dc++.so.6
julia-bin.out 19,066,032 x /nix/store/jgxargzw8s24azfrg8af289l0rrznmsb-julia-bin-1.9.3/lib/julia/libst
dc++.so.6.0.30
julia-lts.out 0 s /nix/store/2b3fyawvxjpik4bah1n14ri2qplsgccz-julia-bin-1.6.6/lib/julia/libst
dc++.so.6
julia-lts.out 18,344,864 x /nix/store/2b3fyawvxjpik4bah1n14ri2qplsgccz-julia-bin-1.6.6/lib/julia/libst
dc++.so.6.0.29
julia_18-bin.out 0 s /nix/store/16qsymiwarw212mrxj57c2h3pjz8d6mf-julia-bin-1.8.5/lib/julia/libst
dc++.so.6
julia_18-bin.out 19,066,032 x /nix/store/16qsymiwarw212mrxj57c2h3pjz8d6mf-julia-bin-1.8.5/lib/julia/libst
dc++.so.6.0.30
julia_18.out 2,830,920 x /nix/store/8kxas46d24zhiywhi9mxdmfzv39995z8-julia-1.8.5/lib/julia/libstdc++
.so.6
julia.out 2,830,920 x /nix/store/9qdgvw932xgzczkbd37344ryrlzhckpz-julia-1.9.3/lib/julia/libstdc++
.so.6
gcc-unwrapped.lib 0 s /nix/store/843dqq10jdkalr2yazaz6drx334visrb-gcc-12.2.0-lib/lib/libstdc++.so
.6
gcc-unwrapped.lib 2,830,920 x /nix/store/843dqq10jdkalr2yazaz6drx334visrb-gcc-12.2.0-lib/lib/libstdc++.so
.6.0.30
gcc-unwrapped.lib 2,494 r /nix/store/843dqq10jdkalr2yazaz6drx334visrb-gcc-12.2.0-lib/lib/libstdc++.so
.6.0.30-gdb.py
So, any ideas what to do? I bet it is something easy and obvious…