diff --git a/scripts/build-llama-rdna4.sh b/scripts/build-llama-rdna4.sh index 0bb1203..59c7455 100755 --- a/scripts/build-llama-rdna4.sh +++ b/scripts/build-llama-rdna4.sh @@ -116,10 +116,23 @@ if command -v patchelf >/dev/null; then "$ROCM_LOCAL_PATH/lib/llvm/lib"/libomp.so* \ "$ROCM_LOCAL_PATH/lib/llvm/lib"/libomptarget.so* "$LIB_DIR/" 2>/dev/null || true cp -v "$ROCM_LOCAL_PATH/lib/rocm_sysdeps/lib"/librocm_sysdeps_*.so* "$LIB_DIR/" 2>/dev/null || true - [[ -d "$ROCM_LOCAL_PATH/lib/rocblas/library" ]] && \ - cp -r "$ROCM_LOCAL_PATH/lib/rocblas/library" "$LIB_DIR/rocblas/" 2>/dev/null || true - [[ -d "$ROCM_LOCAL_PATH/lib/hipblaslt/library" ]] && \ - cp -r "$ROCM_LOCAL_PATH/lib/hipblaslt/library" "$LIB_DIR/hipblaslt/" 2>/dev/null || true + # rocBLAS and hipBLASLt look for their device code at a FIXED depth under + # the binary's lib dir: $ORIGIN/../lib/rocblas/library and + # $ORIGIN/../lib/hipblaslt/library/. `cp -r SRC DST/` with a missing + # DST creates DST as a copy of SRC and flattens the source by one level, so + # the engine loads, serves nothing, and dies on the FIRST request with + # rocBLAS error: Cannot read .../lib/rocblas/library/TensileLibrary.dat: + # No such file or directory for GPU arch : gfx1201 + # (measured 2026-09-16, after a build that looked perfectly healthy). + # Declare the destination, then copy the contents into it. + if [[ -d "$ROCM_LOCAL_PATH/lib/rocblas/library" ]]; then + mkdir -p "$LIB_DIR/rocblas/library" + cp -r "$ROCM_LOCAL_PATH/lib/rocblas/library/." "$LIB_DIR/rocblas/library/" + fi + if [[ -d "$ROCM_LOCAL_PATH/lib/hipblaslt/library" ]]; then + mkdir -p "$LIB_DIR/hipblaslt/library" + cp -r "$ROCM_LOCAL_PATH/lib/hipblaslt/library/." "$LIB_DIR/hipblaslt/library/" + fi for bin in "$BUILD_DIR"/bin/llama-*; do [[ -f "$bin" ]] && patchelf --set-rpath '$ORIGIN/../lib' "$bin" done