From c51c95fad07b9ae8e59a98879af13e85bdb594b2 Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Mon, 23 Feb 2026 11:02:58 -0800 Subject: [PATCH] rocmPackages.clr: add $out/lib to libamdhip64.so's rpath Working around clr internally dlopening itself by bare name without a path, which will fail if it's not on the global library search path. Likely will introduce an upstream PR that avoids this unnecessary look up current so by its bare name dance. --- pkgs/development/rocm-modules/clr/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/rocm-modules/clr/default.nix b/pkgs/development/rocm-modules/clr/default.nix index 1a0aec24a8d3..181102c6bd1a 100644 --- a/pkgs/development/rocm-modules/clr/default.nix +++ b/pkgs/development/rocm-modules/clr/default.nix @@ -207,6 +207,14 @@ stdenv.mkDerivation (finalAttrs: { ln -s ${hipClang} $out/llvm ''; + # libamdhip64.so dlopens its own bare name for hipGetProcAddress symbol resolution. + # Add its own directory to its RPATH so it can find itself + # Must be in postFixup so it runs after patchelf --shrink-rpath which removes + # the apparently useless rpath + postFixup = '' + patchelf --add-rpath "$out/lib" "$out/lib/libamdhip64.so" + ''; + disallowedRequisites = [ gcc-unwrapped ];