Error cannot load shared file libcudart.so.3 where is libcudart.so.3

A work colleague of mine used make to rebuild and link all of the example file in the CUDA 3.0 SDK. I assume it went or without incident.

He then tried to run on of the programs and got the following response.

root@fermi:/home/errol/NVIDIA_GPU_Computing_SDK/C/bin/linux/release# ./BlackScholes
./BlackScholes: error while loading shared libraries: libcudart.so.3: cannot open shared object file: No such file or directory
root@fermi:/home/errol/NVIDIA_GPU_Computing_SDK/C/bin/linux/release# ./MatrixMul
bash: ./MatrixMul: No such file or directory
root@fermi:/home/errol/NVIDIA_GPU_Computing_SDK/C/bin/linux/release# ./matrixMul
./matrixMul: error while loading shared libraries: libcudart.so.3: cannot open shared object file: No such file or directory
root@fermi:/home/errol/NVIDIA_GPU_Computing_SDK/C/bin/linux/release#

Now I know how to do this by command line, I am still learning using makefile. I can run make and when I last did it a few weeks ago, everything was fine.

I am not sure what is going on, but it seems not to be able to access libcudart.so.3. I cannot easily find it on my remote access. I am guessing the path has changed - hence no libcudart.so.3 is found.

Where is this file libcudart.so.3?

Is that the error here?

Newport_j

libcudart.so is the cuda runtime library. It will be wherever the CUDA 3.0 toolkit is installed, in either lib or lib64 depending on the architecture.

This is one time when setting LD_LIBRARY_PATH to something appropriate would actually help solve your problems.

I belieive that I can answer my own question.

libcudart.so.3 resides in

libcudart.so.3

/usr/local/cuda/lib/

A echo LD_LIBRARY_PATH revealed nothing - no path at all.

So it is not finding that library file because the LD_LIBARY_PATH is showing no path at all.

I guess that I should modify the question as to why the LD_LIBRARY_PATH change from /usr/local/cuda/lib/ to nothing.

When the system boots up it usually has this path correct, but now…

What happened to the path?

Newport_j

It is an environment variable and environment variables aren’t permanent. They have the life of the shell they are defined in. If you don’t do something to set it every time a new shell starts (like put it in your .bashrc file for example), it will never be set.

We got the LD_LIBRARY_PATH path back, when he rebooted. Doesn’t that mean that it is set in the .bashrc file?

Newport_j

Possibly. Why don’t you just look in the file and see?

I’m having the same problem. Have you made any progress?

I’m having the same problem. Have you made any progress?

Hi! I had the same problem. I overcame it by adding in the .bashrc file

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib
for 32bit system, or

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
for 64bit system.

G.

~/.bashrc stores bash-related settings. You can add “export LD_LIBRARY_PATH = /pathtoyourlib” to .bashrc, or follow this to set LD_LIBARY_PATH:

1. Set LD_LIBRARY_PATH:

gksudo gedit /etc/ld.so.conf.d/cuda.conf (creates a new file).

2. Paste into the file:

/usr/local/cuda/lib64

/usr/local/cuda/lib

Save and quit the editor.

3. Reload LD_LIBRARY_PATH:

sudo ldconfig

Credit goes to ThomasArildsen@ubuntuforums (Howto: Install Nvidia CUDA in Ubuntu 10.04)

ohh yes, this was very helpful for me. Thank you. I changed my LD_LIBRARY_PATH from “lib64” to “lib”. then it worked. This lib name may be depend on your driver version. You can find out what is it? looking at /usr/local/cuda

thank you

Hi, I need your help, i test the solution proposed but nothing, in matlab when I run the program DeepPyramid demo show me the next error caffe.mexa64: libcudart.so.6.5:cannot open shared object file, i try to copy libcudart.so.6.5 in the same folder of caffe.mexa64, but I have the same problem. I dont know what happen.

Thank you