cannot find -lcuda on Ubuntu 11.04


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 on line 278, without effect.

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


Depending on what drivers you have installed, the 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/ /usr/lib/

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

Hope this helps,



Arguably the safer option is adding


to you linker flags. In the case of the CUDA SDK change to

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