AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: sdwebui failed to create an image successfully with '--precision full --no-half' option on RX 5700.

ocformula opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

When creating an image with rx 5700, only a blank screen is created.
However, if the '--precision full --no-half' or '--no-half' options are used, the image is created normally.

The Radeon RX 6000 Series and the RX 500 Series have been verified to function normally without the option ' --precision full --no-half'.
Is this a problem with rocm or pytorch?

And I think it would be better to update the wiki that you don't need to use the '--precision full --no-half' option or the '--no-half' option on the rx 6000 series and rx 500 series.
If you do not use this option, you can save a lot of vram.

Steps to reproduce the problem

  1. install ubuntu and rocm and pytorch and sdwebui on system with rx 5700 (gfx1010)
  2. generate image
  3. The system is normally loaded, but finally a blank image is created.

What should have happened?

The rx 6000 series or rx 500 series have been confirmed to function normally
only rx 5700 systems seem to experience this issue

Commit where the problem happens

latest

What platforms do you use to access UI ?

Linux

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

No response

Additional information, context and logs

No response

Would be amazing if there was a fix for the RX5700. Using full precision and --medram reduces performance by about 4x, but also actually works.

Interstingly using --no-half-vae makes every image random noise instead of a grey square. It's almost as if the weights aren't being loaded properly, or are being treated as all 0

This bug has been open in ROCm now for 26 days: ROCm/ROCm#1857

Well once again, SD is based on torch (and similar modules) which is a CUDA module. Therefore, you're only guaranteed for this to work with a CUDA-enabled GPU (nVidia).
It might use some OpenCL instead like Mac M1/M2 probably do, but then you are already "off the path" when talking Stable Diffusion.

My GPU is amd Radeon pro duo and I have two errors according to the tutorial.
The first one: error code suggests that: 1
The second: source is not an internal or external command, nor a runnable program or batch file
Seeking help from everyone.

Try upgrading ROCm to 5.4.2 and Torch 2.x. I'm running a 6600XT with 8GB of RAM without much problem if I stay below 640x640 images.

I have a docker image and a fork of SD-Webui that implements the changed need to get it working. You find it at https://github.com/hydrian/stable-diffusion-webui-rocm. I'd love more feedback so we can get these changes pushed back to this project.

The docker builds and starts up with no issues, but on my card, when trying to generate an image, it seems to just freeze with no output

What os do you use? Also, why do you use Docker for something like this? I guarantee that will give you issues due to indirect access to the GPU.
If using Windows, I would use wsl2 og you really want to. But as the ui uses a virtual environment as it is, there is absolutely no reason to use Docker.

@cooperdk There are lots of reasons to run in docker because of SDW dependencies. At least on Linux, getting them passed through to docker isn't bad.

@jpentland

The docker builds and starts up with no issues, but on my card, when trying to generate an image, it seems to just freeze with no output

If you are talking about my docker build, please open issues on my repo, not here. Otherwise, this will confuse the two projects.

@cooperdk There are lots of reasons to run in docker because of SDW dependencies. At least on Linux, getting them passed through to docker isn't bad.

From what I can see from various reports, it is actually significantly slower due to the handling of data transfer thru docker. So if you really need to use docker you'd need a good reason to. Talking about dependencies is kinda bullsh*t since you can use a virtualenv in Python which is the gradio recommended solution.

For stuff like this you need to weed out all bottlenecks. Docker is a bottleneck.

There are also known issues with specific tasks in SD which present problems in Docker.

尝试将 ROCm 升级到 5.4.2 和 Torch 2.x。如果我保持低于 640x640 图像,我正在运行具有 8GB RAM 的 6600XT,没有太大问题。

我有一个 docker 图像和一个 SD-Webui 的分支,它实现了让它工作的改变需求。您可以在https://github.com/hydrian/stable-diffusion-webui-rocm找到它。我希望获得更多反馈,以便我们可以将这些更改推回该项目。

我是windows平台5600x + 6600xt但是我去执行txt2img的话会报错RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'。我是用的是官方的分支,大佬能不能指点一下

On my RX5700XT, i get a gray square no matter if i start with or without --precision full --no-half

What version of rocm and what kernel version are you running?

I'm on a fresh Arch Install. Kernel 6.3.1, Python 3.10.11, Pytorch 1.13.1, ROCM 5.2. I followed the generic guide, got the gray image and then tried following the Arch-specific guide, which didnt change anything for me.

What version of rocm and what kernel version are you running? Are you using DKMS? I don't think you need with a kernel that new.

For my case, RX5700 have issues with " --no-half --precision full --medvram "
I think the issues of RX5700 might be fixed, better to update the installation guide.

Platform: Windows 10
CPU: Ryzen 5 3600 6 Core processor
GPU: AMD Radeon RX5700 8GB VRAM (driver updated to 5/12/2023 [31.0.14057.2005] )
RAM: 16GB

--opt-sub-quad-attention --no-half --precision full --lowvram
512x512 - 1m 36s

--opt-sub-quad-attention --no-half --precision full --medvram
Bluescreen : video_memory_management_internal

--opt-sub-quad-attention --medvram
512x512 - 33.92s