• Gears

    Stable Diffusion on AMD GPU

    I installed Stable Diffusion Web UI on my PC, which has AMD Radeon RT 6700 XT graphic card. When testing, I found out that UI is not utilzing GPU, but only CPU.

    After trying different settings, CPU utilizatzion ratio dropped down to 75-78%, Stable Diffusion is still not using GPU.

    Now below method solved my problem, tried to render pictures with Automatic1111, GPU utilization rate is 99% when rendering, whilst CPU is below 25%.

    I am happy to share the process which works pretty well on my PC, hope this could be helpful to those who encounter the same problem as mine.

    Suppose AMD graphic card driver is already up to date, Pathon 3.10.x (add to PATH) and Git Bash are installed.

    Create a new folder under root, like c:\sd, do NOT put it under folders like Desktop, My Documents or so.

    Install web UI under c:\sd folder: “git clone https://github.com/lshqqytiger/stable-diffusion-webui-directml && cd stable-diffusion-webui-directml && git submodule init && git submodule update”.

    Edit “webui-user.bat” file with editor, insert “COMMANDLINE_ARGS=–skip-torch-cuda-test –opt-sub-quad-attention –disable-nan-check –opt-sdp-attention –precision full –no-half –use-zluda –skip-ort” and save the file.

    Run webui-user.bat, if error occurs, this is normal at the current stage. Just forget it and close web UI and Terminal.

    Download and install AMD HIP SDK 6.2.4.

    Download the latest Zluda files for ROCm.

    Create c:\zluda folder, extract all file from zluda-windows-rocm6-amd64.zip, paste everything under c:\zluda.

    Open c:\Program Files\AMD\ROCm\6.2\bin\rocblas folder and find “library” sub-folder, rename “library” to something like “library-backup” or similar, so that one won’t forget it. In case later on we may need the files again.

    Download library for hip sdk based on gfx version, RT 6700 XT = GFX1031. Extract files then put extracted file “rocblas.dll” and folder “library” under c:\Program Files\AMD\ROCm\6.2\bin\rocblas as they are, now we have a new “library” folder which contains downloaded lib files we need.

    Add c:\zluda folder and %HIP_PATH%bin to PATH, restart PC.

    Now we run webui-user.bat, to render image for the first time could or could not take longer, but as from the second image, it is charmful.

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.