Skip to content

fix(hipblas): symlink amdgpu.ids so ROCm backends find the ASIC ID table#10627

Merged
mudler merged 2 commits into
masterfrom
fix/rocm-amdgpu-ids-10624
Jul 2, 2026
Merged

fix(hipblas): symlink amdgpu.ids so ROCm backends find the ASIC ID table#10627
mudler merged 2 commits into
masterfrom
fix/rocm-amdgpu-ids-10624

Conversation

@localai-bot

@localai-bot localai-bot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ROCm's bundled libdrm_amdgpu looks up the GPU ASIC ID table at a hardcoded fallback path, /opt/amdgpu/share/libdrm/amdgpu.ids, which only exists if AMD's full amdgpu-install (graphics/DKMS) stack is installed
  • The hipblas image (rocm/dev-ubuntu-24.04 base) is compute-only, so that path never exists, and every model load on a hipblas backend logs /opt/amdgpu/share/libdrm/amdgpu.ids: No such file or directory
  • Ubuntu's libdrm-common package ships the equivalent data at /usr/share/libdrm/amdgpu.ids; symlink it into place for BUILD_TYPE=hipblas, guarded so it's a no-op if either path is already in an unexpected state

Backends run as plain child processes of the main local-ai process and share its root filesystem (confirmed by tracing pkg/oci/image.go extraction + pkg/model/process.go/core/cli/worker exec), so a single symlink at the top-level Dockerfile (requirements-drivers stage) covers all hipblas backends (diffusers, llama.cpp, etc.) running under localai/localai:*-gpu-hipblas.

Fixes #10624

Test plan

  • Pulled rocm/dev-ubuntu-24.04:7.2.1 directly and ran apt-get install hipblas-dev hipblaslt-dev rocblas-dev (the exact packages this Dockerfile installs for BUILD_TYPE=hipblas), then confirmed: /opt/amdgpu/share/libdrm/ does not exist (reproduces the reported bug) and /usr/share/libdrm/amdgpu.ids exists, owned by libdrm-common (dpkg -S amdgpu.ids)
  • Verified the added RUN shell logic against a real docker build (mocked /usr/share/libdrm/amdgpu.ids present) — symlink is created correctly and resolves
  • Inspected an existing published *-gpu-rocm-hipblas-llama-cpp backend image to confirm libdrm_amdgpu is not statically linked/bundled into the backend's own lib/, so its lookup relies on the outer image's filesystem, matching where this fix lives
  • Full localai/localai:*-gpu-hipblas image build + on-hardware ROCm verification (needs AMD GPU, not available in this environment)

mudler added 2 commits July 1, 2026 20:06
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>
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>
@gspeter-max

Copy link
Copy Markdown

hi @mudler
you should also apply this change to backend/Dockerfile.python.

The Python backends (such as vLLM and sglang) build hipblas variants and will face the same GPU identification warning or failure if the amdgpu.ids symlink is missing there.

@mudler

mudler commented Jul 2, 2026

Copy link
Copy Markdown
Owner

hi @mudler you should also apply this change to backend/Dockerfile.python.

The Python backends (such as vLLM and sglang) build hipblas variants and will face the same GPU identification warning or failure if the amdgpu.ids symlink is missing there.

backends Dockerfiles are used to create containers from-scratch. these images are not executed as-is, so moving the files there has no effect. IF /opt/amdgpu/share/libdrm/amdgpu.ids can be moved and packaged to backends, that's another story. But requires readers of that file to have a way to specify a different path.

@mudler
mudler merged commit 1a03712 into master Jul 2, 2026
60 checks passed
@mudler
mudler deleted the fix/rocm-amdgpu-ids-10624 branch July 2, 2026 07:25
@localai-bot localai-bot added the bug Something isn't working label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing /opt/amdgpu/share/libdrm/amdgpu.ids

3 participants