error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file o

Hi,

I am trying to execute MPI and CUDA code on a cluster. The code works fine on single machine but when I try to execute it on cluster I get error:

error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory

I checked my PATH and LD_PATH and it looks ok. I have a .bashrc file which contains following entries -

export PATH=$PATH:/usr/local/lib/:/usr/local/lib/openmpi:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib/openmpi/:/usr/local/cuda/lib/:

All the machines haves same installation of CUDA and OpenMPI.

Can anyone help me with this. This problem is really annoying.

Thanks.

Hi,
Not sure if it’s a typo, but there is a with space in your LD_LIBRARY_PATH definition… Better checking.

There is no space. its just a type :)

I have solved the issue.

Now I use mpirun -x LD_LIBRARY_PATH… to execute the job and everything works like a charm :)

I tried running my MPI + CUDA code by using -x LD_LIBRARY_PATH, but it’s still giving me error while loading shared libraries: libcudart.so.3: cannot open shared object file: No such file or directory .

I ran via terminal: mpirun -machinefile machines -x /usr/local/cuda/lib64 -np 6 ./mpicuda

I have no idea what is wrong with it.

Thanks in advance.

My bad, right now it is working fine. mpirun -machinefile machines -x LD_LIBRARY_PATH -np 6 ./mpicuda

Hi c0mrade,

I am facing the same issue

error while loading shared libraries: libcudart.so.6.0: cannot open shared object file: No such file or directory

Requesting your assistance for resolution.

If you could post a step by step instruction that would be really helpful

You need to set your LD_LIBRARY_PATH environment variable correctly.

How to do this is covered in the linux getting started guide:

http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#environment-setup

The above document refers to CUDA 6.5, but the changes for CUDA 6.0 are similar. You can locate a similar document for cuda 6.0 in the doc directory of your cuda install.