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 ];