From bb429ba52d3b1a99c20dd0a67af1e5868500cdaf Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Tue, 30 Jul 2024 09:16:46 +0200 Subject: [PATCH 1/2] cuda-modules: remove old aliases --- pkgs/development/cuda-modules/aliases.nix | 24 ++++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pkgs/development/cuda-modules/aliases.nix b/pkgs/development/cuda-modules/aliases.nix index 7f28f2c76d47..4e25dc44ca9a 100644 --- a/pkgs/development/cuda-modules/aliases.nix +++ b/pkgs/development/cuda-modules/aliases.nix @@ -1,18 +1,14 @@ -# Packges which have been deprecated or removed from cudaPackages +# Packages which have been deprecated or removed from cudaPackages final: prev: let - mkRenamed = - oldName: newName: newPkg: - final.lib.warn "cudaPackages.${oldName} is deprecated, use ${newName} instead" newPkg; -in -{ + inherit (prev.lib) warn; + inherit (builtins) mapAttrs; - # Deprecated: an alias kept for compatibility. Consider removing after 24.05 - autoFixElfFiles = mkRenamed "autoFixElfFiles" "pkgs.autoFixElfFiles" final.pkgs.autoFixElfFiles; # Added 2024-03-30 - autoAddDriverRunpath = - mkRenamed "autoAddDriverRunpath" "pkgs.autoAddDriverRunpath" - final.pkgs.autoAddDriverRunpath; # Added 2024-03-30 - autoAddOpenGLRunpathHook = - mkRenamed "autoAddOpenGLRunpathHook" "pkgs.autoAddDriverRunpathHook" - final.pkgs.autoAddDriverRunpath; # Added 2024-03-30 + mkRenamed = + oldName: + { path, package }: + warn "cudaPackages.${oldName} is deprecated, use ${path} instead" package; +in +mapAttrs mkRenamed { + # A comment to prevent empty { } from collapsing into a single line } From 2a94466c639f3a5f5413104c177b1bd7697b40e0 Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Tue, 30 Jul 2024 09:21:29 +0200 Subject: [PATCH 2/2] torch: do not deep-compare cudaPackages --- pkgs/development/python-modules/torch/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index ee7015abd8e6..feef28bbad33 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -202,8 +202,11 @@ let ]); "MPI cudatoolkit does not match cudaPackages.cudatoolkit" = MPISupport && cudaSupport && (mpi.cudatoolkit != cudaPackages.cudatoolkit); + # This used to be a deep package set comparison between cudaPackages and + # effectiveMagma.cudaPackages, making torch too strict in cudaPackages. + # In particular, this triggered warnings from cuda's `aliases.nix` "Magma cudaPackages does not match cudaPackages" = - cudaSupport && (effectiveMagma.cudaPackages != cudaPackages); + cudaSupport && (effectiveMagma.cudaPackages.cudaVersion != cudaPackages.cudaVersion); "Rocm support is currently broken because `rocmPackages.hipblaslt` is unpackaged. (2024-06-09)" = rocmSupport; }; in