Repository: stable-diffusion-webui
Issue: [Bug]: AMD RX 6800 XT - All NaNs or Black Square on Fresh Install
Labels: asking-for-help-with-local-system-issues

### Is there an existing issue for this?

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

### What happened?

Followed each of the potential installation instructions to [install on AMD ](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs)
Automatic on Ubuntu 22.04, Arch with AMD, and Docker on Arch
No images able to be generated. Only NaN or black squares
Same issue on all fronts, so using the Docker installation process as an example
I am installing the program remotely via SSH on a gaming PC / Server, and accessing the UI via local network

### Steps to reproduce the problem

1. Fresh installation of Arch Linux using archinstall
2. Install AMD ROCm packages from AUR
3. export HSA_OVERRIDE_GFX_VERSION='10.3.0'
4. install docker and start it as a service
5. Follow instructions for [Running Inside Docker](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs#running-inside-docker)
(Image installed is [rocm5.5_ubuntu20.04_py3.8_pytorch_staging](https://hub.docker.com/layers/rocm/pytorch/rocm5.5_ubuntu20.04_py3.8_pytorch_staging/images/sha256-994bc9eff6839143433caa6b665b7584dd623b03c65dc132f3827cf6480dcec1?context=explore))
6. On first run, using REQS_FILE='requirements.txt' python launch.py --listen --precision full --no-half
-A tensor with all NaNs was produced in Unet.
7. Second run with REQS_FILE='requirements.txt' python launch.py --listen --precision full --no-half --disable-nan-check
-Processing appears to complete successfully, but only produces a black square

### What should have happened?

An image of any sort is generated from any prompt

### Commit where the problem happens

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/5ab7f213bec2f816f9c5644becb32eb72c8ffb89

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

Windows

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

Mozilla Firefox

### Command Line Arguments

```Shell
--listen --precision full --no-half --disable-nan-check
```


### List of extensions

No

### Console logs

```Shell
root@arch-ai:/dockerx/stable-diffusion-webui# REQS_FILE='requirements.txt' python launch.py --listen --precision full --
no-half
Python 3.8.16 (default, Mar  2 2023, 03:21:46)
[GCC 11.2.0]
Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89
Installing requirements
Launching Web UI with arguments: --listen --precision full --no-half
No module 'xformers'. Proceeding without it.
Loading weights [6ce0161689] from /dockerx/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Creating model from config: /dockerx/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (Doggettx).
Textual inversion embeddings loaded(0):
Model loaded in 3.2s (load weights from disk: 0.2s, create model: 0.7s, apply weights to model: 1.1s, load VAE: 0.2s, move model to device: 0.7s, load textual inversion embeddings: 0.2s).
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 10.2s (import torch: 1.1s, import gradio: 1.2s, import ldm: 0.6s, other imports: 0.6s, load scripts: 0.5s, load SD checkpoint: 3.3s, create ui: 0.6s, gradio launch: 2.1s).
  0%|                                                                                            | 0/20 [00:04<?, ?it/s]
Error completing request
Arguments: ('task(pwx4v24cl7fynog)', 'a spaceship shaped like a dragonfly shooting a laser', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, [], 0, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0) {}
Traceback (most recent call last):
  File "/dockerx/stable-diffusion-webui/modules/call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
  File "/dockerx/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/dockerx/stable-diffusion-webui/modules/txt2img.py", line 56, in txt2img
    processed = process_images(p)
  File "/dockerx/stable-diffusion-webui/modules/processing.py", line 515, in process_images
    res = process_images_inner(p)
  File "/dockerx/stable-diffusion-webui/modules/processing.py", line 669, in process_images_inner
    samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts)
  File "/dockerx/stable-diffusion-webui/modules/processing.py", line 887, in sample
    samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
  File "/dockerx/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 377, in sample
    samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
  File "/dockerx/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 251, in launch_sampling
    return func()
  File "/dockerx/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 377, in <lambda>
    samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
  File "/opt/conda/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/dockerx/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/sampling.py", line 145, in sample_euler_ancestral
    denoised = model(x, sigmas[i] * s_in, **extra_args)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1488, in _call_impl
    return forward_call(*args, **kwargs)
  File "/dockerx/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 167, in forward
    devices.test_for_nans(x_out, "unet")
  File "/dockerx/stable-diffusion-webui/modules/devices.py", line 156, in test_for_nans
    raise NansException(message)
modules.devices.NansException: A tensor with all NaNs was produced in Unet. Use --disable-nan-check commandline argument to disable this check.

^CInterrupted with signal 2 in <frame at 0x67c9a380, file '/dockerx/stable-diffusion-webui/webui.py', line 266, code wait_on_server>
root@arch-ai:/dockerx/stable-diffusion-webui# REQS_FILE='requirements.txt' python launch.py --listen --precision full --no-half --disable-nan-check
Python 3.8.16 (default, Mar  2 2023, 03:21:46)
[GCC 11.2.0]
Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89
Installing requirements
Launching Web UI with arguments: --listen --precision full --no-half --disable-nan-check
No module 'xformers'. Proceeding without it.
Loading weights [6ce0161689] from /dockerx/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Creating model from config: /dockerx/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (Doggettx).
Textual inversion embeddings loaded(0):
Model loaded in 3.4s (load weights from disk: 0.3s, create model: 0.8s, apply weights to model: 1.1s, load VAE: 0.2s, move model to device: 0.7s, load textual inversion embeddings: 0.2s).
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 10.4s (import torch: 1.3s, import gradio: 1.4s, import ldm: 0.4s, other imports: 0.7s, load scripts: 0.5s, load SD checkpoint: 3.4s, create ui: 0.5s, gradio launch: 2.1s).
100%|███████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.19it/s]
Total progress: 100%|███████████████████████████████████████████████████████████████████| 20/20 [00:09<00:00,  2.05it/s]
Total progress: 100%|███████████████████████████████████████████████████████████████████| 20/20 [00:09<00:00,  5.44it/s]
```


### Additional information

I am able to use the unofficial windows AMD installation process on the same machine without issue (aside from it being slow)