Repository: stable-diffusion-webui
Issue: [Bug]: RuntimeError, Core dump on Linux Debian 11 (old-stable) with pyhton3.9-venv and AMD Ryzen Renoir APU
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Installed like this on Linux Debian 11:

> sdaidir="/path/stable-diffusion-webui" ; sudo apt install git python3-venv && if [[ ! -d "$sdaidir" ]]; then git clone --recursive "https://github.com/AUTOMATIC1111/stable-diffusion-webui.git" "$sdaidir" && cd "$sdaidir"||exit; else cd "$sdaidir";git pull origin master; fi; echo "Try to run: $(pwd)/webui.sh {your_arguments\*}"

In my case it installed python3-venv python3.9-venv instead of v. 3.10 which is used in [official installation manual](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs#automatic-installation) (on Debian 11, 3.10 was not available, i am wondering why you "hardcode" this version instead of using "apt install python3-venv" which would be more universal, installing latest available version anyway).

After running ./webui.sh # no parameters

> Experimental support for Renoir: make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half
> Launching launch.py...
> Cannot locate TCMalloc (improves CPU memory usage)
> Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
> [GCC 10.2.1 20210110]
> Version: v1.6.0
> Commit hash: 5ef669de080814067961f28357256e8fe27544f4
> Installing torch and torchvision
> Looking in indexes: https://download.pytorch.org/whl/rocm5.4.2
> Collecting torch==2.0.1+rocm5.4.2
>   Downloading https://download.pytorch.org/whl/rocm5.4.2/torch-2.0.1%2Brocm5.4.2-cp39-cp39-linux_x86_64.whl (1536.4 MB)
> ...
> Installing collected packages: mpmath, MarkupSafe, lit, filelock, cmake, urllib3, typing-extensions, sympy, pytorch-triton-rocm, networkx, jinja2, idna, charset-normalizer, certifi, torch, requests, pillow, numpy, torchvision
> ...
> Successfully installed MarkupSafe-2.1.2 certifi-2022.12.7 charset-normalizer-2.1.1 cmake-3.25.0 filelock-3.9.0 idna-3.4 jinja2-3.1.2 lit-15.0.7 mpmath-1.3.0 networkx-3.0 numpy-1.24.1 pillow-9.3.0 pytorch-triton-rocm-2.0.1 requests-2.28.1 sympy-1.12 torch-2.0.1+rocm5.4.2 torchvision-0.15.2+rocm5.4.2 typing-extensions-4.4.0 urllib3-1.26.13
> Traceback (most recent call last):
>   File "/path/stable-diffusion-webui/launch.py", line 48, in <module>
>     main()
>   File "/path/stable-diffusion-webui/launch.py", line 39, in main
>     prepare_environment()
>   File "/path/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
> 

When i then launch: ./webui.sh --skip-torch-cuda-test

> Installing open_clip
> Cloning Stable Diffusion into ...
> ...
> Installing requirements for CodeFormer
> Installing requirements
> Launching Web UI with arguments: --skip-torch-cuda-test
> no module 'xformers'. Processing without...
> no module 'xformers'. Processing without...
> No module 'xformers'. Proceeding without it.
> Warning: caught exception 'No HIP GPUs are available', memory monitor disabled
> ...

...then it launched webui...
On text2img tab i have added: giraffe
(input) and Generate button. Result on CLI:

> applying attention optimization: InvokeAI... done.
> loading stable diffusion model: RuntimeError
> Traceback (most recent call last):
> ...
> RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'
> 
> 
> Stable diffusion model failed to load
> Traceback (most recent call last):
> ...
> AttributeError: 'NoneType' object has no attribute 'cond_stage_model'
> Traceback (most recent call last):
> ...
> AttributeError: 'NoneType' object has no attribute 'cond_stage_model'
> Exception in thread Thread-3:
> Traceback (most recent call last):
> ...
> RuntimeError: "addmm_impl_cpu_" not implemented for 'Half'
> Using already loaded model v1-5-pruned-emaonly.safetensors [6ce0161689]: done in 0.0s
> *** Error completing request
> *** Arguments: ('task(1n2y94ll0amxqng)', 'giraffe', '', [], 20, 'DPM++ 2M Karras', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x7f5ca5f26430>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
>     Traceback (most recent call last):
> ...
> RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'
> 
> ---

Full output is [here](https://bin.disroot.org/?5253ef4f5b6dc2e3#3QYMvXU7mTYfmFEFevxK2TpHpdDVidmQwDu7Jr2Wug6H)

**BUT**, when I have used parameters " --skip-torch-cuda-test --precision full --no-half"
Then it **worked** to generate image. I have tried to use img2img to refine the image and noticed this inside output:

> QObject::moveToThread: Current thread (0x55b39ecd3b80) is not the object's thread (0x55b39ecefdb0).█████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [04:00<00:00, 13.78s/it]
> Cannot move to target thread (0x55b39ecd3b80)
> 
> qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/path/stable-diffusion-webui/venv/lib/python3.9/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, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx.
> 
> Aborted (core dumped)
> 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [03:52<00:00, 14.53s/it]
> Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [03:48<00:00, 14.30s/it]
> Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [03:48<00:00, 14.15s/it]

Is there something to improve so it is more user friendly without that runtime errors?
Do you have some feedback to the output posted to shed some light on it?
I am aware that some parts are duplicate to other already submitted issues.

### Steps to reproduce the problem

shown above

### What should have happened?

no errors or instructions on how to possibly workaround these

### Sysinfo

Pasted here for privacy reason: https://bin.disroot.org/?9e59881144e18384#CqpZtdj3dXMzVobkCRXvV3tR2gMHKgnFhK1RhteKMm8G

### What browsers do you use to access the UI ?

Mozilla Firefox

### Console logs

```Shell
posted already in "What happened" section (Full output is [here](https://bin.disroot.org/?5253ef4f5b6dc2e3#3QYMvXU7mTYfmFEFevxK2TpHpdDVidmQwDu7Jr2Wug6H))
```


### Additional information

_No response_