I'm trying to install Tensorflow GPU version and I'm stuck at this. I've installed nvidia-cuda-toolkit by running
sudo apt install nvidia-cuda-toolkitand it downloaded fine. But i'm unable to locate this libcudart.so
Please specify which gcc nvcc should use as the host compiler. [Default is /usr/bin/gcc]: /usr/bin/gcc
Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty to use system default]:
Please specify the location where CUDA toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: /usr/local/cuda
Invalid path to CUDA toolkit. /usr/local/cuda/lib64/libcudart.so cannot be foundHow can I solve this?
13 Answers
Not sure if it is the best way but I had the same issue and this helped.
sudo ln -s /usr/local/cuda/lib64 /usr
Verify the link from /usr with ls -l lib64
lib64 -> /usr/local/cuda/lib64
It seems that, you have exported wrong path.
So, On terminal type: sudo ldconfig /usr/local/cuda/lib64
ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line
If this don't work try: export PATH=$PATH:/usr/local/cuda/binThis will set environmental path.
If you're using Ubuntu 16.04 or Ubuntu 18.04 and want to get TensorFlow with GPU support installed, there is a deb package for that in the Lambda Stack repository.
You can install the repository and the package with this line:
LAMBDA_REPO=$(mktemp) && \
wget -O${LAMBDA_REPO} && \
sudo dpkg -i ${LAMBDA_REPO} && rm -f ${LAMBDA_REPO} && \
sudo apt-get update && sudo apt-get install -y lambda-stack-cudaWhat it does:
- Download and installs the Lambda Stack Repository (essentially adds a file to /etc/apt/sources.list.d/)
- Updates apt and installs the
lambda-stack-cudapackage. - Installs CUDA, Drivers, CuDNN, and TensorFlow with CuDNN and GPU support into the proper system level directories. You won't need to modify your
LD_LIBRARY_PATHorPATHas the shared libraries are placed in directories thatldalready checks at link time.