AMD's ROCm (Radeon Open Compute) platform lets you run GPU-accelerated workloads like PyTorch, TensorFlow, and LLM inference on AMD GPUs. If you have a supported Radeon card – RDNA2 (RX 6000 series / gfx1030) or RDNA3 (RX 7000 series / gfx1100) – this guide walks you through installing ROCm 7.14 on Ubuntu 26.04 LTS. Follow it top to bottom on a fresh boot with admin access and you will finish with a verified GPU.
I tested this on a Radeon RX 6800M (gfx1031, RDNA2), and everything below is what actually worked. The same steps apply to most RDN-based cards.
Source note: commands below follow AMD's official install docs for the pinned versions (ROCm 7.14, Ubuntu 26.04, amdgpu-install 31.40.1). Versions drift – if your release is newer, check AMD's install guide for the current package name before copy-pasting. Backend choice context lives in ROCm vs Vulkan; llama.cpp build flags after install are in the llama.cpp guide.
Prerequisites
- An AMD Radeon GPU from the supported list
- Ubuntu 26.04 LTS (Resolute Raccoon) installed
- An internet connection
- A user account with sudo privileges
Pre-flight checks (5 minutes that save hours)
- Confirm the GPU is visible at all:
lspci | grep -i vgashould list your Radeon before you install anything. No PCI entry = hardware/BIOS problem, not a ROCm problem. - Check Secure Boot: enabled Secure Boot blocks the unsigned amdgpu DKMS module on many systems. Either disable it in BIOS or enroll the MOK key when prompted – skipping this is the #1 “installed fine, driver never loads” cause.
- Free disk: ROCm + driver + libraries run several GB. Keep 10 GB free; failed installs with full disks leave half-registered apt sources that break the retry.
- Know your gfx ID now: look up your card's gfx target (list in Step 2) before starting – mid-install guessing is how wrong-flag installs happen.
Step 1 – Install the amdgpu-install script
ROCm uses the amdgpu-install script to handle the GPU driver, ROCm
runtime, and graphics components together. Download and install it from AMD's
repository:
sudo apt update wget https://repo.radeon.com/amdgpu-install/31.40.1/ubuntu/resolute/amdgpu-install_31.40.1.314001-1_all.deb sudo apt install ./amdgpu-install_31.40.1.314001-1_all.deb
Replace resolute with noble (24.04) or jammy
(22.04) if you're on a different Ubuntu version. Match the codename to lsb_release -cs
output exactly – a noble package on a jammy system installs without error and then fails at DKMS build,
which looks identical to a GPU-support problem. Dual-booters: install on the Ubuntu kernel you actually boot
daily (custom mainline kernels break the DKMS match), and keep Windows Fast Startup off so the GPU resets
cleanly between OSes instead of arriving in a wedged power state Linux cannot initialize.
Step 2 – Install ROCm and the GPU driver
Now run amdgpu-install with the appropriate use case and GPU target.
sudo amdgpu-install --usecase=rocm,graphics --gfxversion=gfx1031
Important: Use your GPU's specific gfx target instead of
auto. The auto-detection can sometimes miss the right architecture, so
specifying it explicitly gives a cleaner install. Find your GPU's gfx version:
- RDNA2 (RX 6000 series): gfx1030, gfx1031, gfx1032
- RDNA3 (RX 7000 series): gfx1100, gfx1101, gfx1102
- RDNA3.5 (Ryzen AI 300): gfx1150, gfx1151
Not sure? Run rocminfo after installing (or look up your card's
architecture on AMD's site).
Device family note: When the installer prompts you to select a device family, you have two options:If you're just using your own machine, pick AMD Radeon. If you're building something that may run on Instinct or other architectures later, pick All.
- All – installs runtime support for every AMD GPU architecture. Good if you're developing cross-platform or testing on multiple cards.
- AMD Radeon – targets only consumer Radeon GPUs. This is the leaner, more focused choice for a single Radeon card.
Step 3 – Install additional libraries
Some ROCm tools need the libatomic and libquadmath
libraries to run correctly. Install them now so you don't hit a cryptic error
later:
sudo apt install libatomic1 libquadmath0
Step 4 – Add your user to the render and video groups
GPU access is controlled through Linux groups. Your user needs to be in the
render and video groups to use the AMD GPU without
sudo:
sudo usermod -a -G render,video $LOGNAME
Log out and back in (or restart) for the group change to take effect. Verify with
groups $LOGNAME – both names must appear before proceeding, otherwise every later
“permission denied” will masquerade as a driver failure.
Step 5 – Reboot
A reboot ensures the kernel module (amdgpu) and ROCk driver are loaded:
sudo reboot
Step 6 – Verify the installation
After rebooting, run rocminfo to confirm your GPU is detected:
rocminfo
You should see your GPU listed with its name, gfx architecture, and compute units. A healthy output looks like this:
******* Agent 2 ******* Name: gfx1031 Marketing Name: AMD Radeon RX 6800M Compute Unit: 40 Device Type: GPU ...
You can also check that the kernel driver is loaded:
ls /dev/kfd # should exist ls /dev/dri/ # should show renderD* nodes
What's next?
With ROCm installed, you can now:
-
Install PyTorch with ROCm support –
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm7.1 - Run LLMs locally – tools like Ollama, LM Studio, and text-generation-webui all support ROCm out of the box.
- Use HIP for GPU programming – AMD's CUDA-compatible framework.
If the installer didn't detect your GPU, double-check the --gfxversion
flag and try the All device family option. If you run into issues,
AMD's official ROCm install guide
has the full details.
Kernel and version-drift notes (read before apt)
ROCm pins tightly to kernels: a routine apt upgrade that moves the kernel can leave the
DKMS module unbuilt until you rerun the installer – “worked yesterday, CPU-only today” is almost always
this. After kernel updates, rerun amdgpu-install with your same flags, reboot, and recheck
rocminfo before touching any model config. Similarly, the PyTorch rocm7.1 index URL
above tracks ROCm 7.x – when AMD bumps majors, PyTorch publishes a new index path and the old one silently
serves stale wheels, so re-copy the install line from PyTorch's site yearly rather than trusting this page
forever. If an update wedges the driver (black screen / no KFD), uninstall cleanly with
amdgpu-uninstall, reboot, and reinstall with your known-good flags – layering installs atop a
broken DKMS state wastes more time than the clean redo.
Troubleshooting matrix (symptom → fix)
rocminfoshows no GPU: wrong--gfxversionflag or Secure Boot blocked the module. Reinstall with the exact gfx ID, checkdkms status, and confirm Secure Boot state./dev/kfdmissing: kernel driver never loaded – reboot once more, thendmesg | grep -i amdgpufor the load error. Missing firmware packages on LTS point releases cause this.- Permission denied without sudo: group change never applied – log out fully (not just terminal restart) or reboot; verify with
groups $LOGNAME. - PyTorch sees CPU only: pip installed the CUDA wheel instead of the ROCm wheel – reinstall with the exact
--index-url .../rocm7.1line and checktorch.version.hipis not None. - llama.cpp builds but runs on CPU: built without
-DLLAMA_HIPBLAS=ON, or card unsupported – rebuild with the flag, and if offload stays zero, switch to the Vulkan backend instead of fighting ROCm.
90-minute rule: if rocminfo still shows nothing after a correct-flag reinstall and a
Secure-Boot-off reboot, stop and use Vulkan (mesa-vulkan-drivers + -DLLAMA_VULKAN=ON).
A working model today beats a perfect backend next week – unsupported laptop Radeons land here by design.
Smoke tests after install (prove it works)
- Driver:
rocminfolists your gfx ID +ls /dev/kfdexists. - PyTorch:
python3 -c "import torch; print(torch.cuda.is_available(), torch.version.hip)"– expect True + a version string. - LLM: build llama.cpp with
-DLLAMA_HIPBLAS=ONand runllama-bench -m any-7b-q4.gguf -p 128 -n 64– nonzero GPU offload and tok/s in the tens+ means acceleration is live.
If all three pass, wire up daily driving: Ollama setup for chat, VRAM calculator for fit, and the backend comparison when you want to benchmark ROCm against Vulkan on your card.
FAQ
Which gfx flag does my card need?
RDNA2 RX 6000: gfx1030/1031/1032; RDNA3 RX 7000: gfx1100/1101/1102; Ryzen AI 300 iGPUs: gfx1150/1151. The 6800M in this guide is gfx1031. When unsure, check AMD's docs for your exact PCI ID – never guess with auto.
Does Secure Boot break ROCm?
Often – unsigned DKMS modules fail to load silently. Disable Secure Boot or enroll the MOK key at install time, then verify with rocminfo, not just “no errors”.
Can I skip ROCm and just use Vulkan?
Yes – and you should when your card is unsupported or the 90-minute rule triggers. Install mesa-vulkan-drivers, build llama.cpp with -DLLAMA_VULKAN=ON, and compare speeds in the backend guide.
Why does PyTorch still show CPU-only?
Wrong wheel (CUDA instead of ROCm) or driver never loaded. Reinstall from the rocm7.1 index URL and confirm /dev/kfd + rocminfo first – PyTorch cannot see what the driver does not expose.