$linuxjunkies
>

Install ROCm for AMD GPUs on Linux

Install AMD's ROCm compute platform on Ubuntu, Fedora, and Arch Linux: add repos, install packages, configure groups, and verify with rocminfo.

AdvancedUbuntuDebianFedoraArch9 min readUpdated June 7, 2026

Before you start

  • A supported AMD GPU (GCN 5 / Vega or newer recommended)
  • Linux kernel 5.15 or later with the amdgpu module
  • sudo or root access to install packages and modify groups
  • Active internet connection to reach repo.radeon.com

ROCm (Radeon Open Compute) is AMD's open-source GPU compute platform, enabling OpenCL, HIP, and machine-learning frameworks like PyTorch and TensorFlow to run on Radeon hardware. Getting it working requires the right GPU, the right kernel, and careful attention to package sources. This guide walks through a clean ROCm installation on the three major distro families, ending with verification and common fixes.

Supported GPUs

Not every AMD GPU is supported. ROCm 6.x officially targets GCN 5 (Vega) and newer architectures. The practical tier list:

  • Fully supported: Radeon VII, RX 5000 series (Navi 10), RX 6000 series (Navi 21/23), RX 7000 series (Navi 31/32/33), Instinct MI50/MI100/MI200/MI300
  • Community/experimental: RX 480/580 (Polaris, GCN 4) — may work with HSA_OVERRIDE_GFX_VERSION env var but is unsupported
  • Not supported: RDNA 3 integrated graphics (680M) has partial support; older GCN 1–3 cards are dropped

Check AMD's official ROCm compatibility matrix before proceeding. Running an unsupported GPU wastes hours of debugging.

Kernel and DKMS Requirements

ROCm 6.x requires Linux kernel 5.15 or newer. Ubuntu 22.04 LTS ships 5.15, Ubuntu 24.04 ships 6.8 — both are fine. Fedora 39/40 ship 6.x kernels. You also need the amdgpu kernel module active, which is in-tree on any modern distro using the default kernel. Avoid mainline or custom kernels unless you know what you're doing with DKMS.

Step 1: Install Prerequisites

Debian / Ubuntu

sudo apt update
sudo apt install -y wget gnupg2 ca-certificates

Fedora / RHEL / Rocky

sudo dnf install -y wget gnupg2

Arch Linux

Arch ships ROCm packages directly in the extra repository. No third-party repo needed — skip ahead to Step 3 for Arch.

Step 2: Add the ROCm Repository

Debian / Ubuntu

AMD provides a signed apt repo. The script below registers it for Ubuntu 22.04 and 24.04 (adjust CODENAME for Debian bookworm).

wget https://repo.radeon.com/amdgpu-install/6.1.3/ubuntu/jammy/amdgpu-install_6.1.60103-1_all.deb
sudo apt install -y ./amdgpu-install_6.1.60103-1_all.deb
sudo apt update

Replace jammy with noble for Ubuntu 24.04, or bookworm for Debian 12. Check repo.radeon.com for the latest version string before running this — the filename changes with each release.

Fedora / RHEL 9 / Rocky 9

sudo tee /etc/yum.repos.d/rocm.repo <<'EOF'
[ROCm-6.1]
name=ROCm6.1
baseurl=https://repo.radeon.com/rocm/rhel9/6.1.3/main
enabled=1
gpgcheck=1
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
EOF
sudo dnf clean all

For Fedora 40, replace rhel9 with fedora40 in the baseurl. Verify the exact path at repo.radeon.com/rocm/.

Step 3: Install the ROCm Stack

Debian / Ubuntu — using amdgpu-install

The amdgpu-install helper takes a --usecase flag. For general compute and HIP development:

sudo amdgpu-install --usecase=rocm --no-dkms

Omit --no-dkms if you need the amdgpu DKMS module (required on non-HWE kernels or custom kernels). For ML work, add ,hip,mllib to the usecase list:

sudo amdgpu-install --usecase=rocm,hip,mllib

Fedora / RHEL / Rocky — using dnf

sudo dnf install -y rocm-hip-sdk rocminfo rocm-opencl-runtime

For PyTorch or TensorFlow support also install:

sudo dnf install -y rocm-ml-sdk

Arch Linux

sudo pacman -S rocm-hip-sdk rocm-opencl-runtime rocminfo hip-runtime-amd

Optionally install rocm-ml-sdk from the AUR if you need the ML libraries directly, though most Arch users install PyTorch via pip with the ROCm wheel instead.

Step 4: Configure Group Membership

The amdgpu kernel device nodes are owned by the render and video groups. Your user must be in both, or every ROCm call will fail with permission errors.

sudo usermod -aG render,video $USER

The change takes effect at the next login. Log out and back in, or open a new login shell:

su - $USER

Confirm group membership:

groups

You should see render and video in the output. On Arch, the groups are the same; on some RHEL-family builds you may also need sudo usermod -aG drm $USER.

Step 5: Set Environment Variables (optional but common)

ROCm installs to /opt/rocm by default. Some tools need it on PATH and some build systems need the library path.

echo 'export PATH=$PATH:/opt/rocm/bin' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc

If you use a non-bash shell, add the equivalent to ~/.zshrc or ~/.config/fish/config.fish.

Step 6: Verify the Installation with rocminfo

rocminfo queries the HSA (Heterogeneous System Architecture) runtime and prints every discovered agent — CPUs and GPUs. A working install shows your GPU with its GFXIP version.

rocminfo

Relevant lines in the output look like:

# Output will vary; look for your GPU agent block:
*******
Agent 2
*******
  Name:                    gfx1100
  Device Type:             GPU
  Vendor Name:             AMD
  Feature:                 KERNEL_DISPATCH
  Profile:                 BASE_PROFILE

gfx1100 corresponds to RDNA 3 (RX 7900 series). If you only see CPU agents, your GPU is not being picked up — see Troubleshooting below.

Also run the OpenCL check:

clinfo | grep -E 'Platform|Device Name'

And the HIP bandwidth test if installed:

/opt/rocm/bin/rocm-bandwidth-test

Troubleshooting

rocminfo shows no GPU agents

  • Verify group membership: groups must include render and video. If not, you haven't logged out and back in since running usermod.
  • Check the amdgpu module is loaded: lsmod | grep amdgpu. If absent, run sudo modprobe amdgpu and check dmesg | grep amdgpu for errors.
  • Check device nodes: ls -l /dev/kfd /dev/dri/render*. /dev/kfd must exist; if it doesn't, the kernel driver isn't binding to your card.

"HSA_STATUS_ERROR_INVALID_AGENT" or permission denied on /dev/kfd

ls -l /dev/kfd

The group on /dev/kfd should be render. If it's root only, your udev rules are missing. Reinstall rocm-core (Debian/Ubuntu) or rocm-core-runtime (dnf) to restore the udev rules, then run sudo udevadm trigger.

Older GPU: gfx803 (RX 480/580) not detected

Polaris cards use gfx803, which is dropped from ROCm 6.x. You can attempt an override for testing:

HSA_OVERRIDE_GFX_VERSION=9.0.0 rocminfo

This is unsupported and may crash or produce wrong results. For production ML work on older AMD GPUs, consider ROCm 5.x or OpenCL-only workloads.

Secure Boot conflicts with DKMS

If Secure Boot is enabled and you installed the DKMS variant, the amdgpu module will fail to load because it's unsigned. Either disable Secure Boot in firmware, or enroll a Machine Owner Key (MOK) using mokutil. This is a broader DKMS topic; AMD's documentation covers MOK enrollment for their driver.

tested on:Ubuntu 22.04Ubuntu 24.04Fedora 40Arch rolling

Frequently asked questions

Does ROCm work with AMD integrated graphics (APUs)?
Officially, no. Most APUs including Ryzen integrated Radeon graphics are not in AMD's supported list for ROCm 6.x. The Ryzen AI 300 series (RDNA 3.5 iGPU) has experimental support via upstream work, but don't expect a stable setup today.
Can I run ROCm and the AMDGPU display driver at the same time?
Yes — the same amdgpu kernel driver handles both display output and compute. The amdgpu-install tool installs both layers together unless you specify otherwise.
How do I install PyTorch with ROCm support?
Use the official PyTorch ROCm wheel: pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1 — match the rocm version suffix to your installed ROCm release.
Will ROCm work inside a container or WSL2?
ROCm works in Docker containers with --device=/dev/kfd --device=/dev/dri and the correct group flags. WSL2 has no official ROCm support from AMD; the GPU passthrough in WSL2 uses a different DirectX-based stack.
How do I uninstall ROCm cleanly?
On Debian/Ubuntu run amdgpu-install --uninstall. On Fedora/RHEL use dnf remove rocm\* amdgpu\*. On Arch, pacman -Rs rocm-hip-sdk and related packages. Remove the repo file afterward to prevent stale references.

Related guides