From c86b13ed6db7fe1ea3325218e30a3d9fa9705e71 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 16 Jan 2024 19:22:47 +0000 Subject: [PATCH] cudaPackages: __structuredAttrs works with autoPatchelf since #272752 --- pkgs/development/cuda-modules/cuda/overrides.nix | 13 ++++++++----- .../cuda-modules/generic-builders/manifest.nix | 9 ++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/cuda-modules/cuda/overrides.nix b/pkgs/development/cuda-modules/cuda/overrides.nix index b4b59ce1f4a6..37dc7bf29c35 100644 --- a/pkgs/development/cuda-modules/cuda/overrides.nix +++ b/pkgs/development/cuda-modules/cuda/overrides.nix @@ -23,9 +23,9 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { final.pkgs.rdma-core ]; # Before 11.7 libcufile depends on itself for some reason. - env.autoPatchelfIgnoreMissingDeps = - prevAttrs.env.autoPatchelfIgnoreMissingDeps - + strings.optionalString (cudaVersionOlder "11.7") " libcufile.so.0"; + autoPatchelfIgnoreMissingDeps = + prevAttrs.autoPatchelfIgnoreMissingDeps + ++ lists.optionals (cudaVersionOlder "11.7") [ "libcufile.so.0" ]; } ); @@ -69,8 +69,11 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { cuda_compat = prev.cuda_compat.overrideAttrs ( prevAttrs: { - env.autoPatchelfIgnoreMissingDeps = - prevAttrs.env.autoPatchelfIgnoreMissingDeps + " libnvrm_gpu.so libnvrm_mem.so libnvdla_runtime.so"; + autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps ++ [ + "libnvrm_gpu.so" + "libnvrm_mem.so" + "libnvdla_runtime.so" + ]; # `cuda_compat` only works on aarch64-linux, and only when building for Jetson devices. badPlatformsConditions = prevAttrs.badPlatformsConditions // { "Trying to use cuda_compat on aarch64-linux targeting non-Jetson devices" = diff --git a/pkgs/development/cuda-modules/generic-builders/manifest.nix b/pkgs/development/cuda-modules/generic-builders/manifest.nix index d39c659a7cb9..38b80ff29f77 100644 --- a/pkgs/development/cuda-modules/generic-builders/manifest.nix +++ b/pkgs/development/cuda-modules/generic-builders/manifest.nix @@ -276,11 +276,10 @@ backendStdenv.mkDerivation ( ''; # libcuda needs to be resolved during runtime - # NOTE: Due to the use of __structuredAttrs, we can't use a list for autoPatchelfIgnoreMissingDeps, since it - # will take only the first value. Instead, we produce a string with the values separated by spaces. - # Using the `env` attribute ensures that the value is representable as one of the primitives allowed by - # bash's environment variables. - env.autoPatchelfIgnoreMissingDeps = "libcuda.so libcuda.so.*"; + autoPatchelfIgnoreMissingDeps = [ + "libcuda.so" + "libcuda.so.*" + ]; # The out output leverages the same functionality which backs the `symlinkJoin` function in # Nixpkgs: