undefined reference to `gluErrorString' trouble installing cuda

Hi all,

I am trying to install the cuda software on my linux machine (Ubuntu 11.10 64 bits). I am stuck at making the deviceQuery with this error:

…/…/lib/librendercheckgl_x86_64.a(rendercheck_gl. cpp.o): In function CheckBackBuffer::checkStatus(char const*, int, bool)': rendercheck_gl.cpp:(.text+0xfbb): undefined reference to gluErrorString’

Previously, I had errors telling me that the compiler with versions higher than 4.4 where not supported so I changed the symbolic link to gcc4.4. It went further but then this undefined ref… :S
Later, I found this post: http://forums.nvidia…howtopic=210678, so as suggested there, I used alternative instead of symbolic links but it changed nothing.

My driver version was 280.13. So I uninstalled this driver and installed the latest version available on NVIDIA site: 285.05.33 with gcc/++ back to 4.6 version, but at compilation of the sdk, it complained about the compiler version. I tried with 4.5, same error, then reinstalled once more the driver with gcc/+4.5 this time, it complained that it was not expected to compile kernel with other compiler, but I could force it so I did, but now… Same error… <img src=‘http://forums.nvidia.com/public/style_emoticons/<#EMO_DIR#>/crying.gif’ class=‘bbc_emoticon’ alt=’:’(’ />

Maybe one more thing, every time I install the driver, it says that the pre-install did not work. Could that affect anything?

Thanks in advance for your help, I am going nuts on this now!!

Compiling the SDK examples usually triggers many such errors, because of the many packages you need.
In your case, you need to install “libglu1-mesa-dev” (I guess). And I suspect you’ll encounter many other such errors, most of them coming from missing “-dev” graphics packages. You can try to resolve them one by one, or just give up the compilation of the SDK altogether since you don’t actually need it.
And if you want to have as many as you can without bothering with the ones you can’t compile for unresolved dependences, just use “make -k” which will keep on compiling even when a target fails.

One more thing: the compiler for compiling the driver and the one for compiling the SDK are two unrelated issues:
1/ to compile the driver, you have to use the kernel’s compiler
2/ to compile your cuda code, you have to use a supported compiler version
I might be that both are identical, but not always. But don’t worry, this is not a big deal. All you have to do is to have both versions installed, and to select the one you want/need for the given task, using the CC environment variable.

For example, to compile you driver, if gcc 4.6 is needed, you can do “CC=gcc-4.6 ./NVIDIA-Linux-x86_64-xxxxxx.run”
And when you compile the SDK, if you need gcc 4.4, just do “CC=gcc-4.4 make”. I’m not sure, but you might also need CXX=g+±4.4 in addition.

Thanks for these replies.

Unfortunately, I have been active before your reply. :$ I thought about the make -k, but then it did not make any executable. So I started adding the libs one by one and then figured that I should be lacking a package. So I re-installed the drivers using this link.

It worked well, it compiled completely, but then, I got this error:
CUDA driver version is insufficient for CUDA runtime version

So I uninstalled all nvidia drivers and installed the latest on the 295.20 kernel (I could use gcc4.6). And now, when I run the cudatoolkit.run, it freezes the computer… So that probably is not the right version either. Which driver should I install in order not to get the conflict with the cuda runtime version and driver and not freeze my computer? (I tried to identify the command that is problematic while running htop at the same time. The last command seen using max CPU was while mounting something on /dev but I doubt this is th pb)

I am with :

nvcc --version
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2011 NVIDIA Corporation
Built on Thu_Jan_12_14:41:45_PST_2012
Cuda compilation tools, release 4.1, V0.2.1221


cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 295.20 Mon Feb 6 21:07:30 PST 2012
GCC version: gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

And something more: you say it does not matter that the sdk compiles or not. But then won’t I get the same problem while trying to compile my own cuda code?

Thanks so much§

For using the cuda environment you really need the development drivers that come with the cuda version, or higher.
For cuda 4.1, you need version 285.05.32 onward.
What I would encourage you to do is uninstall the various nvidia drivers you have, blacklist the nouveau driver to avoid any conflict between proper nvidia driver and nouveau, and also to uninstall the dkms package that usually messes-up everything with nvidia drivers. Then you install the nvidia dev driver, and you don’t want your xorg.conf to be updated by the installer.
All in all, this is not a so well defined method and I can hardly describe it thoroughly since each time I do it, it’s a bit different.
What is for sure is that both nouveau and dkms are messing up with nvidia drivers so better getting ride of them. However, be aware that once dkms is removed, each time you’ll update you kernel package, you’ll have to recompile the nvidia driver (by re-installing it). Otherwise, you won’t have any x11 at reboot. (but that’s OK if you know how to boot on recovery mode and re-install the nvidia driver from there)
If you want give me access details for your machine, I can make it for you…

I’m having the same error message:

…/…/lib/librendercheckgl_i386.a(rendercheck_gl.cpp.o): In function CheckBackBuffer::checkStatus(char const*, int, bool)': rendercheck_gl.cpp:(.text+0x12f4): undefined reference to gluErrorString’

but apt-get says libglu1-mesa-dev is already the newest version.

What should I try next?


I faced a similar issue.

sudo apt-get install binutils-gold

solved my problem on Ubuntu 12.04. Apparently, this fixes the linker on Ubunty >=11.10.

There is very simple solution for this problem. This can be solved by reordering library file sequence in compilation command.

Here is my case -

1] Command which threw above error -
g++ -fPIC -m64 -o …/…/bin/linux/release/simpleTexture3D obj/x86_64/release/simpleTexture3D.cpp.o obj/x86_64/release/simpleTexture3D_kernel.cu.o -L/home/rakesh/cuda_4.2/cuda/lib64 -L…/…/lib -L…/…/common/lib/linux -L…/…/…/shared//lib -lcudart -lGL -lGLU -lX11 -lXi -lXmu -lGLEW_x86_64 -L/usr/X11R6/lib64 -lGLEW_x86_64 -L/usr/X11R6/lib64 -lglut -lrendercheckgl_x86_64 -L/home/rakesh/cuda_4.2/cuda/lib64 -L…/…/lib -L…/…/common/lib/linux -L…/…/…/shared//lib -lcudart

2] Command which successfully compiled the program -

sudo g++ -fPIC -m64 -o …/…/bin/linux/release/simpleTexture3D obj/x86_64/release/simpleTexture3D.cpp.o obj/x86_64/release/simpleTexture3D_kernel.cu.o -L/home/rakesh/cuda_4.2/cuda/lib64 -L…/…/lib -L…/…/common/lib/linux -L…/…/…/shared/lib -L/usr/X11R6/lib64 -L/usr/X11R6/lib64 -L/home/rakesh/cuda_4.2/cuda/lib64 -L…/…/lib -L…/…/common/lib/linux -L…/…/…/shared/lib -lcudart -lrendercheckgl_x86_64 -lGL -lGLU -lX11 -lXi -lXmu -lGLEW_x86_64 -lglut