cancel
Showing results for 
Search instead for 
Did you mean: 

How To Run AMD ROCm™ Software in Windows 11

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 

 

 wsl --install

 

image (1).png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

STEP 2:

Install AMD ROCm™ software

https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/install-radeon.htm 

AMD_AI_1-1721338056543.png

 

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 

AMD_AI_2-1721338254359.png

 

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

AMD_AI_3-1721338498399.png

 

AMD_AI_5-1721338532130.png

Example: ComfyUI running in WSL with an AMD Radeon™ RX 7900 XTX