From fc899ceb65549c770f92bf85fb210c4308dfac76 Mon Sep 17 00:00:00 2001 From: Keith Mattix Date: Fri, 17 Apr 2026 23:46:55 +0000 Subject: [PATCH] fix(rocm): add gfx1151 support and expose AMDGPU_TARGETS build-arg Add gfx1151 (AMD Strix Halo / Ryzen AI MAX) to the default AMDGPU_TARGETS list in the llama-cpp backend Makefile. ROCm 7.2.1 ships with gfx1151 Tensile libraries, so this architecture should be included in default builds. Also expose AMDGPU_TARGETS as an ARG/ENV in Dockerfile.llama-cpp so that users building for non-default GPU architectures can override the target list via --build-arg AMDGPU_TARGETS=. Previously, passing -DAMDGPU_TARGETS= through CMAKE_ARGS was silently overridden by the Makefile's own append of the default target list. Fixes #9374 Signed-off-by: Keith Mattix --- backend/Dockerfile.llama-cpp | 2 ++ backend/cpp/llama-cpp/Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/Dockerfile.llama-cpp b/backend/Dockerfile.llama-cpp index d7be7941c296..2f1dbd2e5e90 100644 --- a/backend/Dockerfile.llama-cpp +++ b/backend/Dockerfile.llama-cpp @@ -58,6 +58,8 @@ ARG CUDA_DOCKER_ARCH ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH} ARG CMAKE_ARGS ENV CMAKE_ARGS=${CMAKE_ARGS} +ARG AMDGPU_TARGETS +ENV AMDGPU_TARGETS=${AMDGPU_TARGETS} ARG BACKEND=rerankers ARG BUILD_TYPE ENV BUILD_TYPE=${BUILD_TYPE} diff --git a/backend/cpp/llama-cpp/Makefile b/backend/cpp/llama-cpp/Makefile index afba5ee957f6..c9a496ffa57c 100644 --- a/backend/cpp/llama-cpp/Makefile +++ b/backend/cpp/llama-cpp/Makefile @@ -33,7 +33,7 @@ else ifeq ($(BUILD_TYPE),hipblas) ROCM_PATH ?= /opt/rocm export CXX=$(ROCM_HOME)/llvm/bin/clang++ export CC=$(ROCM_HOME)/llvm/bin/clang - AMDGPU_TARGETS?=gfx908,gfx90a,gfx942,gfx950,gfx1030,gfx1100,gfx1101,gfx1102,gfx1200,gfx1201 + AMDGPU_TARGETS?=gfx908,gfx90a,gfx942,gfx950,gfx1030,gfx1100,gfx1101,gfx1102,gfx1151,gfx1200,gfx1201 CMAKE_ARGS+=-DGGML_HIP=ON -DAMDGPU_TARGETS=$(AMDGPU_TARGETS) else ifeq ($(BUILD_TYPE),vulkan) CMAKE_ARGS+=-DGGML_VULKAN=1