Building llama.cpp v1.0.0 with ROCm 10.1 on Ubuntu — A Source Build

The follow-up to my 7.14 guide — every command below is copy-paste, from a fresh ROCm install to llama.cpp v1.0.0 running on both your GPUs.

llama.cpp has hit its first stable major (v1.0.0) and ROCm is on the 10.x line. ROCm 10 is great — the packaging got simpler and this whole build takes a few minutes of your time. Everything you need to type is below; read along, paste, and you're done.

The setup I'm using. A Linux machine with two discrete AMD GPUs plus the CPU's integrated graphics. This example targets RDNA 4 cards (gfx1201) and hides the iGPU at runtime; if your GPUs use a different gfx arch, swap it in at GPU_TARGETS and that's the only change you need.

Step 1: Install ROCm

Install ROCm with the amdgpu-install script, then confirm your GPUs are visible. Skip to step 2 if you already run ROCm 10.x.

sudo amdgpu-install --usecase=rocm,graphics

sudo reboot

rocminfo

Step 2: Install the Two Development Packages

ROCm 10.1 needs just two dev packages on top of the runtime — one for the HIP compiler support, one for hipBLAS/rocBLAS:

sudo apt install amdrocm-runtime-dev10.1 amdrocm-blas-dev10.1

Verify the CMake config files they ship are in place — you should see exactly three paths:

find /opt/rocm -name "hip-lang-config.cmake" \
     -o -name "hipblas-config.cmake" \
     -o -name "rocblas-config.cmake"

(Skip step 2 and CMake fails with "does not contain the HIP runtime CMake package" on the first configure, then again on find_package(hipblas) — two separate errors, one package each.)

Step 3: Get the Source & Configure

Grab the llama.cpp v1.0.0 source and extract it, then configure. HIP code must be compiled by ROCm's bundled clang — not the system gcc — so both compilers are set explicitly. GPU_TARGETS=gfx1201 builds the kernels for your discrete RDNA 4 GPUs.

unzip llama.cpp-1.0.0.zip
cd llama.cpp-1.0.0

cmake -S . -B build \
  -DGGML_HIP=ON \
  -DGPU_TARGETS=gfx1201 \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang \
  -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++

A clean configure ends with -- HIP and hipBLAS found and -- ggml version: 1.0.0. If you also want the iGPU in one binary, use -DGPU_TARGETS="gfx1201;gfx1036" — I didn't; step 5 hides the iGPU at runtime instead.

Step 4: Build

Build everything in parallel:

cmake --build build --config Release -j$(nproc)

This is the only step that runs for a while — it finishes on its own. The llama-cli, llama-server, and llama-bench binaries end up in build/bin.

Step 5: Set the Runtime Library Path & Hide the iGPU

Point the loader at ROCm's version-stable lib path, and hide the integrated GPU (device 2 — gfx1036, no matching kernels in this build) from both HIP and llama.cpp's HIP backend:

export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH
export HIP_VISIBLE_DEVICES=0,1
export GGML_HIP_VISIBLE_DEVICES=0,1

Sanity-check: every libhipblas/librocblas/libamdhip64 in ldd build/bin/llama-cli should resolve, and the device list should show exactly your two discrete cards:

./build/bin/llama-cli --list-devices
Available devices:
  ROCm0: your first discrete GPU
  ROCm1: your second discrete GPU

Step 6: Pin It in ~/.bashrc

Add this block to ~/.bashrc so every new terminal is ready to go. If you migrated from an older ROCm, delete the old lines first — especially a stale LD_LIBRARY_PATH pointing at a previous ROCm, which will silently load the wrong libraries:

# llama.cpp v1.0.0 + ROCm 10.1 environment
export ROCM_PATH=/opt/rocm
export PATH=/opt/rocm/bin:$PATH
export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH

# Use only the discrete GPUs; skip the integrated GPU (device 2)
export HIP_VISIBLE_DEVICES=0,1
export GGML_HIP_VISIBLE_DEVICES=0,1

# llama.cpp v1.0.0 aliases
alias llama-cli='$HOME/source/repos/llama.cpp-1.0.0/build/bin/llama-cli'
alias llama-server='$HOME/source/repos/llama.cpp-1.0.0/build/bin/llama-server'
alias llama-bench='$HOME/source/repos/llama.cpp-1.0.0/build/bin/llama-bench'

Open a fresh terminal — everything is there.

Step 7: Run a Model

Run a local GGUF model with -ngl 99 to push every layer to the GPU:

llama-cli -m path/to/model.gguf -ngl 99 -p "Hello" --no-display-prompt

To use both discrete cards together, layer split is the simplest reliable option:

llama-cli -m path/to/model.gguf -ngl 99 -sm layer

Want tensor split across both cards? Rebuild with -DGGML_HIP_RCCL=ON so the GPUs talk directly instead of through system memory.

Wrapping Up

From a fresh ROCm 10.1 install to a running multi-GPU llama.cpp v1.0.0, it's five steps:

  • Install ROCm, then just two dev packages: amdrocm-runtime-dev10.1 + amdrocm-blas-dev10.1.
  • Configure with ROCm's clang and GPU_TARGETS=gfx1201.
  • Build.
  • LD_LIBRARY_PATH=/opt/rocm/lib, hide the iGPU with HIP_VISIBLE_DEVICES=0,1.
  • Pin it in ~/.bashrc and run.

Once it's set up it just runs. I'll keep posting about squeezing tokens out of these Radeon cards.

← back to all posts
Ataa Aldaghstani

Ataa Aldaghstani

Full-stack & AI engineer. Running models on local hardware because the cloud is overrated. Based in Türkiye.