Written by: @adam_kozak
AMD ROCm™ Software in Windows
Ever want to run the latest Stable Diffusion programs using AMD ROCm™ software within Microsoft Windows?
The latest AMD Software 24.6.1 (or later) and AMD ROCm™ 6.1.3 (or later) support the ability to run Linux apps in Windows using hardware acceleration of your AMD Radeon™ RX 7000 Series graphics card.
Follow these 3 simple steps below to get started.
STEP 1:
Install WSL from Windows Powershell (install Ubuntu 22.04 - later versions will introduce errors)
wsl --install
STEP 2:
Install AMD ROCm™ software
https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/install-radeon.htm
sudo apt update
wget https://repo.radeon.com/amdgpu-install/6.1.3/ubuntu/jammy/amdgpu-install_6.1.60103-1_all.deb
sudo apt install ./amdgpu-install_6.1.60103-1_all.deb
amdgpu-install -y --usecase=wsl,rocm --no-dkms
Step 3:
Install Torch for AMD ROCm™ software and WSL
https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/install-pytorch.html
sudo apt install python3-pip -y
pip3 install --upgrade pip wheel
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1.3/torch-2.1.2%2Brocm6.1.3-cp310-cp310-linux_x86_64.whl
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1.3/torchvision-0.16.1%2Brocm6.1.3-cp310-cp310-linux_x86_64.whl
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1.3/pytorch_triton_rocm-2.1.0%2Brocm6.1.3.4d510c3a44-cp310-cp310-linux_x86_64.whl
pip3 uninstall torch torchvision pytorch-triton-rocm numpy torchaudio
pip3 install torch-2.1.2+rocm6.1.3-cp310-cp310-linux_x86_64.whl torchvision-0.16.1+rocm6.1.3-cp310-cp310-linux_x86_64.whl pytorch_triton_rocm-2.1.0+rocm6.1.3.4d510c3a44-cp310-cp310-linux_x86_64.whl numpy==1.26.4
pip3 install torchaudio==2.1.2
Once that is done – the last sequence for WSL is:
location=`pip show torch | grep Location | awk -F ": " '{print $2}'`
|
cd ${location}/torch/lib/
|
rm libhsa-runtime64.so*
|
cp /opt/rocm/lib/libhsa-runtime64.so.1.2 libhsa-runtime64.so
|
Now you can install and run apps that support AMD ROCm™ software without leaving the Windows environment!
Note that if you are installing apps – check the requirements.txt and comment out the torch lines so you don’t overwrite your AMD ROCm™ software builds – else you will need to reinstall those
Example: ComfyUI running in WSL with an AMD Radeon™ RX 7900 XTX