Game Development Community

BUG? OpenGLDLLInit:

by David Jung · in Torque Game Engine · 09/27/2003 (5:03 pm) · 3 replies

I'm having trouble initializing OpenGL. All other GL apps work fine.
I've tracked it down to an error return from dlopen in SDL_GL_LoadLibrary,
but I don't know what it means...

Under Redhat 9, TGE Release_1_1_2, executing torqueDemo_DEBUG.exe
I get an error Unable to initialize OpenGL. (Error: Could not load OpenGL library)
(a dialog)
I tracked that to a call to SDL_GL_LoadLibrary() around line 106 of
engine/platformX86UNIX/x86UNIXGL.cc (in OpenGLDLLInit() )

However, after getting the source to SDL and placing some extra
debug printfs in there, I can see that after a call
to dlopen("libGL.so", RTLD_LAZY | RTLD_GLOBAL) on line 426 of video/x11/SDL_x11gl.c
(SDL.1.2.6)
the dlerror() function returns the string "cannot handle TLS data".

I have libGL.so and friends (from NVidia) in /usr/lib as usual, and
that dir is in the ld.so.conf file (and dlopen() looks there specifically
anyway).

Any ideas what is going on?
What is TLS (Thread Local Storage?? - only think I can think of)

If I make a quicke test.c program that just calls dlopen("libGL.so",TLD_LAZY | RTLD_GLOBAL)
it returns a valid handle without problems.

Any help getting the TGE going would be greatly appreciated.
If it is a bug I'll submit a patch/report (somewhere - SDL maybe, NVidia possibly??)
Cheers,
-David.

#1
09/27/2003 (5:08 pm)
I just realized there is a bug forum :) I'll report there (first day with TGE - gimme a break)
#2
09/27/2003 (5:45 pm)
Solved: I had defined LD_ASSUME_KERNEL=2.2.5 in my environment. After unsetting that is works fine.
Sorry.
#3
09/27/2003 (8:08 pm)
I've also seen that problem with the "nosysinfo" boot option for redhat 9. Apparently enabling this option prevents GL from being loaded dynamically on RH9.