rstudio / tensorflow

TensorFlow for R
https://tensorflow.rstudio.com
Apache License 2.0
1.33k stars 321 forks source link

`LD_LIBRARY_PATH` must include cudnn entry to use GPUs beginning with TF 2.12 #569

Closed t-kalinowski closed 1 year ago

t-kalinowski commented 1 year ago

Beginning with TF 2.12, cudnn can now be provided via a pip package that contains libcudnn.so.8. Unfortunately, TF cannot find it if it's not on the LD_LIBRARY_PATH.

https://pypi.org/project/nvidia-cudnn-cu11/

Upstream docs indicate this is the new recommended approach:

pip install nvidia-cudnn-cu11==8.6.0.163
CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib

We will have to include hooks in the R package to add these entries to LD_LIBRARY_PATH.