fix: use CXX=hipcc legacy mode for HIP CMake build

CMake 3.31 refuses CMAKE_HIP_COMPILER=hipcc with 'not supported'.
Using CXX=hipcc triggers the legacy HIP detection path which works.
This commit is contained in:
2026-05-09 22:20:44 -04:00
parent a3d0fa0072
commit d8b77c97c3

View File

@@ -42,14 +42,13 @@ ENV PATH=/opt/rocm/bin:/opt/rocm/hip/bin:/opt/rocm/hcc/bin:/usr/local/sbin:/usr/
ENV CMAKE_GENERATOR=Ninja
ENV LDFLAGS=-s
# Build with ROCm 6 preset + gfx906 target
# Build with ROCm 6 preset + gfx906 target (CXX=hipcc for legacy HIP mode)
RUN mkdir -p build && cd build && \
cmake .. \
CC=hipcc CXX=hipcc cmake .. \
--preset 'ROCm 6' \
-DAMDGPU_TARGETS="gfx906:xnack-;gfx940;gfx1010;gfx1030;gfx1100;gfx1200" \
-DCMAKE_HIP_COMPILER=/opt/rocm/bin/hipcc \
-DCMAKE_BUILD_TYPE=Release && \
cmake --build . -- -l $(nproc) && \
CC=hipcc CXX=hipcc cmake --build . -- -l $(nproc) && \
cmake --install . --component HIP --strip --prefix /build/dist
# Build the Go binary