hydrian / stable-diffusion-webui-rocm

A stable diffusion webui configuration for AMD ROCm
GNU General Public License v2.0
22 stars 4 forks source link

Replace kernel in host would no longer need `COMMANDLINE_ARGS` #15

Open winstonma opened 1 year ago

winstonma commented 1 year ago

In the docker-compose.yml file, you mentioned that the Following line is needed to RX 5700. However, I discovered that the same line is also applicable to my Radeon 680M, which runs on the stock kernel (I tried version 6.2 kernel released on early august).

I recently installed the mainline kernel and upgraded to and installed kernel version version 6.1.43, and as a result, I no longer require the COMMANDLINE_ARGS. This update has improved the speed of image generation and lower the memory requirement (generate image with higher resolution without out of memory) in stable diffusion. No need to modify anything inside docker.

I think it's best to test it and mention it in README.md if that works.

hydrian commented 1 year ago

What version of stable-diffusion was that. In the past, that command line was needed for SD to detect my RX 6600XT and my RX570

winstonma commented 1 year ago

I don't think this flag doesn't required by stable diffusion. I personally guess that flag is required by the AMD Driver (I guess the flag would pass down from stable diffusion to PyTorch (ROCm) version and then to AMD Driver). After upgrading my AMD Driver I no longer need this flag to get stable diffusion work.

Here is my system Laptop running AMD 6800U (with 680M, using dedicated 8GB ram) Ubuntu 22.04.3 with system default 6.2.0-36-generic kernel (I use kernel 6.5+ because the new AMD P-State EPP Default would keep my AMD CPU temperature lower and thus it provides better performance on AMD especially laptop) Stable Diffusion WebUI 1.6 with PyTorch 2.2 Preview (PyTorch 2.0/2.1 should also work) AMD Driver 5.7.1

I don't need that flag anymore.

winstonma commented 1 year ago

If you don't mind please try to run my repo, which is the clone of your repo with several modification.

EDIT: To install PyTorch 2.1, please modify the following line to

RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6

It would download the latest AMD driver as well as using the unmodified stable diffusion. It works on my laptop but please see if it work on yours.

BUT please put in mind that I need to use kernel 6.2+ on the host linux system in order to get rid of the flags.

winstonma commented 1 year ago

@hydrian May I clarify something

I just checked my .bashrc on my host PC (not docker), there is

export HSA_OVERRIDE_GFX_VERSION=10.3.0

But after this line is placed on the host PC, I no longer need to put COMMANDLINE_ARGS in my docker environment.