how to find the path for libcudart.so?

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-toolkit

and 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 found

How can I solve this?

1

3 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.

2

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-cuda

What it does:

  1. Download and installs the Lambda Stack Repository (essentially adds a file to /etc/apt/sources.list.d/)
  2. Updates apt and installs the lambda-stack-cuda package.
  3. 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_PATH or PATH as the shared libraries are placed in directories that ld already checks at link time.
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like