From 8fa343c6b4451df0ad9ecb976e76e793ccb8f90a Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 18 Apr 2025 22:58:45 +0100 Subject: [PATCH 1/2] python3Packages.torch: fix cudnn attribute access Without the change the eval fails as: $ nix build --no-link -f. opensplatWithCuda --argstr system aarch64-linux error: error: attribute 'lib' missing at /home/slyfox/dev/git/nixpkgs-master/pkgs/development/python-modules/torch/default.nix:357:30: 356| export CUDNN_INCLUDE_DIR=${lib.getLib cudnn}/include 357| export CUDNN_LIB_DIR=${cudnn.lib}/lib | ^ 358| '' --- pkgs/development/python-modules/torch/source/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/torch/source/default.nix b/pkgs/development/python-modules/torch/source/default.nix index 3fd0e9d11ee7..187d7821b2cd 100644 --- a/pkgs/development/python-modules/torch/source/default.nix +++ b/pkgs/development/python-modules/torch/source/default.nix @@ -364,7 +364,7 @@ buildPythonPackage rec { '' + lib.optionalString (cudaSupport && cudaPackages ? cudnn) '' export CUDNN_INCLUDE_DIR=${lib.getLib cudnn}/include - export CUDNN_LIB_DIR=${cudnn.lib}/lib + export CUDNN_LIB_DIR=${lib.getLib cudnn}/lib '' + lib.optionalString rocmSupport '' export ROCM_PATH=${rocmtoolkit_joined} From 9fd753ea84e5035b357a275324e7fd7ccfb1fc77 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 26 Dec 2024 15:46:57 +0000 Subject: [PATCH 2/2] cuda-modules: fix `sort` predicate stability Incorrect sorting predicate was found as part of https://github.com/NixOS/nix/issues/12106 where `nix` was crashing on the code like: $ nix eval --expr 'builtins.sort (a: b: true) [ 1 2 3 ]' ... Aborted (core dumped) Note: the crash happens here because sorting predicate does not implement `isLess` and triggers assertion failures for `std::stable_sort` that backs `builtins.sort`. THe change restore `isLess` semantic for `preferable`. --- pkgs/development/cuda-modules/generic-builders/multiplex.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/cuda-modules/generic-builders/multiplex.nix b/pkgs/development/cuda-modules/generic-builders/multiplex.nix index ce50653bb5d4..15dd0c938f62 100644 --- a/pkgs/development/cuda-modules/generic-builders/multiplex.nix +++ b/pkgs/development/cuda-modules/generic-builders/multiplex.nix @@ -81,7 +81,7 @@ let redistArch = flags.getRedistArch hostPlatform.system; preferable = - p1: p2: (isSupported p2 -> isSupported p1) && (strings.versionAtLeast p1.version p2.version); + p1: p2: (isSupported p2 -> isSupported p1) && (strings.versionOlder p2.version p1.version); # All the supported packages we can build for our platform. # perSystemReleases :: List Package