eba8679bc5
* cudnn*_cudatoolkit*: use NVIDIA mirror instead of requireFile * cudnn_cudatoolkit7: update hash since public mirror is different
51 lines
1.1 KiB
Nix
51 lines
1.1 KiB
Nix
{ version
|
|
, srcName
|
|
, sha256
|
|
}:
|
|
|
|
{ stdenv
|
|
, lib
|
|
, cudatoolkit
|
|
, fetchurl
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "cudatoolkit-${cudatoolkit.majorVersion}-cudnn-${version}";
|
|
|
|
inherit version;
|
|
src = fetchurl {
|
|
# 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}";
|
|
inherit sha256;
|
|
};
|
|
|
|
installPhase = ''
|
|
function fixRunPath {
|
|
p=$(patchelf --print-rpath $1)
|
|
patchelf --set-rpath "$p:${lib.makeLibraryPath [ stdenv.cc.cc ]}" $1
|
|
}
|
|
fixRunPath lib64/libcudnn.so
|
|
|
|
mkdir -p $out
|
|
cp -a include $out/include
|
|
cp -a lib64 $out/lib64
|
|
'';
|
|
|
|
propagatedBuildInputs = [
|
|
cudatoolkit
|
|
];
|
|
|
|
passthru = {
|
|
inherit cudatoolkit;
|
|
majorVersion = lib.head (lib.splitString "." version);
|
|
};
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
|
|
homepage = "https://developer.nvidia.com/cudnn";
|
|
license = licenses.unfree;
|
|
platforms = [ "x86_64-linux" ];
|
|
maintainers = with maintainers; [ mdaiter ];
|
|
};
|
|
}
|