Skip to content

HIP module doesn't provide a working rpath or LD_LIBRARY_PATH for libamdhip64.so.6 at runtime (accel/amd/gfx90a, 2025.06) #1589

Description

@alexschroeter
This has been created with the help of AI

Environment

  • EESSI version: 2025.06
  • Accelerator target: accel/amd/gfx90a (AMD Instinct MI210)
  • EESSI_ACCELERATOR_TARGET_OVERRIDE=accel/amd/gfx90a
  • Module: HIP/6.4.1-rocm-compilers-19.0.0-ROCm-6.4.1 (via accel/amd/gfx90a MODULEPATH)

Description

A binary compiled with hipcc --offload-arch=gfx90a against the EESSI-provided
HIP module fails to run because the dynamic linker cannot locate
libamdhip64.so.6 at runtime. Neither LD_LIBRARY_PATH nor a working rpath
points at the directory containing it, even though the module sets
LIBRARY_PATH (used at link time) and exports HIP_LIB_PATH.

I raised this originally as a comment on easybuild-easyconfigs#23542; @Thyre
asked that it be re-verified against the actual EESSI-merged stack (rather
than that draft PR) and filed here instead, since PR comments get lost. I've
now reproduced it directly against the production 2025.06 CVMFS repo.

I understand EESSI's general policy is to rely on rpath rather than
LD_LIBRARY_PATH for this kind of thing — so the bug as I see it isn't
"LD_LIBRARY_PATH should be set," it's that neither mechanism currently
works
for binaries built against HIP outside of the EESSI build
environment (i.e. as an end user compiling their own HIP code on top of the
loaded module).

Steps to reproduce

export EESSI_ACCELERATOR_TARGET_OVERRIDE=accel/amd/gfx90a
source /cvmfs/software.eessi.io/versions/2025.06/init/bash
module load HIP
hipcc --offload-arch=gfx90a vecadd.cpp -o vecadd
./vecadd

Expected behavior

The resulting binary runs without needing any manual environment changes
beyond what module load HIP already sets up.

Actual behavior

./vecadd fails at startup because libamdhip64.so.6 cannot be found by the
dynamic linker.

Workaround

export LD_LIBRARY_PATH=$HIP_LIB_PATH:$LD_LIBRARY_PATH

This gets the linker past the libamdhip64.so.6 error (the module does
export HIP_LIB_PATH, it's just not consulted by default), but on its own it
does not produce a working binary — it immediately hits a second, separate
bug: a CXXABI_1.3.15 not found error from gflags/Z3 (pulled in via
comgr) caused by a DT_RPATH/DT_RUNPATH interaction that makes the dynamic
linker fall through to the compat layer's own ld.so.cache and pick up an
older, incompatible libstdc++. Full details in this comment.
The actual full workaround needed to get a running binary is:

export LD_LIBRARY_PATH=/cvmfs/software.eessi.io/versions/2025.06/software/linux/x86_64/amd/zen2/software/GCCcore/14.2.0/lib64:$HIP_LIB_PATH:$LD_LIBRARY_PATH

I'm keeping this issue focused on the LD_LIBRARY_PATH/module problem, since
the libstdc++ issue is a distinct bug with a different root cause — just
flagging it here so anyone verifying this report doesn't get confused when
the "simple" workaround alone still fails.

Suggested fix directions

  • Either have the HIP module set LD_LIBRARY_PATH (if rpath-only is not
    achievable for externally-compiled code), or
  • Ensure hipcc/the HIP compiler driver embeds a correct rpath (e.g.
    pointing at $HIP_LIB_PATH) into binaries it links, so no environment
    variable is needed at all.

Happy to test candidate fixes on real gfx90a hardware (8x MI210) if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions