🟥

RX7900XTXでAUTOMATIC1111/stable-diffusion-webuiを動かすまで

2024/04/12に公開

https://github.com/AUTOMATIC1111/stable-diffusion-webui

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs

UbuntuをインストールしてROCmドライバーをインストール

https://rocm.docs.amd.com/projects/install-on-linux/en/latest/tutorial/quick-start.html

sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
sudo usermod -a -G render,video $LOGNAME
wget https://repo.radeon.com/amdgpu-install/6.0.2/ubuntu/jammy/amdgpu-install_6.0.60002-1_all.deb
sudo apt install ./amdgpu-install_6.0.60002-1_all.deb
sudo apt update
sudo apt install amdgpu-dkms
sudo apt install rocm
echo "Please reboot system for all settings to take effect."

webui.sh を編集してtorchとtorchvisionのバージョンをROCmのバージョンに合わせて編集する

webui.sh
if ! echo "$gpu_info" | grep -q "NVIDIA";
then
    if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]]
    then
-        export TORCH_COMMAND="pip install torch==2.0.1+rocm5.4.2 torchvision==0.15.2+rocm5.4.2 --index-url https://download.pytorch.org/whl/rocm5.4.2"
+        export TORCH_COMMAND="pip install torch==2.3.0.dev20240210+rocm6.0 torchvision==0.18.0.dev20240210+rocm6.0 --index-url https://download.pytorch.org/whl/nightly/rocm6.0"
    elif echo "$gpu_info" | grep -q "Huawei" && [[ -z "${TORCH_COMMAND}" ]]
    then
        export TORCH_COMMAND="pip install torch==2.1.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu; pip install torch_npu"
    
    fi
fi

--no-half オプションをつけて実行 つけないと生成中に落ちた

./webui.sh --no-half

Discussion