Merge pull request #217363 from ConnorBaker/feat/cudnn-8.8.0
cudnn: init 8.8.0; rewrite to assist maintainability
This commit is contained in:
commit
3bc99d82aa
@ -1,249 +1,80 @@
|
|||||||
|
# Support matrix can be found at
|
||||||
|
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-880/support-matrix/index.html
|
||||||
|
# Type aliases
|
||||||
|
# Release = {
|
||||||
|
# version: String,
|
||||||
|
# minCudaVersion: String,
|
||||||
|
# maxCudaVersion: String,
|
||||||
|
# url: String,
|
||||||
|
# hash: String,
|
||||||
|
# }
|
||||||
final: prev: let
|
final: prev: let
|
||||||
|
|
||||||
inherit (final) callPackage;
|
inherit (final) callPackage;
|
||||||
inherit (prev) cudatoolkit cudaVersion lib pkgs;
|
inherit (prev) cudaVersion;
|
||||||
inherit (prev.lib.versions) major;
|
inherit (prev.lib) attrsets lists versions strings trivial;
|
||||||
|
|
||||||
### CuDNN
|
# Utilities
|
||||||
|
# majorMinorPatch :: String -> String
|
||||||
|
majorMinorPatch = (trivial.flip trivial.pipe) [
|
||||||
|
(versions.splitVersion)
|
||||||
|
(lists.take 3)
|
||||||
|
(strings.concatStringsSep ".")
|
||||||
|
];
|
||||||
|
|
||||||
buildCuDnnPackage = args:
|
# Compute versioned attribute name to be used in this package set
|
||||||
let
|
# computeName :: String -> String
|
||||||
useCudatoolkitRunfile = lib.versionOlder cudaVersion "11.3.999";
|
computeName = version: "cudnn_${strings.replaceStrings ["."] ["_"] (majorMinorPatch version)}";
|
||||||
in
|
|
||||||
callPackage ./generic.nix { inherit useCudatoolkitRunfile; } args;
|
|
||||||
|
|
||||||
toUnderscore = str: lib.replaceStrings ["."] ["_"] str;
|
# Check whether a CUDNN release supports our CUDA version
|
||||||
|
# Thankfully we're able to do lexicographic comparison on the version strings
|
||||||
|
# isSupported :: Release -> Bool
|
||||||
|
isSupported = release:
|
||||||
|
strings.versionAtLeast cudaVersion release.minCudaVersion
|
||||||
|
&& strings.versionAtLeast release.maxCudaVersion cudaVersion;
|
||||||
|
|
||||||
majorMinorPatch = str: lib.concatStringsSep "." (lib.take 3 (lib.splitVersion str));
|
# useCudatoolkitRunfile :: Bool
|
||||||
|
useCudatoolkitRunfile = strings.versionOlder cudaVersion "11.3.999";
|
||||||
|
|
||||||
cuDnnPackages = with lib; let
|
# buildCuDnnPackage :: Release -> Derivation
|
||||||
# Check whether a file is supported for our cuda version
|
buildCuDnnPackage = callPackage ./generic.nix {inherit useCudatoolkitRunfile;};
|
||||||
isSupported = fileData: elem cudaVersion fileData.supportedCudaVersions;
|
|
||||||
# Return the first file that is supported. In practice there should only ever be one anyway.
|
|
||||||
supportedFile = files: findFirst isSupported null files;
|
|
||||||
# Supported versions with versions as keys and file as value
|
|
||||||
supportedVersions = filterAttrs (version: file: file !=null ) (mapAttrs (version: files: supportedFile files) cuDnnVersions);
|
|
||||||
# Compute versioned attribute name to be used in this package set
|
|
||||||
computeName = version: "cudnn_${toUnderscore version}";
|
|
||||||
# Add all supported builds as attributes
|
|
||||||
allBuilds = mapAttrs' (version: file: nameValuePair (computeName version) (buildCuDnnPackage (removeAttrs file ["fileVersion"]))) supportedVersions;
|
|
||||||
# Set the default attributes, e.g. cudnn = cudnn_8_3_1;
|
|
||||||
defaultBuild = { "cudnn" = if allBuilds ? ${computeName cuDnnDefaultVersion}
|
|
||||||
then allBuilds.${computeName cuDnnDefaultVersion}
|
|
||||||
else throw "cudnn-${cuDnnDefaultVersion} does not support your cuda version ${cudaVersion}"; };
|
|
||||||
in allBuilds // defaultBuild;
|
|
||||||
|
|
||||||
cuDnnVersions = let
|
# Reverse the list to have the latest release first
|
||||||
urlPrefix = "https://developer.download.nvidia.com/compute/redist/cudnn";
|
# cudnnReleases :: List Release
|
||||||
in {
|
cudnnReleases = lists.reverseList (builtins.import ./releases.nix);
|
||||||
"7.4.2" = [
|
|
||||||
rec {
|
# Check whether a CUDNN release supports our CUDA version
|
||||||
fileVersion = "10.0";
|
# supportedReleases :: NonEmptyList Release
|
||||||
fullVersion = "7.4.2.24";
|
supportedReleases = let
|
||||||
hash = "sha256-Lt/IagK1DRfojEeJVaMy5qHoF05+U6NFi06lH68C2qM=";
|
filtered = builtins.filter isSupported cudnnReleases;
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-10.0-linux-x64-v${fullVersion}.tgz";
|
nonEmptyFiltered =
|
||||||
supportedCudaVersions = [ "10.0" ];
|
trivial.throwIf (filtered == [])
|
||||||
}
|
''
|
||||||
];
|
CUDNN does not support your cuda version ${cudaVersion}
|
||||||
"7.6.5" = [
|
''
|
||||||
rec {
|
filtered;
|
||||||
fileVersion = "10.0";
|
in
|
||||||
fullVersion = "7.6.5.32";
|
nonEmptyFiltered;
|
||||||
hash = "sha256-KDVeOV8LK5OsLIO2E2CzW6bNA3fkTni+GXtrYbS0kro=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${cudatoolkit.majorVersion}-linux-x64-v${fullVersion}.tgz";
|
# The latest release is the first element of the list and will be our default choice
|
||||||
supportedCudaVersions = [ "10.0" ];
|
# latestReleaseName :: String
|
||||||
}
|
latestReleaseName = computeName (builtins.head supportedReleases).version;
|
||||||
rec {
|
|
||||||
fileVersion = "10.1";
|
# Function to transform our releases into build attributes
|
||||||
fullVersion = "7.6.5.32";
|
# toBuildAttrs :: Release -> { name: String, value: Derivation }
|
||||||
hash = "sha256-fq7IA5osMKsLx1jTA1iHZ2k972v0myJIWiwAvy4TbLM=";
|
toBuildAttrs = release: {
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${cudatoolkit.majorVersion}-linux-x64-v${fullVersion}.tgz";
|
name = computeName release.version;
|
||||||
supportedCudaVersions = [ "10.1" ];
|
value = buildCuDnnPackage release;
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "7.6.5.32";
|
|
||||||
hash = "sha256-fq7IA5osMKsLx1jTA1iHZ2k972v0myJIWiwAvy4TbLN=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${cudatoolkit.majorVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"8.0.5" = [
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.1";
|
|
||||||
fullVersion = "8.0.5.39";
|
|
||||||
hash = "sha256-kJCElSmIlrM6qVBjo0cfk8NmJ9esAcF9w211xl7qSgA=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${fileVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-805/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "10.1" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "8.0.5.39";
|
|
||||||
hash = "sha256-IfhMBcZ78eyFnnfDjM1b8VSWT6HDCPRJlZvkw1bjgvM=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${fileVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-805/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.0";
|
|
||||||
fullVersion = "8.0.5.39";
|
|
||||||
hash = "sha256-ThbueJXetKixwZS4ErpJWG730mkCBRQB03F1EYmKm3M=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${fileVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-805/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "11.0" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.1";
|
|
||||||
fullVersion = "8.0.5.39";
|
|
||||||
hash = "sha256-HQRr+nk5navMb2yxUHkYdUQ5RC6gyp4Pvs3URvmwDM4=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${fileVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-805/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "11.1" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"8.1.1" = [
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "8.1.1.33";
|
|
||||||
hash = "sha256-Kkp7mabpv6aQ6xm7QeSVU/KnpJGls6v8rpAOFmxbbr0=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${fileVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-811/support-matrix/index.html#cudnn-versions-810-811
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.2";
|
|
||||||
fullVersion = "8.1.1.33";
|
|
||||||
hash = "sha256-mKh4TpKGLyABjSDCgbMNSgzZUfk2lPZDPM9K6cUCumo=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${fileVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-811/support-matrix/index.html#cudnn-versions-810-811
|
|
||||||
supportedCudaVersions = [ "11.0" "11.1" "11.2" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"8.2.4" = [
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "8.2.4.15";
|
|
||||||
hash = "sha256-0jyUoxFaHHcRamwSfZF1+/WfcjNkN08mo0aZB18yIvE=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${fileVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-824/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.4";
|
|
||||||
fullVersion = "8.2.4.15";
|
|
||||||
hash = "sha256-Dl0t+JC5ln76ZhnaQhMQ2XMjVlp58FoajLm3Fluq0Nc=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/cudnn-${fileVersion}-linux-x64-v${fullVersion}.tgz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-824/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "11.0" "11.1" "11.2" "11.3" "11.4" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"8.3.3" = [
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "8.3.3.40";
|
|
||||||
hash = "sha256-2FVPKzLmKV1fyPOsJeaPlAWLAYyAHaucFD42gS+JJqs=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-833/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.5";
|
|
||||||
fullVersion = "8.3.3.40";
|
|
||||||
hash = "sha256-6r6Wx1zwPqT1N5iU2RTx+K4UzqsSGYnoSwg22Sf7dzE=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-833/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "11.0" "11.1" "11.2" "11.3" "11.4" "11.5" "11.6" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"8.4.1" = [
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "8.4.1.50";
|
|
||||||
hash = "sha256-I88qMmU6lIiLVmaPuX7TTbisgTav839mssxUo3lQNjg=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-841/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.6";
|
|
||||||
fullVersion = "8.4.1.50";
|
|
||||||
hash = "sha256-7JbSN22B/KQr3T1MPXBambKaBlurV/kgVhx2PinGfQE=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-841/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "11.0" "11.1" "11.2" "11.3" "11.4" "11.5" "11.6" "11.7" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"8.5.0" = [
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "8.5.0.96";
|
|
||||||
hash = "sha256-1mzhbbzR40WKkHnQLtJHhg0vYgf7G8a0OBcCwIOkJjM=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${major fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-850/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.7";
|
|
||||||
fullVersion = "8.5.0.96";
|
|
||||||
hash = "sha256-VFSm/ZTwCHKMqumtrZk8ToXvNjAuJrzkO+p9RYpee20=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${major fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-850/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "11.0" "11.1" "11.2" "11.3" "11.4" "11.5" "11.6" "11.7" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"8.6.0" = [
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "8.6.0.163";
|
|
||||||
hash = "sha256-t4sr/GrFqqdxu2VhaJQk5K1Xm/0lU4chXG8hVL09R9k=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${major fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-860/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.8";
|
|
||||||
fullVersion = "8.6.0.163";
|
|
||||||
hash = "sha256-u8OW30cpTGV+3AnGAGdNYIyxv8gLgtz0VHBgwhcRFZ4=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${major fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-860/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "11.0" "11.1" "11.2" "11.3" "11.4" "11.5" "11.6" "11.7" "11.8" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"8.7.0" = [
|
|
||||||
rec {
|
|
||||||
fileVersion = "10.2";
|
|
||||||
fullVersion = "8.7.0.84";
|
|
||||||
hash = "sha256-bZhaqc8+GbPV2FQvvbbufd8VnEJgvfkICc2N3/gitRg=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${major fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-870/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "10.2" ];
|
|
||||||
}
|
|
||||||
rec {
|
|
||||||
fileVersion = "11.8";
|
|
||||||
fullVersion = "8.7.0.84";
|
|
||||||
hash = "sha256-l2xMunIzyXrnQAavq1Fyl2MAukD1slCiH4z3H1nJ920=";
|
|
||||||
url = "${urlPrefix}/v${majorMinorPatch fullVersion}/local_installers/${fileVersion}/cudnn-linux-x86_64-${fullVersion}_cuda${major fileVersion}-archive.tar.xz";
|
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-870/support-matrix/index.html
|
|
||||||
supportedCudaVersions = [ "11.0" "11.1" "11.2" "11.3" "11.4" "11.5" "11.6" "11.7" "11.8" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Default attributes
|
# Add all supported builds as attributes
|
||||||
cuDnnDefaultVersion = {
|
# allBuilds :: AttrSet String Derivation
|
||||||
"10.0" = "7.4.2";
|
allBuilds = builtins.listToAttrs (builtins.map toBuildAttrs supportedReleases);
|
||||||
"10.1" = "8.0.5";
|
|
||||||
"10.2" = "8.7.0";
|
|
||||||
"11.0" = "8.7.0";
|
|
||||||
"11.1" = "8.7.0";
|
|
||||||
"11.2" = "8.7.0";
|
|
||||||
"11.3" = "8.7.0";
|
|
||||||
"11.4" = "8.7.0";
|
|
||||||
"11.5" = "8.7.0";
|
|
||||||
"11.6" = "8.7.0";
|
|
||||||
"11.7" = "8.7.0";
|
|
||||||
"11.8" = "8.7.0";
|
|
||||||
}.${cudaVersion} or "8.7.0";
|
|
||||||
|
|
||||||
in cuDnnPackages
|
# The latest release will be our default build
|
||||||
|
# defaultBuild :: AttrSet String Derivation
|
||||||
|
defaultBuild.cudnn = allBuilds.${latestReleaseName};
|
||||||
|
|
||||||
|
# builds :: AttrSet String Derivation
|
||||||
|
builds = allBuilds // defaultBuild;
|
||||||
|
in
|
||||||
|
builds
|
||||||
|
@ -1,113 +1,128 @@
|
|||||||
{ stdenv
|
{
|
||||||
, lib
|
stdenv,
|
||||||
, zlib
|
lib,
|
||||||
, useCudatoolkitRunfile ? false
|
zlib,
|
||||||
, cudaVersion
|
useCudatoolkitRunfile ? false,
|
||||||
, cudaMajorVersion
|
cudaVersion,
|
||||||
, cudatoolkit # if cuda>=11: only used for .cc
|
cudaMajorVersion,
|
||||||
, libcublas ? null # cuda <11 doesn't ship redist packages
|
cudatoolkit, # if cuda>=11: only used for .cc
|
||||||
, autoPatchelfHook
|
libcublas ? null, # cuda <11 doesn't ship redist packages
|
||||||
, autoAddOpenGLRunpathHook
|
autoPatchelfHook,
|
||||||
, fetchurl
|
autoAddOpenGLRunpathHook,
|
||||||
, # The distributed version of CUDNN includes both dynamically liked .so files,
|
fetchurl,
|
||||||
|
# The distributed version of CUDNN includes both dynamically liked .so files,
|
||||||
# as well as statically linked .a files. However, CUDNN is quite large
|
# as well as statically linked .a files. However, CUDNN is quite large
|
||||||
# (multiple gigabytes), so you can save some space in your nix store by
|
# (multiple gigabytes), so you can save some space in your nix store by
|
||||||
# removing the statically linked libraries if you are not using them.
|
# removing the statically linked libraries if you are not using them.
|
||||||
#
|
#
|
||||||
# Setting this to true removes the statically linked .a files.
|
# Setting this to true removes the statically linked .a files.
|
||||||
# Setting this to false keeps these statically linked .a files.
|
# Setting this to false keeps these statically linked .a files.
|
||||||
removeStatic ? false
|
removeStatic ? false,
|
||||||
|
}: {
|
||||||
|
version,
|
||||||
|
url,
|
||||||
|
hash,
|
||||||
|
minCudaVersion,
|
||||||
|
maxCudaVersion,
|
||||||
}:
|
}:
|
||||||
|
assert useCudatoolkitRunfile || (libcublas != null); let
|
||||||
{ fullVersion
|
|
||||||
, url
|
|
||||||
, hash
|
|
||||||
, supportedCudaVersions ? [ ]
|
|
||||||
}:
|
|
||||||
|
|
||||||
assert useCudatoolkitRunfile || (libcublas != null);
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (cudatoolkit) cc;
|
inherit (cudatoolkit) cc;
|
||||||
|
inherit (lib) lists strings trivial versions;
|
||||||
|
|
||||||
majorMinorPatch = version: lib.concatStringsSep "." (lib.take 3 (lib.splitVersion version));
|
# majorMinorPatch :: String -> String
|
||||||
version = majorMinorPatch fullVersion;
|
majorMinorPatch = (trivial.flip trivial.pipe) [
|
||||||
|
(versions.splitVersion)
|
||||||
|
(lists.take 3)
|
||||||
|
(strings.concatStringsSep ".")
|
||||||
|
];
|
||||||
|
|
||||||
|
# versionTriple :: String
|
||||||
|
# Version with three components: major.minor.patch
|
||||||
|
versionTriple = majorMinorPatch version;
|
||||||
|
|
||||||
|
# cudatoolkit_root :: Derivation
|
||||||
cudatoolkit_root =
|
cudatoolkit_root =
|
||||||
if useCudatoolkitRunfile
|
if useCudatoolkitRunfile
|
||||||
then cudatoolkit
|
then cudatoolkit
|
||||||
else libcublas;
|
else libcublas;
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "cudatoolkit-${cudaMajorVersion}-cudnn";
|
pname = "cudatoolkit-${cudaMajorVersion}-cudnn";
|
||||||
inherit version;
|
version = versionTriple;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
inherit url hash;
|
inherit url hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Check and normalize Runpath against DT_NEEDED using autoPatchelf.
|
# Check and normalize Runpath against DT_NEEDED using autoPatchelf.
|
||||||
# Prepend /run/opengl-driver/lib using addOpenGLRunpath for dlopen("libcudacuda.so")
|
# Prepend /run/opengl-driver/lib using addOpenGLRunpath for dlopen("libcudacuda.so")
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
autoPatchelfHook
|
autoPatchelfHook
|
||||||
autoAddOpenGLRunpathHook
|
autoAddOpenGLRunpathHook
|
||||||
];
|
];
|
||||||
|
|
||||||
# Used by autoPatchelfHook
|
# Used by autoPatchelfHook
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
cc.cc.lib # libstdc++
|
cc.cc.lib # libstdc++
|
||||||
zlib
|
zlib
|
||||||
cudatoolkit_root
|
cudatoolkit_root
|
||||||
];
|
];
|
||||||
|
|
||||||
# We used to patch Runpath here, but now we use autoPatchelfHook
|
# We used to patch Runpath here, but now we use autoPatchelfHook
|
||||||
#
|
#
|
||||||
# Note also that version <=8.3.0 contained a subdirectory "lib64/" but in
|
# Note also that version <=8.3.0 contained a subdirectory "lib64/" but in
|
||||||
# version 8.3.2 it seems to have been renamed to simply "lib/".
|
# version 8.3.2 it seems to have been renamed to simply "lib/".
|
||||||
installPhase = ''
|
installPhase =
|
||||||
runHook preInstall
|
''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cp -a include $out/include
|
cp -a include $out/include
|
||||||
[ -d "lib/" ] && cp -a lib $out/lib
|
[ -d "lib/" ] && cp -a lib $out/lib
|
||||||
[ -d "lib64/" ] && cp -a lib64 $out/lib64
|
[ -d "lib64/" ] && cp -a lib64 $out/lib64
|
||||||
'' + lib.optionalString removeStatic ''
|
''
|
||||||
rm -f $out/lib/*.a
|
+ strings.optionalString removeStatic ''
|
||||||
rm -f $out/lib64/*.a
|
rm -f $out/lib/*.a
|
||||||
'' + ''
|
rm -f $out/lib64/*.a
|
||||||
runHook postInstall
|
''
|
||||||
'';
|
+ ''
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
# Without --add-needed autoPatchelf forgets $ORIGIN on cuda>=8.0.5.
|
# Without --add-needed autoPatchelf forgets $ORIGIN on cuda>=8.0.5.
|
||||||
postFixup = lib.optionalString (lib.versionAtLeast fullVersion "8.0.5") ''
|
postFixup = strings.optionalString (strings.versionAtLeast versionTriple "8.0.5") ''
|
||||||
patchelf $out/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
|
patchelf $out/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit useCudatoolkitRunfile;
|
inherit useCudatoolkitRunfile;
|
||||||
|
|
||||||
cudatoolkit = lib.warn ''
|
cudatoolkit =
|
||||||
cudnn.cudatoolkit passthru attribute is deprecated;
|
trivial.warn
|
||||||
if your derivation uses cudnn directly, it should probably consume cudaPackages instead
|
''
|
||||||
''
|
cudnn.cudatoolkit passthru attribute is deprecated;
|
||||||
cudatoolkit;
|
if your derivation uses cudnn directly, it should probably consume cudaPackages instead
|
||||||
|
''
|
||||||
|
cudatoolkit;
|
||||||
|
|
||||||
majorVersion = lib.versions.major version;
|
majorVersion = versions.major versionTriple;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
# Check that the cudatoolkit version satisfies our min/max constraints (both
|
# Check that the cudatoolkit version satisfies our min/max constraints (both
|
||||||
# inclusive). We mark the package as broken if it fails to satisfies the
|
# inclusive). We mark the package as broken if it fails to satisfies the
|
||||||
# official version constraints (as recorded in default.nix). In some cases
|
# official version constraints (as recorded in default.nix). In some cases
|
||||||
# you _may_ be able to smudge version constraints, just know that you're
|
# you _may_ be able to smudge version constraints, just know that you're
|
||||||
# embarking into unknown and unsupported territory when doing so.
|
# embarking into unknown and unsupported territory when doing so.
|
||||||
broken = !(elem cudaVersion supportedCudaVersions);
|
broken =
|
||||||
description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
|
strings.versionOlder cudaVersion minCudaVersion
|
||||||
homepage = "https://developer.nvidia.com/cudnn";
|
|| strings.versionOlder maxCudaVersion cudaVersion;
|
||||||
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
|
||||||
# TODO: consider marking unfreRedistributable when not using runfile
|
homepage = "https://developer.nvidia.com/cudnn";
|
||||||
license = licenses.unfree;
|
sourceProvenance = with sourceTypes; [binaryNativeCode];
|
||||||
platforms = [ "x86_64-linux" ];
|
# TODO: consider marking unfreRedistributable when not using runfile
|
||||||
maintainers = with maintainers; [ mdaiter samuela ];
|
license = licenses.unfree;
|
||||||
};
|
platforms = ["x86_64-linux"];
|
||||||
}
|
maintainers = with maintainers; [mdaiter samuela];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
170
pkgs/development/libraries/science/math/cudnn/releases.nix
Normal file
170
pkgs/development/libraries/science/math/cudnn/releases.nix
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
version = "7.4.2.24";
|
||||||
|
minCudaVersion = "10.0";
|
||||||
|
maxCudaVersion = "10.0";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v7.4.2/cudnn-10.0-linux-x64-v7.4.2.24.tgz";
|
||||||
|
hash = "sha256-Lt/IagK1DRfojEeJVaMy5qHoF05+U6NFi06lH68C2qM=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "7.6.5.32";
|
||||||
|
minCudaVersion = "10.0";
|
||||||
|
maxCudaVersion = "10.0";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.0-linux-x64-v7.6.5.32.tgz";
|
||||||
|
hash = "sha256-KDVeOV8LK5OsLIO2E2CzW6bNA3fkTni+GXtrYbS0kro=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "7.6.5.32";
|
||||||
|
minCudaVersion = "10.1";
|
||||||
|
maxCudaVersion = "10.1";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.1-linux-x64-v7.6.5.32.tgz";
|
||||||
|
hash = "sha256-fq7IA5osMKsLx1jTA1iHZ2k972v0myJIWiwAvy4TbLM=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "7.6.5.32";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.2-linux-x64-v7.6.5.32.tgz";
|
||||||
|
hash = "sha256-fq7IA5osMKsLx1jTA1iHZ2k972v0myJIWiwAvy4TbLN=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.0.5.39";
|
||||||
|
minCudaVersion = "10.1";
|
||||||
|
maxCudaVersion = "10.1";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.0.5/cudnn-10.1-linux-x64-v8.0.5.39.tgz";
|
||||||
|
hash = "sha256-kJCElSmIlrM6qVBjo0cfk8NmJ9esAcF9w211xl7qSgA=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.0.5.39";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.0.5/cudnn-10.2-linux-x64-v8.0.5.39.tgz";
|
||||||
|
hash = "sha256-IfhMBcZ78eyFnnfDjM1b8VSWT6HDCPRJlZvkw1bjgvM=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.0.5.39";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
maxCudaVersion = "11.0";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.0.5/cudnn-11.0-linux-x64-v8.0.5.39.tgz";
|
||||||
|
hash = "sha256-ThbueJXetKixwZS4ErpJWG730mkCBRQB03F1EYmKm3M=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.0.5.39";
|
||||||
|
minCudaVersion = "11.1";
|
||||||
|
maxCudaVersion = "11.1";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.0.5/cudnn-11.1-linux-x64-v8.0.5.39.tgz";
|
||||||
|
hash = "sha256-HQRr+nk5navMb2yxUHkYdUQ5RC6gyp4Pvs3URvmwDM4=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.1.1.33";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.1.1/cudnn-10.2-linux-x64-v8.1.1.33.tgz";
|
||||||
|
hash = "sha256-Kkp7mabpv6aQ6xm7QeSVU/KnpJGls6v8rpAOFmxbbr0=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.1.1.33";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
maxCudaVersion = "11.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.1.1/cudnn-11.2-linux-x64-v8.1.1.33.tgz";
|
||||||
|
hash = "sha256-mKh4TpKGLyABjSDCgbMNSgzZUfk2lPZDPM9K6cUCumo=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.2.4.15";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.2.4/cudnn-10.2-linux-x64-v8.2.4.15.tgz";
|
||||||
|
hash = "sha256-0jyUoxFaHHcRamwSfZF1+/WfcjNkN08mo0aZB18yIvE=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.2.4.15";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
maxCudaVersion = "11.4";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.2.4/cudnn-11.4-linux-x64-v8.2.4.15.tgz";
|
||||||
|
hash = "sha256-Dl0t+JC5ln76ZhnaQhMQ2XMjVlp58FoajLm3Fluq0Nc=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.3.3.40";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.3.3/local_installers/10.2/cudnn-linux-x86_64-8.3.3.40_cuda10.2-archive.tar.xz";
|
||||||
|
hash = "sha256-2FVPKzLmKV1fyPOsJeaPlAWLAYyAHaucFD42gS+JJqs=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.3.3.40";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
maxCudaVersion = "11.6";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v8.3.3/local_installers/11.5/cudnn-linux-x86_64-8.3.3.40_cuda11.5-archive.tar.xz";
|
||||||
|
hash = "sha256-6r6Wx1zwPqT1N5iU2RTx+K4UzqsSGYnoSwg22Sf7dzE=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.4.1.50";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.4.1.50_cuda10.2-archive.tar.xz";
|
||||||
|
hash = "sha256-I88qMmU6lIiLVmaPuX7TTbisgTav839mssxUo3lQNjg=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.4.1.50";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
maxCudaVersion = "11.7";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz";
|
||||||
|
hash = "sha256-7JbSN22B/KQr3T1MPXBambKaBlurV/kgVhx2PinGfQE=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.5.0.96";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.5.0.96_cuda10-archive.tar.xz";
|
||||||
|
hash = "sha256-1mzhbbzR40WKkHnQLtJHhg0vYgf7G8a0OBcCwIOkJjM=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.5.0.96";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
maxCudaVersion = "11.7";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz";
|
||||||
|
hash = "sha256-VFSm/ZTwCHKMqumtrZk8ToXvNjAuJrzkO+p9RYpee20=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.6.0.163";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.6.0.163_cuda10-archive.tar.xz";
|
||||||
|
hash = "sha256-t4sr/GrFqqdxu2VhaJQk5K1Xm/0lU4chXG8hVL09R9k=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.6.0.163";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
maxCudaVersion = "11.8";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz";
|
||||||
|
hash = "sha256-u8OW30cpTGV+3AnGAGdNYIyxv8gLgtz0VHBgwhcRFZ4=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.7.0.84";
|
||||||
|
minCudaVersion = "10.2";
|
||||||
|
maxCudaVersion = "10.2";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.7.0.84_cuda10-archive.tar.xz";
|
||||||
|
hash = "sha256-bZhaqc8+GbPV2FQvvbbufd8VnEJgvfkICc2N3/gitRg=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.7.0.84";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
maxCudaVersion = "11.8";
|
||||||
|
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.7.0.84_cuda11-archive.tar.xz";
|
||||||
|
hash = "sha256-l2xMunIzyXrnQAavq1Fyl2MAukD1slCiH4z3H1nJ920=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.8.0.121";
|
||||||
|
minCudaVersion = "11.0";
|
||||||
|
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";
|
||||||
|
hash = "sha256-YgRkdgdtG0VfsT+3izjTSWusr7/bsElPszkiQKBEZuo=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
version = "8.8.0.121";
|
||||||
|
minCudaVersion = "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";
|
||||||
|
hash = "sha256-oHkrZmyq9ZOp3UEwl5V4/Tp4Iw9EB2RcKVcA7456qvI=";
|
||||||
|
}
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user