No dependency on the kernel, it will just use whatever AMD drivers are installed currently, the driver part is not a part of ROCm build. I use Fedora 43 beta, kernel 6.17.3.
Here are the instructions:
Installed development tools:
sudo dnf install @c-development @development-tools cmake
sudo dnf install libcurl-devel
Install Rocm
Download Rocm tarball for gfx1151 arch from TheRock repository: https://therock-nightly-tarball.s3.amazonaws.com/index.html
Extract to /opt/rocm.
Example:
sudo mkdir -p /opt/rocm
chown eugr /opt/rocm
wget https://therock-nightly-tarball.s3.amazonaws.com/therock-dist-linux-gfx1151-7.10.0a20251017.tar.gz
tar xzf therock-dist-linux-gfx1151-7.10.0a20251017.tar.gz -C /opt/rocm
Set up environment variables:
~/rocm-env.sh:
#!/bin/bash
# Set the root for your ROCm installation
export ROCM_PATH=/opt/rocm
# Add ROCm's main binaries and the compiler toolchain to your PATH
export PATH=$ROCM_PATH/bin:$PATH
# Tell the system's dynamic linker where to find ROCm libraries
export LD_LIBRARY_PATH=$ROCM_PATH/lib:$LD_LIBRARY_PATH
Activate and test:
source ~/rocm-env.sh
amd-smi
Install RocmWMMA (optional)
Clone repository:
git clone https://github.com/ROCm/rocWMMA.git
cd rocWMMA
Configure and build (make sure the Rocm environment variables are set):
CC=/opt/rocm/bin/amdclang CXX=/opt/rocm/bin/amdclang++ cmake -B build . -DROCWMMA_BUILD_TESTS=OFF -DROCWMMA_BUILD_SAMPLES=OFF -DGPU_TARGETS=gfx1151
cmake --build build -- -j16
Install llama.cpp
Clone llama.cpp:
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
Create a build script.
build_llama.cpp.sh:
!#/bin/bash
export HIP_PLATFORM=amd
# Build without rocWMMA - optimal as of 10/18/2025
HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -S . -B build -DGGML_HIP=ON -DAMDGPU_TARGETS=gfx1151 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-I/home/eugr/llm/rocWMMA/library/include" -DCMAKE_HIP_FLAGS="-I/home/eugr/llm/rocWMMA/library/include" && cmake --build build --config Release -- -j 16
# Build with rocWMMA
#HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -S . -B build -DGGML_HIP_ROCWMMA_FATTN=ON -DGGML_HIP=ON -DAMDGPU_TARGETS=gfx1151 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-I/home/eugr/llm/rocWMMA/library/include" -DCMAKE_HIP_FLAGS="-I/home/eugr/llm/rocWMMA/library/include" && cmake --build build --config Release -- -j 16
Test:
build/bin/llama-cli --list-devices