Skip to content

build : add ROCm component directories to ggml-hip RPATH#25899

Open
liminfei-amd wants to merge 1 commit into
ggml-org:masterfrom
liminfei-amd:fix/25807-rocm714-rpath
Open

build : add ROCm component directories to ggml-hip RPATH#25899
liminfei-amd wants to merge 1 commit into
ggml-org:masterfrom
liminfei-amd:fix/25807-rocm714-rpath

Conversation

@liminfei-amd

Copy link
Copy Markdown
Contributor

Overview

  • ROCm 7.14 resolves rocBLAS, hipBLAS, and the HIP runtime from component directories.
  • libggml-hip.so directly needs all three, but its own RUNPATH does not contain their directories; an executable's DT_RUNPATH is not recursively inherited for those dependencies.
  • Add the roc::rocblas, roc::hipblas, and hip::amdhip64 target directories to ggml-hip BUILD_RPATH and INSTALL_RPATH.
  • Derive every path from its imported target; do not hard-code a ROCm version or installation prefix.

Fixes #25807.

Validation

  • On master 571d0d5 in the official ROCm 7.14 image, the baseline builds but clean launch exits 127 on libhipblas.so.3; supplying the component path succeeds.
  • With the patch, build-tree and install-tree launches exit 0 without a ROCm path in LD_LIBRARY_PATH.
  • A ROCm 7.2 build and clean-launch control also pass with the same three-target patch.

libggml-hip directly depends on rocBLAS, hipBLAS, and the HIP runtime.
Add their imported target directories to its build and install RPATH so
versioned ROCm layouts load without a ROCm LD_LIBRARY_PATH.

Fixes ggml-org#25807
Reported-by: IIIIIllllIIIIIlllll
@liminfei-amd
liminfei-amd requested a review from IMbackK as a code owner July 19, 2026 17:39
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Jul 19, 2026
@IMbackK

IMbackK commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

I find it bad and very likely a bug that rocm libraries are not in the system's ld search path in an rocm image, this approach also dosent help at all when the binary is built on one machine and then distributed to others.

Please confirm that rocm libaries NOT being in ld's search path in rocm docker images is intentional.

@liminfei-amd

Copy link
Copy Markdown
Contributor Author

I find it bad and very likely a bug that rocm libraries are not in the system's ld search path in an rocm image, this approach also dosent help at all when the binary is built on one machine and then distributed to others.

Please confirm that rocm libaries NOT being in ld's search path in rocm docker images is intentional.

Thank you for your suggestion. We are currently investigating whether this can be fixed from theRock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: ROCm-7.14 - > 'error while loading shared libraries: libhipblas.so.3'

2 participants