Why can't libcudart.so.4 be found when compiling the CUDA samples under Ubuntu?

Alex picture Alex · May 30, 2012 · Viewed 38.7k times · Source

I'm trying to get my Cuda SDK samples running, but I get the following error:

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

Why can I compile the example successfully, but not run it? Is there a way to specify the path to the CUDA runtime library manually?

Answer

Edgar picture Edgar · Oct 2, 2012

try:

32-bit: sudo ldconfig /usr/local/cuda/lib

64-bit: sudo ldconfig /usr/local/cuda/lib64

cheers