diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index a8cefa0da604..540cd7989d01 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -307,6 +307,12 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - The `cudaPackages` package scope has been updated to `cudaPackages_12`. +- The deprecated `cudaPackages.cudatoolkit` has been replaced with a + symlink-based wrapper for the splayed redistributable CUDA packages. The + wrapper only includes tools and libraries necessary to build common packages + like e.g. tensorflow. The original runfile-based `cudatoolkit` is still + available as `cudatoolkit-legacy-runfile`. + - The `halloy` package was updated past 2024.5 which introduced a breaking change by switching the config format from YAML to TOML. See https://github.com/squidowl/halloy/releases/tag/2024.5 for details. - Ada packages (libraries and tools) have been moved into the `gnatPackages` scope. `gnatPackages` uses the default GNAT compiler, `gnat12Packages` and `gnat13Packages` use the respective matching compiler version. diff --git a/pkgs/development/cuda-modules/cudatoolkit/default.nix b/pkgs/development/cuda-modules/cudatoolkit/default.nix index 5a983aaf5c70..e5606f939512 100644 --- a/pkgs/development/cuda-modules/cudatoolkit/default.nix +++ b/pkgs/development/cuda-modules/cudatoolkit/default.nix @@ -411,7 +411,7 @@ backendStdenv.mkDerivation rec { }; meta = with lib; { - description = "A compiler for NVIDIA GPUs, math libraries, and tools"; + description = "The deprecated runfile-based CUDAToolkit installation (a compiler for NVIDIA GPUs, math libraries, and tools)"; homepage = "https://developer.nvidia.com/cuda-toolkit"; platforms = [ "x86_64-linux" ]; license = licenses.nvidiaCuda; diff --git a/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix b/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix new file mode 100644 index 000000000000..6bdcdecbacd6 --- /dev/null +++ b/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix @@ -0,0 +1,86 @@ +{ + lib, + symlinkJoin, + backendStdenv, + cudaOlder, + cudatoolkit-legacy-runfile, + cudaVersion, + cuda_cccl ? null, + cuda_cudart ? null, + cuda_cuobjdump ? null, + cuda_cupti ? null, + cuda_cuxxfilt ? null, + cuda_gdb ? null, + cuda_nvcc ? null, + cuda_nvdisasm ? null, + cuda_nvml_dev ? null, + cuda_nvprune ? null, + cuda_nvrtc ? null, + cuda_nvtx ? null, + cuda_profiler_api ? null, + cuda_sanitizer_api ? null, + libcublas ? null, + libcufft ? null, + libcurand ? null, + libcusolver ? null, + libcusparse ? null, + libnpp ? null, +}: + +let + getAllOutputs = p: [ + (lib.getBin p) + (lib.getLib p) + (lib.getDev p) + ]; + hostPackages = [ + cuda_cuobjdump + cuda_gdb + cuda_nvcc + cuda_nvdisasm + cuda_nvprune + ]; + targetPackages = [ + cuda_cccl + cuda_cudart + cuda_cupti + cuda_cuxxfilt + cuda_nvml_dev + cuda_nvrtc + cuda_nvtx + cuda_profiler_api + cuda_sanitizer_api + libcublas + libcufft + libcurand + libcusolver + libcusparse + libnpp + ]; + + # This assumes we put `cudatoolkit` in `buildInputs` instead of `nativeBuildInputs`: + allPackages = (map (p: p.__spliced.buildHost or p) hostPackages) ++ targetPackages; +in + +if cudaOlder "11.4" then + cudatoolkit-legacy-runfile +else + symlinkJoin rec { + name = "cuda-merged-${cudaVersion}"; + version = cudaVersion; + + paths = builtins.concatMap getAllOutputs allPackages; + + passthru = { + cc = lib.warn "cudaPackages.cudatoolkit is deprecated, refer to the manual and use splayed packages instead" backendStdenv.cc; + lib = symlinkJoin { + inherit name; + paths = map (p: lib.getLib p) allPackages; + }; + }; + + meta = with lib; { + description = "A wrapper substituting the deprecated runfile-based CUDA installation"; + license = licenses.nvidiaCuda; + }; + } diff --git a/pkgs/top-level/cuda-packages.nix b/pkgs/top-level/cuda-packages.nix index f573d2358147..92960422af44 100644 --- a/pkgs/top-level/cuda-packages.nix +++ b/pkgs/top-level/cuda-packages.nix @@ -69,7 +69,11 @@ let backendStdenv = final.callPackage ../development/cuda-modules/backend-stdenv.nix { }; # Loose packages - cudatoolkit = final.callPackage ../development/cuda-modules/cudatoolkit { }; + + # TODO: Move to aliases.nix once all Nixpkgs has migrated to the splayed CUDA packages + cudatoolkit = final.callPackage ../development/cuda-modules/cudatoolkit/redist-wrapper.nix { }; + cudatoolkit-legacy-runfile = final.callPackage ../development/cuda-modules/cudatoolkit { }; + saxpy = final.callPackage ../development/cuda-modules/saxpy { }; nccl = final.callPackage ../development/cuda-modules/nccl { }; nccl-tests = final.callPackage ../development/cuda-modules/nccl-tests { };