cudnn_cudatookit_11: add $ORIGIN/ to library RPATHs
Starting with version 8, CuDNN consists of multiple libraries. Libraries (except libcudnn.so) are dlopen()ed on demand. Since the CuDNN library path itself was not added to the rpath of the libraries, use of CuDNN often fails with the following error: Could not load library libcudnn_cnn_train.so.8. Error: libcudnn_ops_train.so.8: cannot open shared object file: No such file or directory Please make sure libcudnn_cnn_train.so.8 is in your library path! This change fixes this by adding $ORIGIN/ to the rpath of all CuDNN libraries.
This commit is contained in:
parent
84786ebecd
commit
8dad19aebe
@ -25,9 +25,12 @@ stdenv.mkDerivation {
|
||||
installPhase = ''
|
||||
function fixRunPath {
|
||||
p=$(patchelf --print-rpath $1)
|
||||
patchelf --set-rpath "$p:${lib.makeLibraryPath [ stdenv.cc.cc ]}" $1
|
||||
patchelf --set-rpath "''${p:+$p:}${lib.makeLibraryPath [ stdenv.cc.cc ]}:\$ORIGIN/" $1
|
||||
}
|
||||
fixRunPath lib64/libcudnn.so
|
||||
|
||||
for lib in lib64/lib*.so; do
|
||||
fixRunPath $lib
|
||||
done
|
||||
|
||||
mkdir -p $out
|
||||
cp -a include $out/include
|
||||
|
Loading…
Reference in New Issue
Block a user