From 7d161de78111dead45620ab77f7f97d99d044659 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Fri, 24 Nov 2023 13:24:53 +0000 Subject: [PATCH 1/7] cudaPackages_12: 12.0 -> 12.2 --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5d156a6715ea..33fa22066ba3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7318,7 +7318,7 @@ with pkgs; cudaPackages_12_1 = callPackage ./cuda-packages.nix { cudaVersion = "12.1"; }; cudaPackages_12_2 = callPackage ./cuda-packages.nix { cudaVersion = "12.2"; }; cudaPackages_12_3 = callPackage ./cuda-packages.nix { cudaVersion = "12.3"; }; - cudaPackages_12 = recurseIntoAttrs cudaPackages_12_0; + cudaPackages_12 = cudaPackages_12_2; # Latest supported by cudnn # Use the older cudaPackages for tensorflow and jax, as determined by cudnn # compatibility: https://www.tensorflow.org/install/source#gpu From 1620cc6e9ad6672ebaf2201cbde7a90152ebbef7 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Fri, 24 Nov 2023 13:25:14 +0000 Subject: [PATCH 2/7] cudaPackages: 11.8 -> 12.2 --- pkgs/top-level/all-packages.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 33fa22066ba3..a2f31ec52902 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7324,9 +7324,7 @@ with pkgs; # compatibility: https://www.tensorflow.org/install/source#gpu cudaPackagesGoogle = cudaPackages_11; - # TODO: try upgrading once there is a cuDNN release supporting CUDA 12. No - # such cuDNN release as of 2023-01-10. - cudaPackages = cudaPackages_11; + cudaPackages = recurseIntoAttrs cudaPackages_12; # TODO: move to alias cudatoolkit = cudaPackages.cudatoolkit; From cd51c7049c15c6f3c36b504d6a4391b049536188 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 12 Dec 2023 03:30:32 +0000 Subject: [PATCH 3/7] suitesparse: fix the cuda12 variant --- pkgs/development/libraries/science/math/suitesparse/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index abc2ff9a3701..45ea5900e286 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -41,6 +41,7 @@ stdenv.mkDerivation rec { ] ++ lib.optionals enableCuda [ cudaPackages.cuda_cudart.dev cudaPackages.cuda_cudart.lib + cudaPackages.cuda_cccl.dev cudaPackages.libcublas.dev cudaPackages.libcublas.lib ]; From b16942dfa8287ed5a4c24b18e5036c09687387d4 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 16 Jan 2024 20:56:22 +0000 Subject: [PATCH 4/7] cudaPackages.cuda_cudart: a separate output for stub --- pkgs/development/cuda-modules/cuda/overrides.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/cuda-modules/cuda/overrides.nix b/pkgs/development/cuda-modules/cuda/overrides.nix index b4b59ce1f4a6..d1cd8b1d573c 100644 --- a/pkgs/development/cuda-modules/cuda/overrides.nix +++ b/pkgs/development/cuda-modules/cuda/overrides.nix @@ -44,6 +44,11 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { cuda_cudart = prev.cuda_cudart.overrideAttrs ( prevAttrs: { + # Remove once cuda-find-redist-features has a special case for libcuda + outputs = + prevAttrs.outputs + ++ lists.optionals (!(builtins.elem "stubs" prevAttrs.outputs)) [ "stubs" ]; + allowFHSReferences = false; # The libcuda stub's pkg-config doesn't follow the general pattern: @@ -64,6 +69,14 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { ln -s libcuda.so lib/stubs/libcuda.so.1 fi ''; + + postFixup = + prevAttrs.postFixup or "" + + '' + moveToOutput lib/stubs "$stubs" + ln -s "$stubs"/lib/stubs/* "$stubs"/lib/ + ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs" + ''; } ); From 8ddc8e335530af3d1394fe323838ade3b0a7d2f6 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 17 Jan 2024 00:33:54 +0000 Subject: [PATCH 5/7] cudaPackages_12.nsight_systems: unbreak --- .../cuda-modules/cuda/overrides.nix | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/pkgs/development/cuda-modules/cuda/overrides.nix b/pkgs/development/cuda-modules/cuda/overrides.nix index d1cd8b1d573c..214d64a0f3df 100644 --- a/pkgs/development/cuda-modules/cuda/overrides.nix +++ b/pkgs/development/cuda-modules/cuda/overrides.nix @@ -210,20 +210,64 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { ); nsight_systems = prev.nsight_systems.overrideAttrs ( - prevAttrs: { - nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [final.pkgs.qt5.wrapQtAppsHook]; + prevAttrs: + let + qt = if lib.versionOlder prevAttrs.version "2022.4.2.1" then final.pkgs.qt5 else final.pkgs.qt6; + qtwayland = + if lib.versions.major qt.qtbase.version == "5" then + lib.getBin qt.qtwayland + else + lib.getLib qt.qtwayland; + qtWaylandPlugins = "${qtwayland}/${qt.qtbase.qtPluginPrefix}"; + in + { + # An ad hoc replacement for + # https://github.com/ConnorBaker/cuda-redist-find-features/issues/11 + env.rmPatterns = toString [ + "nsight-systems/*/*/libQt*" + "nsight-systems/*/*/libstdc*" + "nsight-systems/*/*/libboost*" + "nsight-systems/*/*/lib{ssl,ssh,crypto}*" + "nsight-systems/*/*/lib{arrow,jpeg}*" + "nsight-systems/*/*/Mesa" + "nsight-systems/*/*/python/bin/python" + "nsight-systems/*/*/libexec" + "nsight-systems/*/*/Plugins" + ]; + postPatch = + prevAttrs.postPatch or "" + + '' + for path in $rmPatterns ; do + rm -r "$path" + done + ''; + nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ qt.wrapQtAppsHook ]; buildInputs = prevAttrs.buildInputs ++ [ + final.cuda_cudart.stubs final.pkgs.alsa-lib + # final.pkgs.boost170 # cudaPackages_11_4 + final.pkgs.boost178 final.pkgs.e2fsprogs + final.pkgs.gst_all_1.gst-plugins-base + final.pkgs.gst_all_1.gstreamer final.pkgs.nss final.pkgs.numactl final.pkgs.pulseaudio + final.pkgs.rdma-core + final.pkgs.ucx final.pkgs.wayland final.pkgs.xorg.libXcursor final.pkgs.xorg.libXdamage final.pkgs.xorg.libXrandr final.pkgs.xorg.libXtst + qt.qtbase + (qt.qtdeclarative or qt.full) + (qt.qtsvg or qt.full) + qtWaylandPlugins ]; + + # Require boost 1.70 deprecated in Nixpkgs + meta.broken = prevAttrs.meta.broken or false || lib.versionOlder final.cudaVersion "11.8"; } ); From 0f70deed1cb54683a76363862ffd1fc7ea5dfa54 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 17 Jan 2024 01:02:34 +0000 Subject: [PATCH 6/7] cudaPackages: update the release notes with the major version bump --- nixos/doc/manual/release-notes/rl-2405.section.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index aba4d3d72d1d..1ea2a6fbf27e 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -96,6 +96,10 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - If [`system.stateVersion`](#opt-system.stateVersion) is >=23.11, `pkgs.nextcloud27` will be installed by default. - Please note that an upgrade from v26 (or older) to v28 directly is not possible. Please upgrade to `nextcloud27` (or earlier) first. Nextcloud prohibits skipping major versions while upgrading. You can upgrade by declaring [`services.nextcloud.package = pkgs.nextcloud27;`](options.html#opt-services.nextcloud.package). +- The vendored third party libraries have been mostly removed from `cudaPackages.nsight_systems`, which we now only ship for `cudaPackages_11_8` and later due to outdated dependencies. Users comfortable with the vendored dependencies may use `overrideAttrs` to amend the `postPatch` phase and the `meta.broken` correspondingly. + +- The `cudaPackages` package scope has been updated to `cudaPackages_12`. + - `services.resolved.fallbackDns` can now be used to disable the upstream fallback servers entirely by setting it to an empty list. To get the previous behaviour of the upstream defaults set it to null, the new default, instead. - `services.avahi.nssmdns` got split into `services.avahi.nssmdns4` and `services.avahi.nssmdns6` which enable the mDNS NSS switch for IPv4 and IPv6 respectively. From bed725db88c8163b9c5cd2186f34bed79e1add42 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 17 Jan 2024 15:17:01 +0000 Subject: [PATCH 7/7] cudaPackages_11_4.nsight_systems: clean up the deprecation comments --- nixos/doc/manual/release-notes/rl-2405.section.md | 2 +- pkgs/development/cuda-modules/cuda/overrides.nix | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 1ea2a6fbf27e..d2d72c5da41b 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -96,7 +96,7 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - If [`system.stateVersion`](#opt-system.stateVersion) is >=23.11, `pkgs.nextcloud27` will be installed by default. - Please note that an upgrade from v26 (or older) to v28 directly is not possible. Please upgrade to `nextcloud27` (or earlier) first. Nextcloud prohibits skipping major versions while upgrading. You can upgrade by declaring [`services.nextcloud.package = pkgs.nextcloud27;`](options.html#opt-services.nextcloud.package). -- The vendored third party libraries have been mostly removed from `cudaPackages.nsight_systems`, which we now only ship for `cudaPackages_11_8` and later due to outdated dependencies. Users comfortable with the vendored dependencies may use `overrideAttrs` to amend the `postPatch` phase and the `meta.broken` correspondingly. +- The vendored third party libraries have been mostly removed from `cudaPackages.nsight_systems`, which we now only ship for `cudaPackages_11_8` and later due to outdated dependencies. Users comfortable with the vendored dependencies may use `overrideAttrs` to amend the `postPatch` phase and the `meta.broken` correspondingly. Alternatively, one could package the deprecated `boost170` locally, as required for `cudaPackages_11_4.nsight_systems`. - The `cudaPackages` package scope has been updated to `cudaPackages_12`. diff --git a/pkgs/development/cuda-modules/cuda/overrides.nix b/pkgs/development/cuda-modules/cuda/overrides.nix index 214d64a0f3df..85b925e9ea35 100644 --- a/pkgs/development/cuda-modules/cuda/overrides.nix +++ b/pkgs/development/cuda-modules/cuda/overrides.nix @@ -245,7 +245,6 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { buildInputs = prevAttrs.buildInputs ++ [ final.cuda_cudart.stubs final.pkgs.alsa-lib - # final.pkgs.boost170 # cudaPackages_11_4 final.pkgs.boost178 final.pkgs.e2fsprogs final.pkgs.gst_all_1.gst-plugins-base @@ -266,7 +265,7 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { qtWaylandPlugins ]; - # Require boost 1.70 deprecated in Nixpkgs + # Older releases require boost 1.70 deprecated in Nixpkgs meta.broken = prevAttrs.meta.broken or false || lib.versionOlder final.cudaVersion "11.8"; } );