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

Pre-flight checks (5 minutes that save hours)

  1. Confirm the GPU is visible at all: lspci | grep -i vga should list your Radeon before you install anything. No PCI entry = hardware/BIOS problem, not a ROCm problem.
  2. 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.
  3. 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.
  4. 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:

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:
  • 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.
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.

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:

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)

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)

  1. Driver: rocminfo lists your gfx ID + ls /dev/kfd exists.
  2. PyTorch: python3 -c "import torch; print(torch.cuda.is_available(), torch.version.hip)" – expect True + a version string.
  3. LLM: build llama.cpp with -DLLAMA_HIPBLAS=ON and run llama-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.

Sources