ROCm 6.1.3 complete install instructions from WSL to pytorch
How can i set up linux, rocm, pytorch for 7900xtx?
Failed to compile torchvision for ROCm as documented in pytorch.org
Pytorch rocm install error. How to fix this? - Stack Overflow
Videos
Its a bit tricky, but I got it working for me with my RX 7900XTX on Windows 11. They said native Windows support for ROCm is coming, but my guess is that it will be another year or two until it will be released, so currently only WSL with ubuntu on windows.
The problem is the documentation has gotten better but for someone who doesnΒ΄t want to spend hours on it, here is my stuff which works.
So the documentation sites I got all of it from are those:
rocm.docs.amd.com/en/latest/
rocm.docs.amd.com/projects/radeon/en/latest/index.html
rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/howto_wsl.html
rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/install-radeon.html
rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/install-pytorch.html
But as a short instruction here is the installation instructions from start to finish.
First install WSL and the currently only supported distribution of linux for WSL with ROCm which is 22.04 using cmd in admin mode, you will need to setup a username and password for the distribution once its installed.
wsl --install -d Ubuntu-22.04
then after install do this inside the distribution in which you can get to in cmd using command:
wsl
then to just update the install of ubuntu to the newest version for its components do those two commands:
sudo apt-get update
sudo apt-get upgrade
then to install the drivers and install rocm do this:
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
And then you have the base of rocm and the driver installed, then you need to install python and pytorch. Notice the only supported version is Python 3.10 with pytorch 2.1.2 as of my knowledge.
To install python with pytorch follow those instructions, as of my last use it will automatically install python 3.10:
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
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
The next is just updating to the WSL compatible runtime lib:
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
Then everything should be setup and running. To check if it worked use those commands in WSL:
python3 -c 'import torch; print(torch.cuda.is_available())'
python3 -c "import torch; print(f'device name [0]:', torch.cuda.get_device_name(0))"
python3 -m torch.utils.collect_env
Hope those instructions help other lost souls who are trying to get ROCm working and escape the Nvidia monopoly but unfortunately I have also an Nvidia RTX 2080ti and my RX 7900XTX can do larger batches in training, but is like a third slower than the older Nvidia card, but in Inference I see similar speeds.
Maybe someone has some optimization ideas to get it up to speed?
The support matrix for the supported GPUs and Ubuntu versions are here:
https://rocm.docs.amd.com/projects/radeon/en/latest/docs/compatibility/wsl/wsl_compatibility.html
If anything went wrong I can test it again. Hope also the links to the specific documentation sites are helpful if anything slightly changes from my installation instructions.
Small endnote, it took me months and hours of frustration to get this instructions working for myself, hope I spared you from that with this. And I noticed that if I only used another version of pytorch than the one above it will not work, even if they say pytorch in the nightly build with version 2.5.0 is supported, believe me I tried and it did not work.
I've been researching hundreds of posts over the past weeks with no luck.I tried doing it docker desktop for windows, but i wouldn't mind just having a linux on another disk to boot from, and have it all there.Linux isn't my first choice, but is the only one with pytorch rocm support afaik.
I'm studying applied statistics masters program, where I will meet with ML, which is what interest me the most, by the end of the year. I want to get ready beforehand, and try out a few available options such as deepfilternet, whisper, llama2, stable difusion... i hope you can recommend me some more, but for that i first need to get anything working at all.
Here's a complete list of commands out of my notepad++ i've encountered so far, but i think i need a differently guided way to do this as i cannot get the gpu detected.
Pretty sure I read the latest versions of rocm should support gfx1100, but the in combination with which os/image, kernel, headers&modules, rocm,...
If anyone can help me set this up I'd be supper grateful.
docker run -it --privileged --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --device=/dev/kfd --device=/dev/dri --group-add video --ipc=host --shm-size 24G rocm/pytorch:latest sudo apt list --installed sudo apt update sudo apt-get update sudo apt upgrade -y https://askubuntu.com/questions/1429376/how-can-i-install-amd-rocm-5-on-ubuntu-22-04 wget https://repo.radeon.com/amdgpu-install/5.3/ubuntu/focal/amdgpu-install_5.3.50300-1_all.deb sudo apt-get install ./amdgpu-install_5.3.50300-1_all.deb -y --allow-downgrades pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm5.5 pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm5.5--allow-downgrades wget https://repo.radeon.com/amdgpu-install/latest/ubuntu/focal/amdgpu-install_5.7.50700-1_all.deb -y sudo apt-get install ./amdgpu-install_5.7.50700-1_all.deb -y sudo apt install amdgpu sudo amdgpu-install --usecase=rocm -y sudo apt install amdgpu-dkms -y sudo apt install rocm-hip-sdk -y sudo dpkg --purge amdgpu-dkms -y sudo dpkg --purge amdgpu -y sudo apt-get remove amdgpu-dkms -y sudo apt-get install amdgpu-dkms -y sudo apt autoremove wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - echo 'deb [arch=amd64] https://repo.radeon.com/amdgpu/latest/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/amdgpu.list sudo apt install linux-modules-extra-5.4.0-64-generic linux-headers-5.4.0-64-generic sudo apt remove linux-modules-extra-5.8.0-44-generic linux-headers-5.8.0-44-generic sudo apt remove linux-modules-extra-5.4.0-164-generic linux-headers-5.4.0-164-generic sudo apt --fix-broken install -y sudo dpkg --purge amdgpu-dkms sudo dpkg --purge amdgpu -y sudo apt-get install amdgpu -y sudo apt update -y sudo apt upgrade -y rocminfo | grep gfx rocminfo
Hope it's not too disorganized, commands were used in different combos on different containers from "rocm/pytorch:latest" image. As i started from there, i hoped it would have these things ready with the gpu supported out of the box. I'm probably missing something obvious to you guys.
edit:
should i just give up and get nvidia? :( I really want to support amd, 1200 vs 2000eur isn't that little to a student.
After extensive testing, I've successfully installed ROCm 7.0 with PyTorch 2.8.0 for AMD RX 6900 XT (gfx1030 architecture) on Ubuntu 24.04.2. The setup runs ComfyUI's Wan2.2 image-to-video workflow flawlessly at 640Γ640 resolution with 81 frames. Here's my verified installation procedure:
π Prerequisites
-
Fresh Ubuntu 24.04.2 LTS installation
-
AMD RX 6000 series GPU (gfx1030 architecture)
-
Internet connection for package downloads
π Installation Steps
1. System Preparation
sudo apt install environment-modules
2. User Group Configuration
Why: Required for GPU access permissions
# Check current groups groups # Add current user to required groups sudo usermod -a -G video,render $LOGNAME # Optional: Add future users automatically echo 'ADD_EXTRA_GROUPS=1' | sudo tee -a /etc/adduser.conf echo 'EXTRA_GROUPS=video' | sudo tee -a /etc/adduser.conf echo 'EXTRA_GROUPS=render' | sudo tee -a /etc/adduser.conf
3. Install ROCm 7.0 Packages
sudo apt update wget https://repo.radeon.com/amdgpu/7.0/ubuntu/pool/main/a/amdgpu-insecure-instinct-udev-rules/amdgpu-insecure-instinct-udev-rules_30.10.0.0-2204008.24.04_all.deb sudo apt install ./amdgpu-insecure-instinct-udev-rules_30.10.0.0-2204008.24.04_all.deb wget https://repo.radeon.com/amdgpu-install/7.0/ubuntu/noble/amdgpu-install_7.0.70000-1_all.deb sudo apt install ./amdgpu-install_7.0.70000-1_all.deb sudo apt update sudo apt install python3-setuptools python3-wheel sudo apt install rocm
4. Kernel Modules and Drivers
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)" sudo apt install amdgpu-dkms
5. Environment Configuration
# Configure ROCm shared objects sudo tee --append /etc/ld.so.conf.d/rocm.conf <<EOF /opt/rocm/lib /opt/rocm/lib64 EOF sudo ldconfig # Set library path (crucial for multi-version installs) export LD_LIBRARY_PATH=/opt/rocm-7.0.0/lib # Install OpenCL runtime sudo apt install rocm-opencl-runtime
6. Verification
# Check ROCm installation rocminfo clinfo
7. Python Environment Setup
sudo apt install python3.12-venv python3 -m venv comfyui-pytorch source ./comfyui-pytorch/bin/activate
8. PyTorch Installation with ROCm 7.0 Support
pip install https://repo.radeon.com/rocm/manylinux/rocm-rel-7.0/pytorch_triton_rocm-3.4.0%2Brocm7.0.0.gitf9e5bf54-cp312-cp312 pip install https://repo.radeon.com/rocm/manylinux/rocm-rel-7.0/torch-2.8.0%2Brocm7.0.0.lw.git64359f59-cp312-cp312-linux_x86_64.whl pip install https://repo.radeon.com/rocm/manylinux/rocm-rel-7.0/torchvision-0.24.0%2Brocm7.0.0.gitf52c4f1a-cp312-cp312-linux_x86_64.whl pip install https://repo.radeon.com/rocm/manylinux/rocm-rel-7.0/torchaudio-2.8.0%2Brocm7.0.0.git6e1c7fe9-cp312-cp312-linux_x86_64.whl
9. ComfyUI Installation
git clone https://github.com/comfyanonymous/ComfyUI.git cd ComfyUI pip install -r requirements.txt
β Verified Package Versions
ROCm Components:
-
ROCm 7.0.0
-
amdgpu-dkms: latest
-
rocm-opencl-runtime: 7.0.0
PyTorch Stack:
-
pytorch-triton-rocm: 3.4.0+rocm7.0.0.gitf9e5bf54
-
torch: 2.8.0+rocm7.0.0.lw.git64359f59
-
torchvision: 0.24.0+rocm7.0.0.gitf52c4f1a
-
torchaudio: 2.8.0+rocm7.0.0.git6e1c7fe9
Python Environment:
-
Python 3.12.3
-
All ComfyUI dependencies successfully installed
π― Performance Notes
-
Tested Workflow: Wan2.2 image-to-video
-
Resolution: 640Γ640 pixels
-
Frames: 81
-
GPU: RX 6900 XT (gfx1030)
-
Status: Stable and fully functional
π‘ Pro Tips
-
Reboot after group changes to ensure permissions take effect
-
Always source your virtual environment before running ComfyUI
-
Check
rocminfooutput to confirm GPU detection -
The LD_LIBRARY_PATH export is essential - add it to your
.bashrcfor persistence
This setup has been thoroughly tested and provides a solid foundation for AMD GPU AI workflows on Ubuntu 24.04. Happy generating!Complete ROCm 7.0 + PyTorch 2.8.0 Installation Guide for RX 6900 XT (gfx1030) on Ubuntu 24.04.2After
extensive testing, I've successfully installed ROCm 7.0 with PyTorch
2.8.0 for AMD RX 6900 XT (gfx1030 architecture) on Ubuntu 24.04.2. The
setup runs ComfyUI's Wan2.2 image-to-video workflow flawlessly at
640Γ640 resolution with 81 frames. Here's my verified installation
procedure:π PrerequisitesFresh Ubuntu 24.04.2 LTS installation
AMD RX 6000 series GPU (gfx1030 architecture)
This setup has been thoroughly tested and provides a solid foundation for AMD GPU AI workflows on Ubuntu 24.04. Happy generating!
During the generation my system stays fully operational, very responsive and i can continue
-----------------------------
I have a very small PSU, so i set the PwrCap to use max 231 Watt:
rocm-smi
=========================================== ROCm System Management Interface ===========================================
===================================================== Concise Info =====================================================
Device Node IDs Temp Power Partitions SCLK MCLK Fan Perf PwrCap VRAM% GPU%
(DID, GUID) (Edge) (Avg) (Mem, Compute, ID)
========================================================================================================================
0 1 0x73bf, 29880 56.0Β°C 158.0W N/A, N/A, 0 2545Mhz 456Mhz 36.47% auto 231.0W 71% 99%
========================================================================================================================
================================================= End of ROCm SMI Log ==================================================
-----------------------------
got prompt
Using split attention in VAE
Using split attention in VAE
VAE load device: cuda:0, offload device: cpu, dtype: torch.float16
Using scaled fp8: fp8 matrix mult: False, scale input: False
Requested to load WanTEModel
loaded completely 9.5367431640625e+25 6419.477203369141 True
CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cuda:0, dtype: torch.float16
Requested to load WanVAE
loaded completely 10762.5 242.02829551696777 True
Using scaled fp8: fp8 matrix mult: False, scale input: True
model weight dtype torch.float16, manual cast: None
model_type FLOW
Requested to load WAN21
0 models unloaded.
loaded partially 6339.999804687501 6332.647415161133 291
100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 2/2 [07:01<00:00, 210.77s/it]
Using scaled fp8: fp8 matrix mult: False, scale input: True
model weight dtype torch.float16, manual cast: None
model_type FLOW
Requested to load WAN21
0 models unloaded.
loaded partially 6339.999804687501 6332.647415161133 291
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 2/2 [06:58<00:00, 209.20s/it]
Requested to load WanVAE
loaded completely 9949.25 242.02829551696777 True
Prompt executed in 00:36:38 on only 231 Watt!
I am happy after trying every possible solution i could find last year and reinstalling my system countless times! Roc7.0 and Pytorch 2.8.0 is working great for gfx1030
executed in 00:36:38 on only 231 Watt!
I am happy after trying every possible solution i could find last year and reinstalling my system countless times! Roc7.0 and Pytorch 2.8.0 is working great for gfx1030