From 1a03712a6f5130799f2a33cd2e441d80bcfc8b91 Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Thu, 2 Jul 2026 09:25:14 +0200 Subject: [PATCH] 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 * 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 --------- Signed-off-by: Ettore Di Giacinto Co-authored-by: Ettore Di Giacinto --- Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1611c6e1f..0bf768a43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -171,6 +171,17 @@ RUN if [ "${BUILD_TYPE}" = "hipblas" ]; then \ ln -s /opt/rocm-**/lib/llvm/lib/libomp.so /usr/lib/libomp.so \ ; fi +# ROCm's bundled libdrm_amdgpu is built with a hardcoded fallback lookup path +# for the ASIC ID table (/opt/amdgpu/share/libdrm/amdgpu.ids), which only exists +# if AMD's full amdgpu graphics/DKMS stack is installed. This compute-only image +# doesn't have it, so hipblas/rocBLAS log "No such file or directory" on every +# model load and can fail to identify the GPU. Point it at the equivalent file +# Ubuntu's libdrm-common package already ships. +RUN if [ "${BUILD_TYPE}" = "hipblas" ] && [ -f /usr/share/libdrm/amdgpu.ids ] && [ ! -e /opt/amdgpu/share/libdrm/amdgpu.ids ]; then \ + mkdir -p /opt/amdgpu/share/libdrm && \ + ln -s /usr/share/libdrm/amdgpu.ids /opt/amdgpu/share/libdrm/amdgpu.ids \ + ; fi + RUN expr "${BUILD_TYPE}" = intel && echo "intel" > /run/localai/capability || echo "not intel" # Cuda