Hi!
I’m new to programming under Linux
I have a lot of trouble trying to compile the SDK sample programs under Ubuntu 10.04. I downgraded GCC to 4.3 and added : NVCCFLAGS += --compiler-bindir=/usr/bin/gcc-4.3 to the common.mk file… well, it seems to work better than 4.4!
But the make still doesn’t work. It returns ‘Cannot find -lcuda’. I searched for libcuda.so and found it in /usr/lib64/nvidia-current/…
When I upgraded to ubuntu 10.04, I found that the nvidia-current drivers were not really suitable for cuda development.
After installing the binary drivers from nvidia’s download page, everything ran smoothly.
Thanks for your answers but I am using the drivers from Nvidia website directly.
One more things I’ve just noticed : it works fine up to ptxjit… (i can run deviceQuery, oceanFFT, fluidsGL…)
So i tried with a simple Hello Cuda World!… This time it said me that it couldn’t find ‘-lcutil_x86_64’ even if i add the SDK path into LD_LIBRARY_PATH and even if i modify the file nvcc.profile!
There’s a misconception as to what LD_LIBRARY_PATH does: it only affects where the loader looks at runtime. However, it does not influence where the compiler is looking for libraries at compile time.
Problem: In current releases of the nvidia driver libcuda is located in /usr/lib/nvidia-current, which is the cause of this error.
Solution: Add -L/usr/lib/nvidia-current to your compiler flags.
There’s no need to manually install the nvidia drivers, recent ubuntu packaged drivers are fine.
If you’ll look down about 8 or 10 threads, you’ll find one with the same title that goes into the issue in some detail. Basically, the SDK installs libcudart.so.x in /usr/local/cuda/lib{64}, while the driver installs libcuda.so.x in some other place. So if you want to compile & link code on a machine that doesn’t have an NVidia card installed (as is the case with my laptop), you can link with -lcudart and produce an executable.