Unverified Commit 9d27bdd3 authored by Connor Baker's avatar Connor Baker Committed by GitHub
Browse files

Merge pull request #227962 from ConnorBaker/feat/cuda-12_1_1

cudaPackages_12_1: init at 12.1.1; cudnn: don't break cudaPackages
parents 2e368329 3b143e37
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
final: prev: let

  inherit (final) callPackage;
  inherit (prev) cudaVersion lib pkgs;
  inherit (prev) cudaVersion lib;

  ### Cuda Toolkit Redist

@@ -14,6 +14,7 @@ final: prev: let
    "11.7" = ./manifests/redistrib_11.7.0.json;
    "11.8" = ./manifests/redistrib_11.8.0.json;
    "12.0" = ./manifests/redistrib_12.0.1.json;
    "12.1" = ./manifests/redistrib_12.1.1.json;
  };

  # Function to build a single cudatoolkit redist package
@@ -24,8 +25,6 @@ final: prev: let
    attrs = lib.filterAttrs (key: value: key != "release_date") (lib.importJSON manifest);
  in lib.mapAttrs buildCudaToolkitRedistPackage attrs;

  redistExists = cudaToolkitRedistManifests ? "${cudaVersion}";

  # All cudatoolkit redist packages for the current cuda version
  cudaToolkitRedistPackages = if
    lib.hasAttr cudaVersion cudaToolkitRedistManifests
+1127 −0

File added.

Preview size limit exceeded, changes collapsed.

+6 −0
Original line number Diff line number Diff line
@@ -77,3 +77,9 @@ version = "12.0.1"
url = "https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run"
sha256 = "sha256-GyBaBicvFGP0dydv2rkD8/ZmkXwGjlIHOAAeacehh1s="
gcc = "gcc12"

["12.1"]
version = "12.1.1"
url = "https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run"
sha256 = "sha256-10Ai1B2AEFMZ36Ib7qObd6W5kZU5wEh6BcqvJEbWpw4="
gcc = "gcc12"
+10 −18
Original line number Diff line number Diff line
@@ -43,21 +43,8 @@ final: prev: let
  cudnnReleases = lists.reverseList (builtins.import ./releases.nix);

  # Check whether a CUDNN release supports our CUDA version
  # supportedReleases :: NonEmptyList Release
  supportedReleases = let
    filtered = builtins.filter isSupported cudnnReleases;
    nonEmptyFiltered =
      trivial.throwIf (filtered == [])
      ''
        CUDNN does not support your cuda version ${cudaVersion}
      ''
      filtered;
  in
    nonEmptyFiltered;

  # The latest release is the first element of the list and will be our default choice
  # latestReleaseName :: String
  latestReleaseName = computeName (builtins.head supportedReleases).version;
  # supportedReleases :: List Release
  supportedReleases = builtins.filter isSupported cudnnReleases;

  # Function to transform our releases into build attributes
  # toBuildAttrs :: Release -> { name: String, value: Derivation }
@@ -70,9 +57,14 @@ final: prev: let
  # allBuilds :: AttrSet String Derivation
  allBuilds = builtins.listToAttrs (builtins.map toBuildAttrs supportedReleases);

  # The latest release will be our default build
  # defaultBuild :: AttrSet String Derivation
  defaultBuild.cudnn = allBuilds.${latestReleaseName};
  defaultBuild = attrsets.optionalAttrs (supportedReleases != []) {
    cudnn = let
      # The latest release is the first element of the list and will be our default choice
      # latestReleaseName :: String
      latestReleaseName = computeName (builtins.head supportedReleases).version;
    in
      allBuilds.${latestReleaseName};
  };

  # builds :: AttrSet String Derivation
  builds = allBuilds // defaultBuild;
+1 −0
Original line number Diff line number Diff line
# NOTE: Check https://docs.nvidia.com/deeplearning/cudnn/archives/index.html for support matrices.
[
  {
    version = "7.4.2.24";
Loading