how to find the path for libcudart.so?

37,364

Solution 1

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

Solution 2

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/bin This will set environmental path.

Solution 3

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} https://lambdal.com/static/files/lambda-stack-repo.deb && \
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.
Share:
37,364

Related videos on Youtube

iamgr007
Author by

iamgr007

by day: a daydreamer By night : a werewolf i love playing music and football.

Updated on September 18, 2022

Comments

  • iamgr007
    iamgr007 over 1 year

    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?

  • Gabriel Fair
    Gabriel Fair over 5 years
    Thanks, I noticed that Lambda Stack doesn't set the the LD_LIBRARY_PATH and CUDA_HOME environment variables. Any reason why the installer doesn't do this?
  • sabalaba
    sabalaba over 5 years
    It’s because we properly place the library .so files in locations where ‘ld’ already looks.
  • Asad-ullah Khan
    Asad-ullah Khan over 4 years
    this is definitely the right answer. note that the path /usr/local/cuda is potentially optional with some nvidia installers, so if you dont have that path, just use /usr/local/cuda-10.0
  • chovy
    chovy over 3 years
    i don't havef any of these paths