Skip to content

Commit 1a03712

Browse files
localai-botmudler
andauthored
fix(hipblas): symlink amdgpu.ids so ROCm backends find the ASIC ID table (#10627)
* fix(hipblas): symlink amdgpu.ids so ROCm backends find the ASIC ID table ROCm's bundled libdrm_amdgpu looks up the GPU ASIC ID table at a hardcoded fallback path, /opt/amdgpu/share/libdrm/amdgpu.ids, which is only populated by AMD's full amdgpu-install (graphics/DKMS) stack. The hipblas image is compute-only and doesn't have it, so every model load logs "No such file or directory" and the GPU can't be identified. Symlink it to the equivalent file already shipped by Ubuntu's libdrm-amdgpu1 package. Fixes #10624 Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * fix(hipblas): correct amdgpu.ids source package name in comment Verified against the real rocm/dev-ubuntu-24.04:7.2.1 image with hipblas-dev/hipblaslt-dev/rocblas-dev installed: /usr/share/libdrm/amdgpu.ids is owned by libdrm-common, not libdrm-amdgpu1 as the comment said. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 703ea32 commit 1a03712

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ RUN if [ "${BUILD_TYPE}" = "hipblas" ]; then \
171171
ln -s /opt/rocm-**/lib/llvm/lib/libomp.so /usr/lib/libomp.so \
172172
; fi
173173

174+
# ROCm's bundled libdrm_amdgpu is built with a hardcoded fallback lookup path
175+
# for the ASIC ID table (/opt/amdgpu/share/libdrm/amdgpu.ids), which only exists
176+
# if AMD's full amdgpu graphics/DKMS stack is installed. This compute-only image
177+
# doesn't have it, so hipblas/rocBLAS log "No such file or directory" on every
178+
# model load and can fail to identify the GPU. Point it at the equivalent file
179+
# Ubuntu's libdrm-common package already ships.
180+
RUN if [ "${BUILD_TYPE}" = "hipblas" ] && [ -f /usr/share/libdrm/amdgpu.ids ] && [ ! -e /opt/amdgpu/share/libdrm/amdgpu.ids ]; then \
181+
mkdir -p /opt/amdgpu/share/libdrm && \
182+
ln -s /usr/share/libdrm/amdgpu.ids /opt/amdgpu/share/libdrm/amdgpu.ids \
183+
; fi
184+
174185
RUN expr "${BUILD_TYPE}" = intel && echo "intel" > /run/localai/capability || echo "not intel"
175186

176187
# Cuda

0 commit comments

Comments
 (0)