cannot find -lcuda on Ubuntu 11.04

Hi,

I have Ubuntu 11.04 64 bit installed and wanted to try cuda using pycuda.

I tried making the example files of the NVIDIA SDK… I think I installed everything that is necessary, even gcc4.4. But when I type make, it keeps saying, “cannot find -lcuda”. I also tried adding this line in common.mk on line 278, without effect.

What am I missing… what information do you need in order to suggest something helpfull?
Thx.

Hi,

Depending on what drivers you have installed, the libcuda.so and so.1 files will be located in slightly different places in Ubuntu. For example, /usr/lib/nvidia-current or /usr/lib/nvidia-current-updates on 11.10 (you should be able to find them at any rate.) The easiest way to point the compiler to the correct libs (IMO) is to symlink them from a more obvious location:

sudo ln -s /usr/lib/nvidia-location/libcuda.so /usr/lib/libcuda.so

sudo ln -s /usr/lib/nvidia-location/libcuda.so1 /usr/lib/libcuda.so1

Hope this helps,

Best,

Graham

Arguably the safer option is adding

-L/usr/lib/nvidia-current

to you linker flags. In the case of the CUDA SDK change common.mk:148 to

LINKFLAGS += -L/usr/lib/nvidia-current