🌐
Docker Hub
hub.docker.com › r › rocm › pytorch
rocm/pytorch - Docker Image
This repo hosts the docker images for PyTorch releases with ROCm backend support.
Docker HubFind and share images with your team.
Welcome to the world's largest container registry built for developers and open source contributors to find, use, and share their container images. Build, push and pull.
Explore
Google’s latest Gemma, small yet strong for chat and generation · Qwen3 is the latest Qwen LLM, built for top-tier coding, math, reasoning, and language tasks
Docker DesktopLocal development, simplified.
Docker Desktop app launched · If nothing happens, you may need to download Docker Desktop
Contact support
Gordon reviews Docker documentation to provide instant solutions. If you need additional support, submit a ticket to the Support team · This site is protected by hCaptcha and the hCaptcha Privacy Policy⁠ and Terms of Service⁠ apply
🌐
AMD ROCm
rocm.docs.amd.com › projects › install-on-linux › en › latest › install › 3rd-party › pytorch-install.html
PyTorch on ROCm installation — ROCm installation (Linux)
Use the rocm/pytorch:latest image, uninstall the preinstalled PyTorch package, and rebuild PyTorch from source. This ensures compatibility with your specific ROCm version, GPU architecture, and project requirements. Download the latest PyTorch Docker image.
Discussions

ROCm pytorch images size
The current size of the ROCm PyTorch Docker image, particularly rocm/pytorch:latest, is significantly large, consuming approximately 54 GB on disk when uncompressed. A more streamlined version, roc... More on github.com
🌐 github.com
2
December 25, 2023
How can i set up linux, rocm, pytorch for 7900xtx?
I wouldn’t touch windows with a 10ft pole for ROCm. Start with ubuntu 22.04.3, it has support for ROCm 5.7.0 and “should” (see note at the end) work best with the 7900xtx. AMD’s documentation on getting things running has worked for me, here are the prerequisites. Do these before you attempt installing ROCm. To actually install ROCm itself use this portion of the documentation. Lastly you wanted to use PyTorch. AMD gives a few options but they recommend using a docker image with PyTorch pre-installed. Assuming you know how to get docker all set up, this is listed as option 1 you can skip the other options and head to the bottom of the page if you need instructions on how to test your installation. My only recommendation outside of AMD’s documentation is to try an updated kernel version from what Ubuntu 22.04.3 ships with. Newer kernels have better support for the 7900xtx so this may solve some weird issues you may or may not run into. Ubuntu 23.04.X will ship with a more updated kernel, so you can start with that version instead if you prefer (although not officially supported but neither is the 7900xtx so make of that as you will). Or you can just swap kernel versions on 22.04.3 if you’d rather do that (also not officially supported). If you do want to go the nvidia route I’d pass on the 4090 and look for the 3090 on the used market to save some money, and I’m assuming the more important factor of your card is having 24gb of vram, not so much the higher speed. More on reddit.com
🌐 r/ROCm
20
6
October 14, 2023
I made some Docker files for running ROCm on windows through WSL2 for ComfyUI and Automatic1111
Now to add SwarmUI that uses comfyui backend More on reddit.com
🌐 r/ROCm
56
36
August 15, 2024
A video guide for installing ROCm drivers and Stable Diffusion in Linux for AMD GPU (Automatic1111 and ComfyUI)
It should not be this involved. It is still a cluster of a process. But I hope some folks can get this to work. More on reddit.com
🌐 r/Amd
22
62
November 19, 2023
🌐
GitHub
github.com › ROCm › ROCm-docker
GitHub - ROCm/ROCm-docker: Dockerfiles for the various software layers defined in the ROCm software platform · GitHub
This repository contains a framework for building the software layers defined in the Radeon Open Compute Platform into portable docker images. The following are docker dependencies, which should be installed on the target machine.
Starred by 521 users
Forked by 78 users
Languages   Shell 79.3% | Dockerfile 20.7%
🌐
Docker Hub
hub.docker.com › u › rocm
AMD ROCm(TM) Platform
This docker repo is used for hosting pytorch-nightly-build docker images. 19h · 50K+ 7 · image · AMD · 2d · 100K+ 2 · image · AMD · 2d · 3.7K · image · AMD · 2d · 50K+ image · AMD · Prebuilt image of environment to build MIGraphX https://github.com/ROCm/AMDMIGraphX ·
🌐
AMD ROCm
rocm.docs.amd.com › en › latest › how-to › rocm-for-ai › training › benchmark-docker › pytorch-training.html
Training a model with PyTorch on ROCm — ROCm Documentation
PyTorch is an open-source machine ... models. The PyTorch for ROCm training Docker image provides a prebuilt optimized environment for fine-tuning and pretraining a model on AMD Instinct MI325X and MI300X GPUs....
🌐
GitHub
github.com › ROCm › ROCm-docker › issues › 120
ROCm pytorch images size · Issue #120 · ROCm/ROCm-docker
December 25, 2023 - The current size of the ROCm PyTorch Docker image, particularly rocm/pytorch:latest, is significantly large, consuming approximately 54 GB on disk when uncompressed. A more streamlined version, rocm-torch-slim, has been created with a reduced size of around 28 GB through the use of a multistage build(Dockerfile).
Author   ROCm
🌐
Medium
medium.com › @tilak559 › pytorch-and-amd-gpu-simplified-deployment-with-docker-on-ubuntu-f04d43a8011a
PyTorch and AMD GPU: Simplified Deployment with Docker on Ubuntu | by Tilak Mudgal | Medium
April 30, 2024 - Once you’ve downloaded the PyTorch Docker image, you can start a Docker container using the following command: docker run -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \ --device=/dev/kfd --device=/dev/dri --group-add video \ --ipc=host --shm-size 8G rocm/pytorch:latest
🌐
Hacker News
news.ycombinator.com › item
I was able to use ROCm recently with Pytorch and after pulling some hair it work... | Hacker News
October 12, 2023 - Best of all is that I simply set the device to `torch.device('cuda')` rather than openCL, which does wonders for compatibility and to keep code simple · Protip: Use the official ROCM Pytorch base docker image [0]. The AMD setup is so finicky and dependent on specific versions of ...
Find elsewhere
🌐
Docker Hub
hub.docker.com › r › rocm › pytorch-training
rocm/pytorch-training - Docker Image
PyTorch is an open-source machine ... container, available through AMD Infinity Hub, provides prebuilt, optimized environment for fine-tuning, pre-training a model on the AMD Instinct™ MI300X and MI325X accelerator....
🌐
GitHub
gist.github.com › danielrosehill › db8e914aea38e0afb22827129c066acd
Easy PyTorch + ROCm Setup for AMD GPUs (Docker Recommended) · GitHub
docker run -it --rm \ --device=/dev/kfd \ --device=/dev/dri \ --group-add video \ --ipc=host \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:latest
🌐
Reddit
reddit.com › r/rocm › how can i set up linux, rocm, pytorch for 7900xtx?
r/ROCm on Reddit: How can i set up linux, rocm, pytorch for 7900xtx?
October 14, 2023 -

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.

Top answer
1 of 7
8
I wouldn’t touch windows with a 10ft pole for ROCm. Start with ubuntu 22.04.3, it has support for ROCm 5.7.0 and “should” (see note at the end) work best with the 7900xtx. AMD’s documentation on getting things running has worked for me, here are the prerequisites. Do these before you attempt installing ROCm. To actually install ROCm itself use this portion of the documentation. Lastly you wanted to use PyTorch. AMD gives a few options but they recommend using a docker image with PyTorch pre-installed. Assuming you know how to get docker all set up, this is listed as option 1 you can skip the other options and head to the bottom of the page if you need instructions on how to test your installation. My only recommendation outside of AMD’s documentation is to try an updated kernel version from what Ubuntu 22.04.3 ships with. Newer kernels have better support for the 7900xtx so this may solve some weird issues you may or may not run into. Ubuntu 23.04.X will ship with a more updated kernel, so you can start with that version instead if you prefer (although not officially supported but neither is the 7900xtx so make of that as you will). Or you can just swap kernel versions on 22.04.3 if you’d rather do that (also not officially supported). If you do want to go the nvidia route I’d pass on the 4090 and look for the 3090 on the used market to save some money, and I’m assuming the more important factor of your card is having 24gb of vram, not so much the higher speed.
2 of 7
4
I have no experience with Docker, but the 7900XTX works fine with Ubuntu 22.0.4.3 LTS aka Jammy, which I have installed as dual boot beside Win 11. So far I only played around a bit with Stable Diffusion to check the performance and help others with AMD out, because I have another rig with a 4090. Anyway this is how I did if for my Ubuntu dual boot Prerequisites: sudo apt update && sudo apt install -y git python3-pip python3-venv python3-dev libstdc++-12-dev install the amdgpu driver with rocm support curl -O https://repo.radeon.com/amdgpu-install/5.7.1/ubuntu/jammy/amdgpu-install_5.7.50701-1_all.deb (*) Initially I used an older driver (5.6 which I later upgraded). sudo dpkg -i amdgpu-install_5.7.50701-1_all.deb sudo amdgpu-install --usecase=graphics,rocm grant current user the access to gpu devices sudo usermod -aG video $USER sudo usermod -aG render $USER reboot is needed to make both driver and user group take effect sudo reboot If you have secure boot you need to enroll the MOK key on reboot, an old school looking menu will pop up on reboot where you have to enter the password you chose in Linux. Now for Stable Diffusion: git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui cd stable-diffusion-webui/ python3 -m venv venv source venv/bin/activate pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.7 Optional: edit webui-user.sh to uncomment and add arguments e.g. export COMMANDLINE_ARGS="--ckpt-dir /home/username/SD/MODELS" ./webui.sh → will install all additional requirements After start of web ui the bottom line should show something like this: torch: 2.2.0.dev20231013+rocm5.7 If you encounter problems, here is a nice script to check a Python venv if the PyTorch+ROCm installation really works: https://gist.github.com/damico/484f7b0a148a0c5f707054cf9c0a0533
🌐
Docker Hub
hub.docker.com › r › rocm › pytorch-nightly
rocm/pytorch-nightly - Docker Image
This docker repo is used for hosting pytorch-nightly-build docker images. ... This docker repo contains docker images with latest ROCm release with tip of pytorch/pytorch main branch, on a nightly basis.
🌐
PyTorch
pytorch.org › blog › pytorch-for-amd-rocm-platform-now-available-as-python-package
PyTorch for AMD ROCm™ Platform now available as Python package – PyTorch
March 24, 2021 - The ROCm ecosystem has an established history of support for PyTorch, which was initially implemented as a fork of the PyTorch project, and more recently through ROCm support in the upstream PyTorch code. PyTorch users can install PyTorch for ROCm using AMD’s public PyTorch docker image, and can of course build PyTorch for ROCm from source.
🌐
AMD ROCm
rocm.docs.amd.com › projects › install-on-linux › en › docs-6.1.5 › how-to › 3rd-party › pytorch-install.html
Installing PyTorch for ROCm — ROCm installation (Linux)
March 13, 2025 - Inside the docker container, run the following steps: Clone the PyTorch repository. cd ~ git clone https://github.com/pytorch/pytorch.git cd pytorch git submodule update --init --recursive · Set ROCm architecture (optional).
🌐
Reddit
reddit.com › r/rocm › i made some docker files for running rocm on windows through wsl2 for comfyui and automatic1111
r/ROCm on Reddit: I made some Docker files for running ROCm on windows through WSL2 for ComfyUI and Automatic1111
August 15, 2024 -

so, when they released that driver that allows you to run ROCm on WSL2 I wanted to have something that was super easy to set up however, turned out you need to copy a bunch of stuff and have a lot of fiddling to get it working so since there weren't any one click docker solutions, I made them myself,

Tested working on Windows 10 with an rx7900xtx

If you have a use for them here they are, with instructions

https://github.com/Bod9001/DockerFileForAMDAIWin

What is docker (basically imagine if someone got really annoyed of "it worked on my machine" and made an entire system for automating the install of the required packages and dependencies of a software to make sure it always works )

🌐
GitHub
github.com › sremes › rocm-docker
GitHub - sremes/rocm-docker: PyTorch (Nightly) with ROCm · GitHub
PyTorch (Nightly) with ROCm. Contribute to sremes/rocm-docker development by creating an account on GitHub.
Author   sremes