The Compiler Whisperer

← Back to the overview: The Three Routes That Actually Work

Route C detail: bare Ubuntu, where the flags matter

By The Compiler Whisperer · November 2026 · notes dated May–June 2026

Route C is the auditable one: bare Ubuntu 26.04, ROCm 7.2.2 from AMD's own repositories, llama.cpp compiled by you for your exact GPUs. No third-party binaries, no bridges, no overrides. On a dedicated inference box this is the most stable and easiest-to-debug route.

Step 1 — purge until the slate is clean

On a fresh or previously-broken ROCm install, order matters. Purge everything first:

sudo apt purge -y amdgpu-install amdgpu-dkms rocm-dev rocm-libs
sudo apt purge -y "rocm-*" "librocm-*" rocminfo
sudo apt autoremove -y
sudo rm -rf /opt/rocm /opt/rocm*
sudo rm -f /etc/apt/sources.list.d/rocm.list /etc/apt/sources.list.d/graphics*.list
sudo apt update

The success condition is blunt: dkms status must print nothing. If it prints anything, you have not purged cleanly — go back.

Step 2 — install ROCm 7.2.2 and pin AMD's repos

# download the amdgpu-install .deb for your Ubuntu release from
# https://repo.radeon.com/amdgpu-install/ (the latest/ubuntu/<release>/ path;
# my June 2026 notes used the 7.2.3.70204 deb from the noble path)
sudo apt install ./amdgpu-install_<version>_all.deb
sudo amdgpu-install --accept-eula --usecase=graphics,rocm

Then register AMD's repositories — the ROCm apt repo plus the graphics repo — pinned at priority 600 so AMD's packages win over Ubuntu's stock ones. I chose this install without the dkms kernel driver; whether your graphics stack needs it is an AMD-current-docs question, not a question this dated note can answer.

Step 3 — build llama.cpp for your exact GPU

The flag set I use, tested on two different cards:

cmake -B build \
  -DGGML_HIP=ON -DGGML_HIPBLAS=ON -DGGML_HIP_UMA=ON \
  -DGGML_HIP_ROCWMMA_FATTN=OFF \
  -DCMAKE_BUILD_TYPE=Release \
  -DAMDGPU_TARGETS=gfx1103      # Radeon 760M; use gfx1200 for RX 9070
cmake --build build -j $(nproc)
./build/bin/llama-cli --version

Wrong target, wrong failure. The only real skill in this route is the AMDGPU_TARGETS line: gfx1103 for the RDNA 3 integrated GPU, gfx1200 for RDNA 4.

Three notes from the trenches

What I did not verify

Honesty note. All steps above come from my dated notes (May–June 2026) on the hardware described (RX 9070, integrated Radeon 760M, Ubuntu 26.04). Machine names and addresses do not appear. Overview: The Three Routes That Actually Work. No affiliate links in this article.

Prev: Route B detail · Next: The Strata + Hermes setup I run today