fix: target only gfx906 for HIP compilation

gfx940/gfx1010/gfx1030/gfx1100 cause C++ narrowing errors in ollama's
mma.cuh with hipcc. Since we only have MI50 (gfx906) cards, compile
for gfx906 only. Reduces build time and avoids upstream code bugs.
This commit is contained in:
2026-05-09 23:07:39 -04:00
parent d52f18b0fa
commit fc777e2de2

View File

@@ -51,7 +51,7 @@ RUN mkdir -p build-cpu && cd build-cpu && \
# Step 2: Build HIP backend with hipcc (legacy mode skips enable_language(HIP))
RUN mkdir -p build-hip && cd build-hip && \
CC=hipcc CXX=hipcc cmake .. \
-DAMDGPU_TARGETS="gfx906:xnack-;gfx940;gfx1010;gfx1030;gfx1100" \
-DAMDGPU_TARGETS="gfx906:xnack-" \
-DCMAKE_BUILD_TYPE=Release && \
CC=hipcc CXX=hipcc cmake --build . --target ggml-hip -- -l $(nproc) && \
cmake --install . --component HIP --strip --prefix /build/dist