From 15848ffa429c2a9e76d39ed49dd19e58adc63cbe Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Sun, 12 Jun 2022 17:56:01 +0300 Subject: [PATCH] cudaPackages.cudatoolkit: rm preFixup rpath code ...the same logic is handled by autoPatchelf --- .../compilers/cudatoolkit/common.nix | 58 +------------------ 1 file changed, 2 insertions(+), 56 deletions(-) diff --git a/pkgs/development/compilers/cudatoolkit/common.nix b/pkgs/development/compilers/cudatoolkit/common.nix index a3054f49b2d5..8082756b1edb 100644 --- a/pkgs/development/compilers/cudatoolkit/common.nix +++ b/pkgs/development/compilers/cudatoolkit/common.nix @@ -137,6 +137,8 @@ backendStdenv.mkDerivation rec { # The krb5 expression ships libcom_err.so.3 but cudatoolkit asks for the # older + # This dependency is asked for by target-linux-x64/CollectX/RedHat/x86_64/libssl.so.10 + # - do we even want to use nvidia-shipped libssl? "libcom_err.so.2" ]; @@ -276,62 +278,6 @@ backendStdenv.mkDerivation rec { done ''; - preFixup = - let rpath = lib.concatStringsSep ":" [ - (lib.makeLibraryPath (buildInputs ++ [ "$lib" "$out" "$out/nvvm" ])) - - # The path to libstdc++ and such - # - # `backendStdenv` is the cuda-compatible toolchain that we pick in - # extension.nix; we hand it to NVCC to use as a back-end, and we link - # cudatoolkit's binaries against its libstdc++ - "${backendStdenv.cc.cc.lib}/lib64" - - "$out/jre/lib/amd64/jli" - "$out/lib64" - "$out/nvvm/lib64" - ]; - in - '' - while IFS= read -r -d $'\0' i; do - if ! isELF "$i"; then continue; fi - echo "patching $i..." - if [[ ! $i =~ \.so ]]; then - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $i - fi - if [[ $i =~ libcudart ]]; then - patchelf --remove-rpath $i - else - patchelf --set-rpath "${rpath}" --force-rpath $i - fi - done < <(find $out $lib $doc -type f -print0) - '' + lib.optionalString (lib.versionAtLeast version "11") '' - for file in $out/target-linux-x64/*.so; do - echo "patching $file..." - patchelf --set-rpath "${rpath}:\$ORIGIN" $file - done - ''; - - # Set RPATH so that libcuda and other libraries in - # /run/opengl-driver(-32)/lib can be found. See the explanation in - # addOpenGLRunpath. Don't try to figure out which libraries really need - # it, just patch all (but not the stubs libraries). Note that - # --force-rpath prevents changing RPATH (set above) to RUNPATH. - postFixup = '' - addOpenGLRunpath --force-rpath {$out,$lib}/lib/lib*.so - '' + lib.optionalString (lib.versionAtLeast version "11") '' - addOpenGLRunpath $out/cuda_sanitizer_api/compute-sanitizer/* - addOpenGLRunpath $out/cuda_sanitizer_api/compute-sanitizer/x86/* - addOpenGLRunpath $out/target-linux-x64/* - '' + - # Prune broken symlinks which can cause problems with consumers of this package. - '' - while read -r -d "" file; do - echo "Found and removing broken symlink $file" - rm "$file" - done < <(find "$out" "$lib" "$doc" -xtype l -print0) - ''; # cuda-gdb doesn't run correctly when not using sandboxing, so # temporarily disabling the install check. This should be set to true