"cannot find -lcuda"

I have installed Cuda Toolkit Beta 1.1 and SDK 1.1 and added path to cuda/bin and cuda/lib but when I try to compile examples from SDK following error appear:

ar: creating ./../lib/libcutil.a

a - obj/release/bank_checker.cpp_o

a - obj/release/cmd_arg_reader.cpp_o

a - obj/release/cutil.cpp_o

a - obj/release/stopwatch.cpp_o

a - obj/release/stopwatch_linux.cpp_o

a - obj/release/multithreading.cpp_o

make[1]: Leaving directory `/home/zoo/NVIDIA_CUDA_SDK/common'

make[1]: Entering directory `/home/zoo/NVIDIA_CUDA_SDK/common'

a - obj/release/paramgl.cpp_o

a - obj/release/param.cpp_o

make[1]: Leaving directory `/home/zoo/NVIDIA_CUDA_SDK/common'

make -C projects/asyncAPI/

make[1]: Entering directory `/home/zoo/NVIDIA_CUDA_SDK/projects/asyncAPI'

/usr/bin/ld: cannot find -lcuda

collect2: ld returned 1 exit status

make[1]: *** [../../bin/linux/release/asyncAPI] Error 1

make[1]: Leaving directory `/home/zoo/NVIDIA_CUDA_SDK/projects/asyncAPI'

make: *** [projects/asyncAPI/Makefile.ph_build] Error 2

I am compiling this on Ubuntu 7.10 if this matter. Any suggestions?

I’m afraid that Ubuntu-7.10 is not a supported environment for CUDA, however I suspect the issue here is that you either did not install the 169.01 display driver (which includes libcuda.so), or the SDK apps cannot find libcuda.so on your system.

You’ll need to determine where libcuda.so got installed on Ubuntu-7.10 and make sure that its in your library search path (either via /etc/ld.so.conf or explicitly from setting LD_LIBRARY_PATH).

Humm, probably this is the case.
My driver version is 100.14.19 and Cuda 1.0 runs ok but not 1.1.
Can I get libcuda.so separately?

If you want to use the CUDA 1.1 toolkit, you have to update to the new ver 169 driver. libcuda.so has been moved from the toolkit package to the driver package. (As I learned yesterday from a helpful NVIDIA dev via the bug database…) Once you install the new driver, you will find it in either /usr/lib or /usr/lib64, depending on your platform.

Hi,
I had the same problem on Gutsy. The reason was that the file /usr/lib/libcude.so was missing. So I did:

cd /usr/lib
sudo ln -s libcuda.so.1 libcuda.so

that was it
milos

Thanks for the help milossramek. Your tip fixed up my Ubuntu 7.10 CUDA VM. Cheers!

I got a similar problem - in my case most of the examples do build, however the two *Drv projects result in the above mentioned error. When trying to execute any of the built files, all of them report that there is no device supporting CUDA.

I’m using the 169.12 driver with CUDA Toolkit and SDK v1.1 on an 8600M GT device. The .so files were originally in the Toolkit directory, yet copying them to /usr/lib didn’t solve the problem.

Any hints?

tia,
qx

Hello all,

I have got the same problem. Some examples compile but than this happens:

make[1]: Entering directory `/opt/NVIDIA_CUDA_SDK/projects/matrixMulDrv'

/usr/bin/ld: cannot find -lcuda

collect2: ld gab 1 als Ende-Status zurück

make[1]: *** [../../bin/linux/release/matrixMulDrv] Fehler 1

make[1]: Leaving directory `/opt/NVIDIA_CUDA_SDK/projects/matrixMulDrv'

make: *** [projects/matrixMulDrv/Makefile.ph_build] Fehler 2

I checked my ldconfig and there it is so I do not understand why the linker cannot find the lib.

libcuda.so.1 (libc6,x86-64) => /usr/lib64/nvidia/libcuda.so.1

libcuda.so (libc6,x86-64) => /usr/lib64/nvidia/libcuda.so

I am using the driver version 169.09

Thank you for your help.

Markus

Is that version already supporting CUDA 1.1 I thought that 169.12 was supporting 1.1 and not .09

As I understand the message above CUDA 1.1 is supported since 169.01 but maybe I missunderstood this?

Hi, I am also having problems with the *Drv versions returning the error cannot find -lcuda".

I’m running Fedora 9 with the Nvida driver 173.14.05. and the following locations containing libcuda files.

/usr/lib/nvidia/libcuda.so
/usr/lib/nvidia/libcuda.so.1
/usr/lib/nvidia/libcuda.so.173.14.05

This directory is on the LD_LIBRARY_PATH

Any suggestions about how to overcome this would be much appreciated.

Daniel

Where are you seeing this error? How can this be reproduced?

Have you found how to solve this? I’m getting the same error!
Thanks.

Hi,

I see this error whenever I try and run the makefiles for the SDK for, either, the specific *Drv project, or the main makefile for all the projects. By renaming the the makefiles in the two *Drv projects so that they are ignored I am able to compile and run all of the other projects.

Daniel

HI everyone,

I was looking in the forum for the solution for this problem. I just found this topic. I’ve got the same problem related here, but I have not found any solution.

Can anybody help?

Thanks. :blink:

Are you 100% certain that you actually have installed a driver package version which includes the CUDA support libraries and libcuda.so exists?

Hi avidday,

Yes I have. Could you anwser me if the CUDA driver for Ubuntu 8.10 works with Ubuntu 9.04?

Another thing. libcuda.so is in my system, I check it out, but the CUDA Release notes tell me that I need to set the variable system

LD_LIBRARY_PATH=<CUDA_INSTALL_PATH>/lib

. I did it, the problem is that variable wasn’t there. Is there something wrong?

Thanks

Hi,

I finally found the problem. It is just a miss reference to the file libcuda.so.

Thanks