AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: rx570 with pytorch with rocm 5.7 doesnt launch #14758

Open picarica opened 10 months ago

picarica commented 10 months ago

Checklist

What happened?

doesnt launch

Steps to reproduce the problem

i installed with

  1. git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
  2. cd stable.. bla bla
  3. python3 -m venv venv
  4. source venv/bin/activate
  5. pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.7
  6. deactivate
  7. adding --precision full --no-half to export command variable doesnt launch

What should have happened?

work damnit

What browsers do you use to access the UI ?

No response

Sysinfo

cant do it

Console logs

To create a public link, set `share=True` in `launch()`.
Startup time: 508.3s (prepare environment: 108.7s, import torch: 3.8s, import gradio: 0.9s, setup paths: 1.0s, initialize shared: 0.1s, other imports: 0.7s, setup codeformer: 0.1s, list SD models: 392.0s, load scripts: 0.4s, create ui: 0.3s, gradio launch: 0.3s).
QObject::moveToThread: Current thread (0x55f006794100) is not the object's thread (0x55f006794240).
Cannot move to target thread (0x55f006794100)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/cv2/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 problem.

Available platform plugins are: xcb, minimal, offscreen, wayland-egl, wayland.

/usr/bin/xdg-open: line 603: 245017 Aborted                 (core dumped) kde-open${KDE_SESSION_VERSION} "$1"
6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa
Loading weights [6ce0161689] from /home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Creating model from config: /home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/configs/v1-inference.yaml
loading stable diffusion model: RuntimeError
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1002, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/initialize.py", line 147, in load_model
    shared.sd_model  # noqa: B018
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/shared_items.py", line 128, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/sd_models.py", line 531, in get_sd_model
    load_model()
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
                                                                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2139, in load_state_dict
    load(self, state_dict)
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2127, in load
    load(child, child_state_dict, child_prefix)  # noqa: F821
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2127, in load
    load(child, child_state_dict, child_prefix)  # noqa: F821
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2127, in load
    load(child, child_state_dict, child_prefix)  # noqa: F821
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 1 more time]
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2121, in load
    module._load_from_state_dict(
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/sd_disable_initialization.py", line 225, in <lambda>
    linear_load_from_state_dict = self.replace(torch.nn.Linear, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(linear_load_from_state_dict, *args, **kwargs))
                                                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/modules/sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/_meta_registrations.py", line 4820, in zeros_like
    res.fill_(0)
RuntimeError: HIP error: invalid device function
HIP kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing AMD_SERIALIZE_KERNEL=3.
Compile with `TORCH_USE_HIP_DSA` to enable device-side assertions.

Stable diffusion model failed to load
Applying attention optimization: Doggettx... done.

rocBLAS error: Cannot read /home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/lib/rocblas/library/TensileLibrary.dat: Illegal seek for GPU arch : gfx803
 List of available TensileLibrary Files : 
"/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/lib/rocblas/library/TensileLibrary_lazy_gfx1030.dat"
"/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/lib/rocblas/library/TensileLibrary_lazy_gfx1100.dat"
"/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/lib/rocblas/library/TensileLibrary_lazy_gfx906.dat"
"/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/lib/rocblas/library/TensileLibrary_lazy_gfx908.dat"
"/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/lib/rocblas/library/TensileLibrary_lazy_gfx90a.dat"
"/home/picarica/StableDiffusion/rocm-test/stable-diffusion-webui/venv/lib/python3.11/site-packages/torch/lib/rocblas/library/TensileLibrary_lazy_gfx900.dat"
./webui.sh: line 256: 196870 Aborted                 (core dumped) "${python_cmd}" -u "${LAUNCH_SCRIPT}" "$@"

Additional information

i am on gentoo i have installed dev-libs/roct-thunk-interface and dev-libs/rocr-runtime. [ebuild R ~] dev-libs/roct-thunk-interface-5.7.1 [ebuild R ~] dev-libs/rocr-runtime-5.7.1-r1

DGdev91 commented 9 months ago

You can try to add this in webu_user.sh export HSA_OVERRIDE_GFX_VERSION=9.0.0

you'll most likely need also to add --lowvram to your commandline args

i'm not 100% if that works for your gpu, but trying does not harm