@@ -105,10 +105,12 @@ jobs:
105105 sudo apt update
106106 sudo apt install -y \
107107 rocm-dev \
108+ clang \
108109 hip-dev \
109110 hipblas-dev \
110111 rocblas-dev \
111112 cmake \
113+ ninja-build \
112114 build-essential \
113115 logrotate
114116
@@ -133,54 +135,20 @@ jobs:
133135
134136 echo "Building for GPU target: ${{ matrix.gpu_target }}"
135137
136- # Detect available compilers (prioritize ROCm-specific compilers)
137- if [ -f "/opt/rocm/bin/hipcc" ] && [ -f "/opt/rocm/bin/amdclang++" ]; then
138- C_COMPILER="/opt/rocm/bin/hipcc"
139- CXX_COMPILER="/opt/rocm/bin/amdclang++"
140- echo "Using ROCm hipcc and amdclang++ compilers"
141- elif [ -f "/opt/rocm/bin/clang" ]; then
142- C_COMPILER="/opt/rocm/bin/clang"
143- CXX_COMPILER="/opt/rocm/bin/clang++"
144- echo "Using ROCm clang compilers"
145- elif [ -f "/opt/rocm/llvm/bin/clang" ]; then
146- C_COMPILER="/opt/rocm/llvm/bin/clang"
147- CXX_COMPILER="/opt/rocm/llvm/bin/clang++"
148- echo "Using ROCm LLVM compilers"
149- else
150- C_COMPILER="clang"
151- CXX_COMPILER="clang++"
152- echo "Using system compilers"
153- # Install system clang if not available
154- sudo apt install -y clang
155- fi
156-
157- echo "Using C compiler: $C_COMPILER"
158- echo "Using CXX compiler: $CXX_COMPILER"
159-
160- # Verify compilers exist
161- $C_COMPILER --version || echo "C compiler not working"
162- $CXX_COMPILER --version || echo "CXX compiler not working"
163-
164- # Configure with ROCm 7.1 and specific GPU target
138+ # Configure with ROCm 7.1 and specific GPU target (following official build guide)
165139 cmake .. \
140+ -G "Ninja" \
141+ -DCMAKE_C_COMPILER=clang \
142+ -DCMAKE_CXX_COMPILER=clang++ \
143+ -DSD_HIPBLAS=ON \
166144 -DCMAKE_BUILD_TYPE=Release \
167- -DCMAKE_C_COMPILER="$C_COMPILER" \
168- -DCMAKE_CXX_COMPILER="$CXX_COMPILER" \
169- -DCMAKE_PREFIX_PATH="/opt/rocm;/opt/rocm/lib/cmake" \
170145 -DGPU_TARGETS="${{ env.GPU_TARGET }}" \
171- -DHIP_PLATFORM=amd \
172- -DGGML_HIP=ON \
173- -DGGML_CUDA=OFF \
174- -Dhipblas_DIR="/opt/rocm/lib/cmake/hipblas" \
175- -Drocblas_DIR="/opt/rocm/lib/cmake/rocblas" \
176- -DHIP_ROOT_DIR="/opt/rocm" \
177- -DHIP_PATH="/opt/rocm" \
178- -DCMAKE_HIP_COMPILER="/opt/rocm/bin/hipcc" \
179- -DCMAKE_HIP_ARCHITECTURES="${{ env.GPU_TARGET }}" \
180- ${{ env.SD_DEFINES }}
146+ -DAMDGPU_TARGETS="${{ env.GPU_TARGET }}" \
147+ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
148+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON
181149
182150 # Build with all available cores
183- cmake --build . --config Release --parallel $(nproc)
151+ cmake --build . --config Release
184152
185153 - name : Test HipBLAS build
186154 run : |
0 commit comments