Merge pull request #233851 from ConnorBaker/feat/cudnn_8_9_1

cudaPackages.cudnn: version bumps; remove patch from name
This commit is contained in:
Samuel Ainsworth 2023-05-26 10:26:30 -07:00 committed by GitHub
commit bbdb8416a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 22 deletions

View File

@ -8,7 +8,7 @@ A package set is available for each CUDA version, so for example
`cudaPackages_11_6`. Within each set is a matching version of the above listed `cudaPackages_11_6`. Within each set is a matching version of the above listed
packages. Additionally, other versions of the packages that are packaged and packages. Additionally, other versions of the packages that are packaged and
compatible are available as well. For example, there can be a compatible are available as well. For example, there can be a
`cudaPackages.cudnn_8_3_2` package. `cudaPackages.cudnn_8_3` package.
To use one or more CUDA packages in an expression, give the expression a `cudaPackages` parameter, and in case CUDA is optional To use one or more CUDA packages in an expression, give the expression a `cudaPackages` parameter, and in case CUDA is optional
```nix ```nix
@ -28,7 +28,7 @@ set.
```nix ```nix
mypkg = let mypkg = let
cudaPackages = cudaPackages_11_5.overrideScope' (final: prev: { cudaPackages = cudaPackages_11_5.overrideScope' (final: prev: {
cudnn = prev.cudnn_8_3_2; cudnn = prev.cudnn_8_3;
}}); }});
in callPackage { inherit cudaPackages; }; in callPackage { inherit cudaPackages; };
``` ```

View File

@ -27,7 +27,7 @@ let
# Earlier versions of cudatoolkit use pre-8.x CUDNN, so we use the default. # Earlier versions of cudatoolkit use pre-8.x CUDNN, so we use the default.
cudnn = if lib.versionOlder cudatoolkit.version "10.1" cudnn = if lib.versionOlder cudatoolkit.version "10.1"
then cudaPackages.cudnn then cudaPackages.cudnn
else cudaPackages.cudnn_7_6_5; else cudaPackages.cudnn_7_6;
in in
assert leveldbSupport -> (leveldb != null && snappy != null); assert leveldbSupport -> (leveldb != null && snappy != null);

View File

@ -11,29 +11,23 @@
final: prev: let final: prev: let
inherit (final) callPackage; inherit (final) callPackage;
inherit (prev) cudaVersion; inherit (prev) cudaVersion;
inherit (prev.lib) attrsets lists versions strings trivial; inherit (prev.lib) attrsets lists versions;
inherit (prev.lib.strings) replaceStrings versionAtLeast versionOlder;
# Utilities
# majorMinorPatch :: String -> String
majorMinorPatch = (trivial.flip trivial.pipe) [
(versions.splitVersion)
(lists.take 3)
(strings.concatStringsSep ".")
];
# Compute versioned attribute name to be used in this package set # Compute versioned attribute name to be used in this package set
# Patch version changes should not break the build, so we only use major and minor
# computeName :: String -> String # computeName :: String -> String
computeName = version: "cudnn_${strings.replaceStrings ["."] ["_"] (majorMinorPatch version)}"; computeName = version: "cudnn_${replaceStrings ["."] ["_"] (versions.majorMinor version)}";
# Check whether a CUDNN release supports our CUDA version # Check whether a CUDNN release supports our CUDA version
# Thankfully we're able to do lexicographic comparison on the version strings # Thankfully we're able to do lexicographic comparison on the version strings
# isSupported :: Release -> Bool # isSupported :: Release -> Bool
isSupported = release: isSupported = release:
strings.versionAtLeast cudaVersion release.minCudaVersion versionAtLeast cudaVersion release.minCudaVersion
&& strings.versionAtLeast release.maxCudaVersion cudaVersion; && versionAtLeast release.maxCudaVersion cudaVersion;
# useCudatoolkitRunfile :: Bool # useCudatoolkitRunfile :: Bool
useCudatoolkitRunfile = strings.versionOlder cudaVersion "11.3.999"; useCudatoolkitRunfile = versionOlder cudaVersion "11.3.999";
# buildCuDnnPackage :: Release -> Derivation # buildCuDnnPackage :: Release -> Derivation
buildCuDnnPackage = callPackage ./generic.nix {inherit useCudatoolkitRunfile;}; buildCuDnnPackage = callPackage ./generic.nix {inherit useCudatoolkitRunfile;};

View File

@ -155,17 +155,31 @@
hash = "sha256-l2xMunIzyXrnQAavq1Fyl2MAukD1slCiH4z3H1nJ920="; hash = "sha256-l2xMunIzyXrnQAavq1Fyl2MAukD1slCiH4z3H1nJ920=";
} }
{ {
version = "8.8.0.121"; version = "8.8.1.3";
minCudaVersion = "11.0"; minCudaVersion = "11.0";
maxCudaVersion = "11.8"; maxCudaVersion = "11.8";
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.8.0.121_cuda11-archive.tar.xz"; url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.8.1.3_cuda11-archive.tar.xz";
hash = "sha256-YgRkdgdtG0VfsT+3izjTSWusr7/bsElPszkiQKBEZuo="; hash = "sha256-r3WEyuDMVSS1kT7wjCm6YVQRPGDrCjegWQqRtRWoqPk=";
} }
{ {
version = "8.8.0.121"; version = "8.8.1.3";
minCudaVersion = "12.0"; minCudaVersion = "12.0";
maxCudaVersion = "12.0"; maxCudaVersion = "12.0";
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.8.0.121_cuda12-archive.tar.xz"; url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.8.1.3_cuda12-archive.tar.xz";
hash = "sha256-oHkrZmyq9ZOp3UEwl5V4/Tp4Iw9EB2RcKVcA7456qvI="; hash = "sha256-edd6dpx+cXWrx7XC7VxJQUjAYYqGQThyLIh/lcYjd3w=";
}
{
version = "8.9.1.23";
minCudaVersion = "11.0";
maxCudaVersion = "11.8";
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.1.23_cuda11-archive.tar.xz";
hash = "sha256-ptmIcmfihZDJ25XOZcvpamaN8DUjOLfTN+BTLe0zSFw=";
}
{
version = "8.9.1.23";
minCudaVersion = "12.0";
maxCudaVersion = "12.1";
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.1.23_cuda12-archive.tar.xz";
hash = "sha256-NRY8XFQr4MURc4sn4lI1GTy+7cXg4AbkSxzerxki6D4=";
} }
] ]