2016-11-07 03:07:29 -08:00
|
|
|
{ stdenv
|
2017-09-16 21:07:40 -07:00
|
|
|
, lib
|
2016-11-07 03:07:29 -08:00
|
|
|
, requireFile
|
|
|
|
, cudatoolkit
|
2017-09-16 21:07:40 -07:00
|
|
|
, fetchurl
|
2016-11-07 03:07:29 -08:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-09-16 21:07:40 -07:00
|
|
|
version = "7.0";
|
2016-11-07 03:07:29 -08:00
|
|
|
cudatoolkit_version = "8.0";
|
|
|
|
|
|
|
|
name = "cudatoolkit-${cudatoolkit_version}-cudnn-${version}";
|
|
|
|
|
|
|
|
src = requireFile rec {
|
2017-09-16 21:07:40 -07:00
|
|
|
name = "cudnn-${cudatoolkit_version}-linux-x64-v7.tgz";
|
2016-11-07 03:07:29 -08:00
|
|
|
message = ''
|
|
|
|
This nix expression requires that ${name} is already part of the store.
|
|
|
|
Register yourself to NVIDIA Accelerated Computing Developer Program, retrieve the cuDNN library
|
|
|
|
at https://developer.nvidia.com/cudnn, and run the following command in the download directory:
|
|
|
|
nix-prefetch-url file://${name}
|
|
|
|
'';
|
2017-09-16 21:07:40 -07:00
|
|
|
sha256 = "19yjdslrslwv5ic4vgpzb0fa0mqbgi6a66b7gc66vdc9n9589398";
|
2016-11-07 03:07:29 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
function fixRunPath {
|
|
|
|
p=$(patchelf --print-rpath $1)
|
2017-09-16 21:07:40 -07:00
|
|
|
patchelf --set-rpath "$p:${lib.makeLibraryPath [ stdenv.cc.cc ]}" $1
|
2016-11-07 03:07:29 -08:00
|
|
|
}
|
|
|
|
fixRunPath lib64/libcudnn.so
|
|
|
|
|
|
|
|
mkdir -p $out
|
|
|
|
cp -a include $out/include
|
|
|
|
cp -a lib64 $out/lib64
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cudatoolkit
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
|
2017-09-16 21:07:40 -07:00
|
|
|
homepage = "https://developer.nvidia.com/cudnn";
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2016-11-07 03:07:29 -08:00
|
|
|
maintainers = with maintainers; [ mdaiter ];
|
|
|
|
};
|
|
|
|
}
|