ROCm 6.1.3 complete install instructions from WSL to pytorch
Complete ROCm 7.0 + PyTorch 2.8.0 Installation Guide for RX 6900 XT (gfx1030) on Ubuntu 24.04.2
ROCm and PyTorch on AMD APU or GPU (AI) - Tutorials - Linux Containers Forum
machine learning - Installing Pytorch for Windows 11 and AMD GPU - 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.
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