From 208bfd4612788c35dbbc8dae58d1183cded8d619 Mon Sep 17 00:00:00 2001 From: Hermes Date: Sat, 9 May 2026 23:50:26 -0400 Subject: [PATCH] fix: pre-set CMAKE_HIP_COMPILER="" for CPU build to prevent HIP detection --- ai/ollama/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ai/ollama/Dockerfile b/ai/ollama/Dockerfile index 65ffe9b..22370d2 100644 --- a/ai/ollama/Dockerfile +++ b/ai/ollama/Dockerfile @@ -42,12 +42,13 @@ ENV CMAKE_GENERATOR=Ninja ENV LDFLAGS=-s # Step 1: Build CPU backends with GCC (no ROCm preset) -# Remove /opt/rocm from PATH to prevent check_language(HIP) from -# finding a HIP compiler, which would trigger the HIP block that -# requires find_package(hip) with proper CMAKE_PREFIX_PATH. +# Pre-set CMAKE_HIP_COMPILER="" to prevent check_language(HIP) from +# finding a HIP compiler (it searches /opt/rocm even without PATH). +# Remove /opt/rocm from PATH to prevent find_program from finding hipcc. RUN mkdir -p build-cpu && cd build-cpu && \ PATH=/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - cmake .. -DCMAKE_BUILD_TYPE=Release && \ + cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_HIP_COMPILER="" && \ cmake --build . --target ggml-cpu -- -l $(nproc) && \ cmake --install . --component CPU --strip --prefix /build/dist