cudnn_cudatoolkit: accept hash
attribute for SRI hashes
This commit is contained in:
parent
8bd4d8ee66
commit
7475b12169
@ -58,7 +58,7 @@ in rec {
|
|||||||
# 8.1.0 is compatible with CUDA 11.0, 11.1, and 11.2:
|
# 8.1.0 is compatible with CUDA 11.0, 11.1, and 11.2:
|
||||||
# https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html#cudnn-cuda-hardware-versions
|
# https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html#cudnn-cuda-hardware-versions
|
||||||
srcName = "cudnn-11.2-linux-x64-v8.1.1.33.tgz";
|
srcName = "cudnn-11.2-linux-x64-v8.1.1.33.tgz";
|
||||||
sha256 = "sha256-mKh4TpKGLyABjSDCgbMNSgzZUfk2lPZDPM9K6cUCumo=";
|
hash = "sha256-mKh4TpKGLyABjSDCgbMNSgzZUfk2lPZDPM9K6cUCumo=";
|
||||||
};
|
};
|
||||||
|
|
||||||
cudnn_cudatoolkit_11_1 = cudnn_cudatoolkit_11_0.override {
|
cudnn_cudatoolkit_11_1 = cudnn_cudatoolkit_11_0.override {
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
{ version
|
{ version
|
||||||
, srcName
|
, srcName
|
||||||
, sha256
|
, hash ? null
|
||||||
|
, sha256 ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (hash != null) || (sha256 != null);
|
||||||
|
|
||||||
{ stdenv
|
{ stdenv
|
||||||
, lib
|
, lib
|
||||||
, cudatoolkit
|
, cudatoolkit
|
||||||
@ -22,11 +25,13 @@ stdenv.mkDerivation {
|
|||||||
name = "cudatoolkit-${cudatoolkit.majorVersion}-cudnn-${version}";
|
name = "cudatoolkit-${cudatoolkit.majorVersion}-cudnn-${version}";
|
||||||
|
|
||||||
inherit version;
|
inherit version;
|
||||||
src = fetchurl {
|
|
||||||
|
src = let
|
||||||
|
hash_ = if hash != null then { inherit hash; } else { inherit sha256; };
|
||||||
|
in fetchurl ({
|
||||||
# URL from NVIDIA docker containers: https://gitlab.com/nvidia/cuda/blob/centos7/7.0/runtime/cudnn4/Dockerfile
|
# URL from NVIDIA docker containers: https://gitlab.com/nvidia/cuda/blob/centos7/7.0/runtime/cudnn4/Dockerfile
|
||||||
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v${version}/${srcName}";
|
url = "https://developer.download.nvidia.com/compute/redist/cudnn/v${version}/${srcName}";
|
||||||
inherit sha256;
|
} // hash_);
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ addOpenGLRunpath ];
|
nativeBuildInputs = [ addOpenGLRunpath ];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user