CUDA 3.2 on Ubuntu 11.04 Natty Narwhal

hello,

as it cost me some time to get it run, here a brief description:

First install following packages from from ubuntu repository.
nvidia-current
freeglut3-dev
gcc-4.5
g+±4.4

run:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 150
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g+±4.5 150
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g+±4.4 100

next:
sudo update-alternatives --config gcc
choose gcc-4.4
sudo update-alternatives --config g++
choose g+±4.4

Then install the cuda toolkit 3.2 and GPU Computing SDK code samples from http://developer.nvidia.com/object/cuda_3_2_downloads.html
CUDA Toolkit for Ubuntu Linux 10.04
GPU Computing SDK code samples

now create following sym links:
ln -s /usr/lib/nvidia-current/libcuda.so /usr/lib/libcuda.so
ln -s /usr/lib/nvidia-current/libGL.so /usr/lib/libGL.so

afterwards make in NVIDIA_GPU_Computing_SDK/C should run without any errors.

hope that may help.

Hello, I installed CUDA in ubuntu 11.04 according to your guide … When I try to make the SDK I get the following error

make
make[1]: Entering directory /home/praveen/NVIDIA_GPU_Computing_SDK/C/common' In file included from src/bank_checker.cpp:15:0: ./../common/inc/bank_checker.h:34:41: warning: type qualifiers ignored on function return type ./../common/inc/bank_checker.h:220:39: warning: type qualifiers ignored on function return type src/bank_checker.cpp:57:24: warning: type qualifiers ignored on function return type src/bank_checker.cpp:259:12: warning: type qualifiers ignored on function return type In file included from ./../common/inc/stopwatch.h:18:0, from src/cutil.cpp:33: ./../common/inc/stopwatch_base.h:56:34: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_base.h:60:41: warning: type qualifiers ignored on function return type In file included from ./../common/inc/stopwatch_base.h:72:0, from ./../common/inc/stopwatch.h:18, from src/cutil.cpp:33: ./../common/inc/stopwatch_base.inl:67:36: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_base.inl:78:43: warning: type qualifiers ignored on function return type In file included from ./../common/inc/stopwatch.h:25:0, from src/cutil.cpp:33: ./../common/inc/stopwatch_linux.h:46:34: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:50:41: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:126:27: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:143:34: warning: type qualifiers ignored on function return type In file included from src/cutil.cpp:33:0: ./../common/inc/stopwatch.h:35:27: warning: type qualifiers ignored on function return type In file included from src/cutil.cpp:34:0: ./../common/inc/bank_checker.h:34:41: warning: type qualifiers ignored on function return type ./../common/inc/bank_checker.h:220:39: warning: type qualifiers ignored on function return type In file included from ./../common/inc/stopwatch.h:18:0, from src/stopwatch.cpp:17: ./../common/inc/stopwatch_base.h:56:34: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_base.h:60:41: warning: type qualifiers ignored on function return type In file included from ./../common/inc/stopwatch_base.h:72:0, from ./../common/inc/stopwatch.h:18, from src/stopwatch.cpp:17: ./../common/inc/stopwatch_base.inl:67:36: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_base.inl:78:43: warning: type qualifiers ignored on function return type In file included from ./../common/inc/stopwatch.h:25:0, from src/stopwatch.cpp:17: ./../common/inc/stopwatch_linux.h:46:34: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:50:41: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:126:27: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:143:34: warning: type qualifiers ignored on function return type In file included from src/stopwatch.cpp:17:0: ./../common/inc/stopwatch.h:35:27: warning: type qualifiers ignored on function return type src/stopwatch.cpp:71:12: warning: type qualifiers ignored on function return type In file included from src/stopwatch_linux.cpp:15:0: ./../common/inc/stopwatch_linux.h:46:34: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:50:41: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:126:27: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:143:34: warning: type qualifiers ignored on function return type a - obj/i386/release/bank_checker.cpp.o a - obj/i386/release/cmd_arg_reader.cpp.o a - obj/i386/release/cutil.cpp.o a - obj/i386/release/stopwatch.cpp.o a - obj/i386/release/stopwatch_linux.cpp.o a - obj/i386/release/multithreading.cpp.o make[1]: Leaving directory /home/praveen/NVIDIA_GPU_Computing_SDK/C/common’
make[1]: Entering directory /home/praveen/NVIDIA_GPU_Computing_SDK/C/common' make[1]: Leaving directory /home/praveen/NVIDIA_GPU_Computing_SDK/C/common’
make[1]: Entering directory /home/praveen/NVIDIA_GPU_Computing_SDK/C/common' make[1]: Leaving directory /home/praveen/NVIDIA_GPU_Computing_SDK/C/common’
make[1]: Entering directory /home/praveen/NVIDIA_GPU_Computing_SDK/shared' make[1]: Leaving directory /home/praveen/NVIDIA_GPU_Computing_SDK/shared’
make -C src/oceanFFT/
make[1]: Entering directory /home/praveen/NVIDIA_GPU_Computing_SDK/C/src/oceanFFT' In file included from oceanFFT.cpp:38:0: /usr/local/cuda/include/cuda_runtime.h:145:40: warning: unused parameter ‘flags’ oceanFFT.cpp: In function ‘int attachShader(GLuint, GLenum, const char*)’: oceanFFT.cpp:869:39: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result /usr/bin/ld: warning: libnvidia-tls.so.270.41.06, needed by /usr/lib/libGL.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libnvidia-glcore.so.270.41.06, needed by /usr/lib/libGL.so, not found (try using -rpath or -rpath-link) /usr/lib/libGL.so: undefined reference to _nv010tls’
/usr/lib/libGL.so: undefined reference to _nv012glcore' /usr/lib/libGL.so: undefined reference to _nv017glcore’
/usr/lib/libGL.so: undefined reference to _nv012tls' /usr/lib/libGL.so: undefined reference to _nv015tls’
/usr/lib/libGL.so: undefined reference to _nv000glcore' /usr/lib/libGL.so: undefined reference to _nv013tls’
/usr/lib/libGL.so: undefined reference to _nv013glcore' /usr/lib/libGL.so: undefined reference to _nv018glcore’
/usr/lib/libGL.so: undefined reference to _nv007tls' /usr/lib/libGL.so: undefined reference to _nv009tls’
/usr/lib/libGL.so: undefined reference to _nv014glcore' /usr/lib/libGL.so: undefined reference to _nv015glcore’
/usr/lib/libGL.so: undefined reference to _nv001glcore' /usr/lib/libGL.so: undefined reference to _nv008tls’
/usr/lib/libGL.so: undefined reference to _nv006tls' /usr/lib/libGL.so: undefined reference to _nv011tls’
/usr/lib/libGL.so: undefined reference to _nv020glcore' /usr/lib/libGL.so: undefined reference to _nv019glcore’
/usr/lib/libGL.so: undefined reference to _nv002glcore' /usr/lib/libGL.so: undefined reference to _nv021glcore’
/usr/lib/libGL.so: undefined reference to _nv014tls' collect2: ld returned 1 exit status make[1]: *** [../../bin/linux/release/oceanFFT] Error 1 make[1]: Leaving directory /home/praveen/NVIDIA_GPU_Computing_SDK/C/src/oceanFFT’
make: *** [src/oceanFFT/Makefile.ph_build] Error 2

I tried compiling the deviceQuery and executing it:

I’m getting the following output for the deviceQuery

cudaGetDeviceCount FAILED CUDA Driver and Runtime version may be mismatched.

You have given “choose gcc-4.4” and the same for g++4.4, but there is no command called “choose” in linux… can you help with this …

Thanks for the idea of installing gcc4.4, and setting it as default w/ update-alternatives! Everything compiled just fine for me. :) I was a bit lost because I was looking for gcc4.3, which has been completely removed from the package list of natty, didn’t think of trying 4.4.