New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory #8

Closed
srepho opened this Issue Mar 20, 2015 · 18 comments

Comments

Projects
None yet
@srepho

srepho commented Mar 20, 2015

I have followed the steps exactly as in your guide using an Amazon AWS GPU instance. When I get to the running of the .\digit-server I get:

Cannot guess value for "caffe_root": caffe binary cannot be found
Cannot guess value for "gpu_list": Cannot query GPUs without a valid caffe_root

I also tried to download the .tar but when I run the ./runme file and I get

ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

Do you have any suggestions about what I am doing wrong?

@lukeyeager

This comment has been minimized.

Show comment
Hide comment
@lukeyeager

lukeyeager Mar 20, 2015

Contributor

Two suggestions:

  1. You should use digits-devserver instead of digits-server. The devserver runs a user-level application, so you don't need root permissions for anything. This will also give you an interactive prompt for setting the configuration options.
  2. Both of your issues seem to be regarding environment variables. You probably need to add these two lines to your .bashrc (but customized to match the installation on your machine, of course):
export CAFFE_ROOT=/home/username/caffe
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
Contributor

lukeyeager commented Mar 20, 2015

Two suggestions:

  1. You should use digits-devserver instead of digits-server. The devserver runs a user-level application, so you don't need root permissions for anything. This will also give you an interactive prompt for setting the configuration options.
  2. Both of your issues seem to be regarding environment variables. You probably need to add these two lines to your .bashrc (but customized to match the installation on your machine, of course):
export CAFFE_ROOT=/home/username/caffe
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
@srepho

This comment has been minimized.

Show comment
Hide comment
@srepho

srepho Mar 21, 2015

Thanks so much - this has solved the issue.

srepho commented Mar 21, 2015

Thanks so much - this has solved the issue.

@Saneesh

This comment has been minimized.

Show comment
Hide comment
@Saneesh

Saneesh Jul 10, 2015

For this error
ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

I have executed this command to solve it
sudo ldconfig /usr/local/cuda/lib64

Saneesh commented Jul 10, 2015

For this error
ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

I have executed this command to solve it
sudo ldconfig /usr/local/cuda/lib64

@lakartoza

This comment has been minimized.

Show comment
Hide comment
@lakartoza

lakartoza Aug 3, 2015

@Saneesh Thank you! Solved mine

lakartoza commented Aug 3, 2015

@Saneesh Thank you! Solved mine

@lukeyeager

This comment has been minimized.

Show comment
Hide comment
@lukeyeager

lukeyeager Jan 14, 2016

Contributor

For those of you on Ubuntu 14.04 who have installed CUDA 7.0 or 7.5 with a .deb package, you can now solve this problem by installing the cuda-ld-conf-7-0 package (or cuda-ld-conf-7-5, if you like).

$ apt-cache show cuda-ld-conf-7-0
Package: cuda-ld-conf-7-0
Depends: cuda-cudart-7-0, cuda-cublas-7-0, cuda-curand-7-0, cuda-license-7-0
Description: CUDA ld.so.conf files
 With this package, your programs will be able to find the CUDA shared
 libraries without editing the LD_LIBRARY_PATH environment variable.

You can follow these instructions to get access to the repository that contains these packages.

Contributor

lukeyeager commented Jan 14, 2016

For those of you on Ubuntu 14.04 who have installed CUDA 7.0 or 7.5 with a .deb package, you can now solve this problem by installing the cuda-ld-conf-7-0 package (or cuda-ld-conf-7-5, if you like).

$ apt-cache show cuda-ld-conf-7-0
Package: cuda-ld-conf-7-0
Depends: cuda-cudart-7-0, cuda-cublas-7-0, cuda-curand-7-0, cuda-license-7-0
Description: CUDA ld.so.conf files
 With this package, your programs will be able to find the CUDA shared
 libraries without editing the LD_LIBRARY_PATH environment variable.

You can follow these instructions to get access to the repository that contains these packages.

@lukeyeager

This comment has been minimized.

Show comment
Hide comment
@lukeyeager

lukeyeager Feb 2, 2016

Contributor

For more information, please see the "Environment" section of docs/InstallCuda.md.

Contributor

lukeyeager commented Feb 2, 2016

For more information, please see the "Environment" section of docs/InstallCuda.md.

@lukeyeager lukeyeager changed the title from ImportError:libcurart.so.7.0: cannot open shared object file: No such file or directory to ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory Mar 10, 2016

@ParitoshParmar

This comment has been minimized.

Show comment
Hide comment
@ParitoshParmar

ParitoshParmar Jul 6, 2016

@Saneesh this is one of those life saving tips. Thanks a ton!

ParitoshParmar commented Jul 6, 2016

@Saneesh this is one of those life saving tips. Thanks a ton!

@ranju2015

This comment has been minimized.

Show comment
Hide comment
@ranju2015

ranju2015 Aug 22, 2016

@Saneesh Many Thanks. Solved my problem.

ranju2015 commented Aug 22, 2016

@Saneesh Many Thanks. Solved my problem.

@NickShargan

This comment has been minimized.

Show comment
Hide comment
@NickShargan

NickShargan Sep 8, 2016

@Saneesh Thanks a lot. When I run sudo ldconfig /usr/local/cuda/lib (not for lib64) it became work.

NickShargan commented Sep 8, 2016

@Saneesh Thanks a lot. When I run sudo ldconfig /usr/local/cuda/lib (not for lib64) it became work.

@chrisranderson

This comment has been minimized.

Show comment
Hide comment
@chrisranderson

chrisranderson Oct 7, 2016

In case someone else runs into this... I got an error (something about libcudnn.so is not a symbolic link or something) when trying ldconfig. My directory looked like this:

screenshot from 2016-10-07 07-38-55

See how the libcudnn.so files are duplicated instead of linked like the others? I deleted the first two, and then made it a chain of symbolic links like so:

sudo rm libcudnn.so
sudo rm libcudnn.so.5
sudo ln -s libcudnn.so.5.0.5 libcudnn.so.5
sudo ln -s libcudnn.so.5 libcudnn.so

I actually came here in search of fixing a TensorFlow problem - this ended up fixing it.

chrisranderson commented Oct 7, 2016

In case someone else runs into this... I got an error (something about libcudnn.so is not a symbolic link or something) when trying ldconfig. My directory looked like this:

screenshot from 2016-10-07 07-38-55

See how the libcudnn.so files are duplicated instead of linked like the others? I deleted the first two, and then made it a chain of symbolic links like so:

sudo rm libcudnn.so
sudo rm libcudnn.so.5
sudo ln -s libcudnn.so.5.0.5 libcudnn.so.5
sudo ln -s libcudnn.so.5 libcudnn.so

I actually came here in search of fixing a TensorFlow problem - this ended up fixing it.

@lukeyeager

This comment has been minimized.

Show comment
Hide comment
@lukeyeager

lukeyeager Oct 10, 2016

Contributor

@chrisranderson if you installed cuDNN with a deb package instead of with a tarball then you wouldn't run into this issue.

Contributor

lukeyeager commented Oct 10, 2016

@chrisranderson if you installed cuDNN with a deb package instead of with a tarball then you wouldn't run into this issue.

@chrisranderson

This comment has been minimized.

Show comment
Hide comment
@chrisranderson

chrisranderson Oct 11, 2016

@lukeyeager how do I do that? (I'm in Ubuntu 16.04 if that matters)

chrisranderson commented Oct 11, 2016

@lukeyeager how do I do that? (I'm in Ubuntu 16.04 if that matters)

@gheinrich

This comment has been minimized.

Show comment
Hide comment
@gheinrich

gheinrich Oct 11, 2016

Contributor

@chrisranderson have a look at the CUDA install doc.

Contributor

gheinrich commented Oct 11, 2016

@chrisranderson have a look at the CUDA install doc.

@xnmp

This comment has been minimized.

Show comment
Hide comment
@xnmp

xnmp Nov 6, 2016

@Saneesh Bloody legend

xnmp commented Nov 6, 2016

@Saneesh Bloody legend

@codeAshu

This comment has been minimized.

Show comment
Hide comment
@codeAshu

codeAshu Dec 13, 2016

Same case is with cuDNN 5.1. Follow the solution of @chrisranderson

codeAshu commented Dec 13, 2016

Same case is with cuDNN 5.1. Follow the solution of @chrisranderson

@amir-shehzad

This comment has been minimized.

Show comment
Hide comment
@amir-shehzad

amir-shehzad Aug 1, 2017

thanks @Saneesh your solution saved my life with matconvnet

amir-shehzad commented Aug 1, 2017

thanks @Saneesh your solution saved my life with matconvnet

@famishedrover

This comment has been minimized.

Show comment
Hide comment
@famishedrover

famishedrover Feb 9, 2018

I have import error: ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory
with CUDA 9.0
Tensorflow 1.5

download https://developer.nvidia.com/rdp/cudnn-download 7.0.5 for cuda 9.0
sudo rm -rf /usr/local/cuda/include/cudnn.h
sudo rm -rf /usr/local/cuda/lib64/libcudnn*

cd
cd cuda

sudo cp include/cudnn.h /usr/local/cuda/include/
sudo cp lib64/lib* /usr/local/cuda/lib64/
cd /usr/local/cuda/lib64/
sudo chmod +r libcudnn.so.7.0.5
sudo ln -sf libcudnn.so.7.0.5 libcudnn.so.7
sudo ln -sf libcudnn.so.7 libcudnn.so
sudo ldconfig
It works for me.

famishedrover commented Feb 9, 2018

I have import error: ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory
with CUDA 9.0
Tensorflow 1.5

download https://developer.nvidia.com/rdp/cudnn-download 7.0.5 for cuda 9.0
sudo rm -rf /usr/local/cuda/include/cudnn.h
sudo rm -rf /usr/local/cuda/lib64/libcudnn*

cd
cd cuda

sudo cp include/cudnn.h /usr/local/cuda/include/
sudo cp lib64/lib* /usr/local/cuda/lib64/
cd /usr/local/cuda/lib64/
sudo chmod +r libcudnn.so.7.0.5
sudo ln -sf libcudnn.so.7.0.5 libcudnn.so.7
sudo ln -sf libcudnn.so.7 libcudnn.so
sudo ldconfig
It works for me.

@SAGGSOC

This comment has been minimized.

Show comment
Hide comment
@SAGGSOC

SAGGSOC Mar 23, 2018

sagar@sagar-HP-Pavilion-Notebook:~/caffe2/caffe2/python/examples$ python char_rnn.py --train_data shakespeare.txt
WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode.
WARNING:root:Debug message: libcudnn.so.7: cannot open shared object file: No such file or directory
Segmentation fault (core dumped)
How to solve this error?

SAGGSOC commented Mar 23, 2018

sagar@sagar-HP-Pavilion-Notebook:~/caffe2/caffe2/python/examples$ python char_rnn.py --train_data shakespeare.txt
WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode.
WARNING:root:Debug message: libcudnn.so.7: cannot open shared object file: No such file or directory
Segmentation fault (core dumped)
How to solve this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment