BTW: I get the error only if I try to compile all SDK examples at once from the SDK/C directory. I can compile them separately from the individual directories. I guess that cuda-install is not defined then. So what is -lcuda good for then???
What can I do? I installed Cuda Toolkit 3.0 and the Cuda SDK. And also the latest driver.
There shouldn’t be. libcuda is part of the driver package, not the toolkit. If you are getting libcuda not found errors it means you don’t have a suitable driver package installed.
Are you by any chance using the automatically downloaded “proprietary” driver on Ubuntu? That driver gave me the same issues; downloaded and installed the driver from nVidia, and it worked.
[-]Are you by any chance using the automatically downloaded “proprietary” driver on Ubuntu? That driver gave me the same issues; downloaded and installed the driver from nVidia, and it worked.[/-]
ldconfig settings have no effect on compilation and linking behaviour. If libcuda is in a non-standard place, you will need to point the compiler to that place.
Sorry for the late reply, I had some issues with getting to the forums last few days.
OK, I see what you’re saying, but the question is, where to does the original driver package send libcuda.so to, if not to where the ubuntu package does? I can add symbolic links in the proper places. Can anyone state the location of their installed lib files?
For the drivers from nvidia’s site libcuda.so is in /usr/lib while for the default ubuntu 10.04 driver it’s in /usr/lib/nvidia-current if I’m not mistaking…
I remember encountering a few problems myself when using the ubuntu provided drivers. Fixed it by installing the drivers from nvidia’s site. I’ve outlined some steps to get it working an ubuntu 10.04 in this thread.
Yeah, I was hoping to get it sloved without disabling the apt packages. Too bad Ubuntu decided to make a change like that with this driver version, it worked fine in the previous one. I eventually reverted to installing the latest driver from the NVIDIA .run package.
Thank you for the howto. I actually found it and used it before noticing your reply here Nico.
I managed to get it working without removing the Apt packages, but I did have to hack the makefiles.
Basically, I have both GCC4.3 and GCC4.4 installed. I installed CUDA into /opt/cuda, then created a directory under that (/opt/cuda/gcc43links). In that directory I created two symlinks: ‘gcc’ and ‘g++’ which link to /usr/bin/gcc-4.3 and /usr/bin/g+±4.3 respectively. Then I modified common.mk (watch out, there are two of these: one in NVIDIA_GPU_Computing_SDK/C/common/common.mk, the other in NVIDIA_GPU_Computing_SDK/shared – you need to modify BOTH) to set the GCC4.3 directory as the compiler binpath:
[codebox]# architecture flag for nvcc and gcc compilers build
This makes stuff compile, but libcuda still won’t link, even if it’s on LD_LIBRARY_PATH… we need to fix that. Open up common.mk (both of them!) again, and change this (around ln 269):
[codebox]# static linking, we will statically link against CUDA and CUDART
Well, eventually I just installed the latest driver (now it’s 256.something?) and I’m running like this, with gcc 4.3.something. Works rather well for my needs :)