Repository navigation
Conversation
mudler
previously approved these changes
Nov 9, 2026
This was referenced Nov 9, 2026
The ROCm release of a hipblas image comes from BASE_IMAGE, which is already a build argument, but the BLAS development packages were hardcoded with their ROCm 7.x names (hipblas-dev, hipblaslt-dev, rocblas-dev). ROCm 10.x ships from AMD's new repository with different names (amdrocm-blas-dev10.1), so an image on another ROCm release could not be built without editing the Dockerfiles. Add a ROCM_PACKAGES build argument to the main Dockerfile, the python and golang backend Dockerfiles and the builders that run .docker/install-base-deps.sh. The default is the current list, so every existing build installs exactly the same packages. An empty value installs nothing for a base image that already ships the ROCm development packages; the main image is then still marked as an AMD image, which is not the case when the whole driver step is skipped. Refs mudler#13109 Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de>
walcz-de
force-pushed
the
feat/rocm-version-build-arg
branch
from
November 13, 2026 17:16
317099d to
a2ec16e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(build): make the hipblas ROCm package list a build argument
Refs #13109
What
A first, small step towards the ROCm 10 variant discussed in #13109. Nothing changes for existing builds.
For
BUILD_TYPE=hipblasthe ROCm release already comes fromBASE_IMAGE, which is a build argument. What could not be changed was the package list:hipblas-dev hipblaslt-dev rocblas-devwas hardcoded in four places. Those are the ROCm 7.x names. ROCm 10.x ships from AMD's new repository (stable.repo.amd.com/rocm/core), where hipBLAS, rocBLAS and hipBLASLt headers are in one package,amdrocm-blas-dev10.1. So an image on ROCm 10 could not be built without editing the Dockerfiles.This PR adds a
ROCM_PACKAGESbuild argument. Its default is the current list.How
Dockerfile,backend/Dockerfile.python,backend/Dockerfile.golang:ARG ROCM_PACKAGES="hipblas-dev hipblaslt-dev rocblas-dev", used in the existing hipblasapt-get install..docker/install-base-deps.sh: installs${ROCM_PACKAGES-hipblas-dev hipblaslt-dev rocblas-dev}. If the variable is unset, the default applies. This covers callers that don't forward it.install-base-deps.shdeclare the same ARG and forward it into their existingENVblock, the same wayAMDGPU_TARGETSis forwarded:base-grpc-builder,llama-cpp,ik-llama-cpp,turboquant,bonsaiandprivacy-filter.ROCM_PACKAGESinstalls nothing. This is for a base image that already ships the ROCm development packages, for examplerocm/dev-ubuntu-24.04:10.1.0-full. Unlike skipping the whole driver step, the main image still writesamdto/run/localai/capability, so meta backends resolve to their ROCm variants.hipblasbuilds" indocs/content/getting-started/build.md.No CI matrix changes are included. See the proposal below.
How tested
I could not run a Docker build for this PR, so all checks are static:
RUNfrom the old and newDockerfile,Dockerfile.pythonandDockerfile.golangand ran it under/bin/shwith stubbedapt-get/ldconfig, using the ARG default from the new file. Theapt-getcalls are identical, and so is the capability file for the main image:apt-get update | apt-get install -y --no-install-recommends hipblas-dev hipblaslt-dev rocblas-dev | apt-get clean | ldconfig | capability=amdinstall-base-deps.sh(old and new) the same way under bash, with the variable unset and with it set to the default (theENVpath). The output is identical to the old script in both cases.amdrocm-blas-dev10.1) shows up in the install call. An empty value gives an install with no packages, followed byldconfig(andcapability=amdin the main image).ENV/RUNthat reads it.Dockerfile. The comparison then fails.bash -n .docker/install-base-deps.shpasses.On the ROCm 10 side, I read AMD's repository index (
stable.repo.amd.com/rocm/core/packages/ubuntu2404).amdrocm-blas-dev10.1exists and is described as headers for hipBLAS, rocBLAS, hipBLASLt and hipSPARSELt. Therocm/dev-ubuntu-24.04:10.1.0-fullimage config shows it is built with TheRock'sinstall_rocm_packages.sh(meta packagesamdrocm10.1+amdrocm-core-sdk10.1, apt source left configured).Downstream, we run LocalAI and its backends on ROCm 10.1 on gfx1151 and gfx1103. That build uses our own base image, not this exact recipe.
Breaking changes
None. Default builds install the same packages in the same order. The only metadata difference: the
base-grpc-builderand the llama.cpp-familybuilder-fromsourcestages now carry one moreENVentry (ROCM_PACKAGES), likeAMDGPU_TARGETS. The final backend images areFROM scratchand are unaffected. The main image only uses anARG, so it gets no newENV.Not in this PR (follow-ups, if you want the variant)
A ROCm 10 build needs more than the package list. I found these points but did not change them, to keep this PR small:
ln -s /opt/rocm-**/lib/llvm/lib/libomp.so /usr/lib/libomp.so(main and python Dockerfiles): ROCm 10 installs under/opt/rocm/core-<version>/. If the glob does not match,ln -ssucceeds silently and leaves a dangling link.backend/cpp/llama-cpp/Makefileuses$(ROCM_HOME)/llvm/bin/clang++. TheRock's fallback symlinks coverbin lib include libexec share, but notllvm. Whether the ROCm 10 packages create/opt/rocm/llvmthemselves is not verified. Our downstream base adds that symlink.backend/Dockerfile.audio-cpphas its own list (hipblas-dev rocblas-dev hipcub-dev) and is not covered here.Proposal for the matrix (not part of this PR): an additional entry next to
-gpu-hipblasinimage.yml, and abase-grpc-rocm10-amd64entry inbase-images.ymlfor the llama.cpp backends:We would bring this in a separate PR, once points 1–2 are sorted out, and only if you want the variant.
Questions
ROCM_PACKAGESa good name, or would you prefer something likeHIPBLAS_PACKAGES?ROCM_VERSION=10.1) that derives the package names? That needs a branch on the major version in four places. A plain list keeps the Dockerfiles free of version logic.AI assistance: prepared with Claude Code (see the
Assisted-bytrailer); reviewed and signed off by me.