I’ve got a new machine, and trying to build the code examples in the SDK. The build doesn’t get very far.
It err’s at the device query project.
The linker can’t find a library, and I’m not sure why.
The paths are setup as described in the install doc’s.
~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release$ ldconfig -v | grep cuda /sbin/ldconfig.real: Path /lib/x86_64-linux-gnu' given more than once /sbin/ldconfig.real: Path /usr/lib/x86_64-linux-gnu’ given more than once
/usr/local/cuda/lib64:
libcudart.so.4 → libcudart.so.4.1.28
/usr/local/cuda/lib:
libcudart.so.4 → libcudart.so.4.1.28 libcuda.so.1 → libcuda.so.295.20
libcuda.so.1 → libcuda.so.295.20
libicudata.so.44 → libicudata.so.44.2
~/NVIDIA_GPU_Computing_SDK/C/src/deviceQuery$ make /usr/bin/ld: cannot find -lcuda
collect2: ld returned 1 exit status
make: *** […/…/bin/linux/release/deviceQuery] Error 1
From the projects makefile:
(The line causing the problem.) LIB += -lcuda
I’m not sure where in the make environment that LIB is created.
I’m not sure where the libcuda.so files are located, but they are in the ldconfig. (see above)
I tried it with the LD_LIBRARY_PATH environment var as well and got the same err.
Hi, I met nearly the same problem and troubled me both when I want to compile the gpu SDK samples and pyCUDA. However I just solved it.
The brief profile of my computer and os is listed below:
OS : Fedora 16
GPU: GeForce GTX550Ti
DRV: yum installed the akmod-nvidia driver, and banned the nouveau driver came from Fedora
CUDAToolkit : Latest Verson
When I came to the procedure of compiling SDK samples, it would exit with error : “/usr/bin/ld: cannot find -lcuda”, the same thing happend when
I just want to compile and install pyCUDA package. However I could find libcuda.so libcuda.so.1 in path /usr/lib64/nvidia/.
Thanks, that did it. (Looking for the library in a different location.)
The libraries are in the “nvidia-current” folder, but the linker is looking in the “lib” folder.
Make a symbolic link in the “lib” folder that points to the “nvidia-current” folder:
sudo ln -s /usr/lib/nvidia-current/libcuda.so /usr/lib/libcuda.so && ln -s /usr/lib/nvidia-current/libcuda.so.1 /usr/lib/libcuda/so.1
son of devil google. ‘/usr/bin/ld: cannot find lcuda’ search gave me link to all 3 threads i made for pycuda installtion error. But, didn’t brought me here. I have wandered a lot. This is a useful thread.