Issue
I've spent an entire day on StackOverflow and the Tensorflow Github issues page trying to fix this, but still can't seem to resolve the problem, suggesting there's something obvious I'm missing.
I'm trying to get Tensorflow with GPU support running within RStudio on Ubuntu LTS 20.04. I've followed the RStudio installation instructions with Nvidia drivers 470, CUDA 11.2, and cuDDN 8.1.0, updated ~/.bashrc
to point at
export CUDA_HOME=/usr/local/cuda
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH=/usr/lib/cuda/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib/cuda/include:$LD_LIBRARY_PATH
and installed TF with GPU support via install_keras(tensorflow = "gpu")
, yet still getting the dreaded error:
W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/nickopotamus/.local/share/r-miniconda/envs/r-reticulate/lib:/usr/lib/R/lib::/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/jvm/default-java/lib/server
sudo find / -name 'libcudart.so.11.0'
finds the file in:
/home/nickopotamus/.local/share/r-miniconda/envs/r-reticulate/lib/libcudart.so.11.0
/home/nickopotamus/anaconda3/pkgs/cudatoolkit-11.3.1-h2bc3f7f_2/lib/libcudart.so.11.0
/home/nickopotamus/anaconda3/pkgs/cudatoolkit-11.2.0-h73cb219_8/lib/libcudart.so.11.0
/home/nickopotamus/anaconda3/pkgs/cudatoolkit-11.2.72-h2bc3f7f_0/lib/libcudart.so.11.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudart.so.11.0
The top entry at least appears to be in the path that the error is searching, so I'm at a bit of a loss as to what to try next. Is it a conflict with the other anaconda packages (which I can't seem to remove), or am I simply being oblivious to a quick-fix?
Edit: Solved by using the NVIDIA Data Science Stack to install everything from scratch.
Solution
Not a particularly satisfying answer, but solved by removing all NVIDIA packages and installing the NVIDIA Data Science Stack from scratch, then using its Conda environment to run keras
in R.
Answered By - Nickopotamus