stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

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

Open ocformula opened this issue 1 year ago • 18 comments

Is there an existing issue for this?

  • [X] 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

ocformula avatar Dec 06 '22 08:12 ocformula

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

jpentland avatar Dec 06 '22 16:12 jpentland

This bug has been open in ROCm now for 26 days: https://github.com/RadeonOpenCompute/ROCm/issues/1857

jpentland avatar Dec 08 '22 14:12 jpentland

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.

cooperdk avatar Dec 08 '22 15:12 cooperdk

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.

idesign2018 avatar Apr 04 '23 10:04 idesign2018

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.

hydrian avatar May 03 '23 15:05 hydrian

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

jpentland avatar May 04 '23 15:05 jpentland

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 avatar May 04 '23 17:05 cooperdk

@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.

hydrian avatar May 04 '23 18:05 hydrian

@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.

hydrian avatar May 04 '23 18:05 hydrian

Okay, thank you for your answer

Ben Tyger @.***> 于2023年5月5日周五 02:35写道:

@jpentland https://github.com/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.

— Reply to this email directly, view it on GitHub https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5468#issuecomment-1535230134, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCOEHQDMF5VS4ZNNH7PEBTXEPZF7ANCNFSM6AAAAAASVHKMPM . You are receiving this because you commented.Message ID: @.***>

idesign2018 avatar May 04 '23 23:05 idesign2018

@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.

cooperdk avatar May 06 '23 00:05 cooperdk

尝试将 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'。我是用的是官方的分支,大佬能不能指点一下

AaronZzzqy avatar May 12 '23 11:05 AaronZzzqy

How to install ROCm?Can you provide the installation package?

AaronZzzqy @.***> 于2023年5月12日周五 19:29写道:

尝试将 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'。我是用的是官方的分支,大佬能不能指点一下

— Reply to this email directly, view it on GitHub https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5468#issuecomment-1545597707, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCOEHVR6GFRLJWIKMOX3FTXFYNJJANCNFSM6AAAAAASVHKMPM . You are receiving this because you commented.Message ID: @.***>

idesign2018 avatar May 12 '23 16:05 idesign2018

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

Aaron2550 avatar May 12 '23 16:05 Aaron2550

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

hydrian avatar May 12 '23 17:05 hydrian

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.

Aaron2550 avatar May 12 '23 19:05 Aaron2550

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.

hydrian avatar May 12 '23 19:05 hydrian

I'm using AMD GPU and don't know how to install rocm, seeking your help

Ben Tyger @.***> 于2023年5月13日周六 03:49写道:

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.

— Reply to this email directly, view it on GitHub https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5468#issuecomment-1546213073, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCOEHRQA2LPXQWFQNWJE7TXF2H5TANCNFSM6AAAAAASVHKMPM . You are receiving this because you commented.Message ID: @.***>

idesign2018 avatar May 13 '23 01:05 idesign2018

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

ifiddle avatar May 30 '23 22:05 ifiddle