Cannot find libcuda.so.1

I am using CUDA Toolkit 9.1.85 in an HPC environment. I am encountering this issue:

$ nvcc -o foo -lcuda foo.c
$ ./foo
./foo: error while loading shared libraries: libcuda.so.1: cannot open shared object file: No such file or directory

Indeed I cannot locate libcuda.so.1. On normal installations, is this file usually a link to libcuda.so (which I can find, and is in my linker path)? What path does it live at?

The HPC system uses “modules” to install the CUDA Toolkit in a different directory, but I wouldn’t expect any files to be missing.

Hi @rgov,

It seems that the LD_LIBRARY_PATH is not configured properly. Did you load the module? Depending on the HPC facility, it is like module load cuda. You can search the proper module name by running module search cuda. It would be helpful to show us the LD_LIBRARY_PATH before and after loading the module to see if this variable is being modified properly.

Regards,
Leon.

Thanks Leon. Loading the CUDA Toolkit module prepends these directories to my LD_LIBRARY_PATH:

/cm/shared/apps/cuda91/toolkit/9.1.85/extras/CUPTI/lib64
/cm/local/apps/cuda/libs/current/lib64
/cm/shared/apps/cuda91/toolkit/9.1.85/lib64

I think I’ve resolved the problem. I could not build on the login node, I had to build on the GPU node. On these nodes the libcuda.so.1 resolves to /cm/local/apps/cuda/libs/current/lib64/libcuda.so.1 which is not available on the login node.

1 Like