cudaPackages: __structuredAttrs works with autoPatchelf since #272752

This commit is contained in:
Connor Baker 2024-01-16 19:22:47 +00:00
parent b0209635c0
commit c86b13ed6d
2 changed files with 12 additions and 10 deletions

View File

@ -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" =

View File

@ -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: