diff options
author | Ambroz Bizjak <abizjak.pro@gmail.com> | 2019-05-22 18:34:09 +0200 |
---|---|---|
committer | Ambroz Bizjak <abizjak.pro@gmail.com> | 2019-05-22 18:34:09 +0200 |
commit | 28a09189166c767ad284adb9f7e137a3f98546a4 (patch) | |
tree | 4e030517ae2c5d5e48cb1b97bbd3b4244e4248e7 /pkgs/development/libraries/science/math/cudnn | |
parent | 1860e506e7f2fd66982929cfb75ec83b0a586acb (diff) |
Add driver library path to some packages to find CUDA libraries.
This is to avoid relying on LD_LIBRARY_PATH for finding the CUDA driver libraries.
Diffstat (limited to 'pkgs/development/libraries/science/math/cudnn')
-rw-r--r-- | pkgs/development/libraries/science/math/cudnn/generic.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/development/libraries/science/math/cudnn/generic.nix b/pkgs/development/libraries/science/math/cudnn/generic.nix index bb1258655b5b..3c448abeccf6 100644 --- a/pkgs/development/libraries/science/math/cudnn/generic.nix +++ b/pkgs/development/libraries/science/math/cudnn/generic.nix @@ -7,6 +7,7 @@ , lib , cudatoolkit , fetchurl +, addOpenGLRunpath }: stdenv.mkDerivation rec { @@ -19,6 +20,8 @@ stdenv.mkDerivation rec { inherit sha256; }; + nativeBuildInputs = [ addOpenGLRunpath ]; + installPhase = '' function fixRunPath { p=$(patchelf --print-rpath $1) @@ -31,6 +34,12 @@ stdenv.mkDerivation rec { cp -a lib64 $out/lib64 ''; + # Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found. + # See the explanation in addOpenGLRunpath. + postFixup = '' + addOpenGLRunpath $out/lib/lib*.so + ''; + propagatedBuildInputs = [ cudatoolkit ]; |