PDA

View Full Version : glXChooseVisual is failing



jmiller
07-21-2010, 08:51 AM
Hi,

I have an opengl program that a client is reporting fails to run. I wrote him a small program to try and find exactly where the problem is and it looks like the issue is choosing the X visual. I'm using the following attributes as input:
GLX_RGBA,
GLX_RED_SIZE,4,
GLX_GREEN_SIZE,4,
GLX_BLUE_SIZE,4,
GLX_DOUBLEBUFFER,

Presumably one of these is attributes is not supported by his visual; however, when I look at his print out of glxinfo, there is a visual listed which matches this minimal criteria

0x24 24 tc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 0 0 None

Or am I reading the output incorrectly. I'm guessing the next thing I was going to try changing the attributes. But I thought I'd try a post to see if anyone has other suggestions. Or if you need more information please let me know.

Thanks

-joe

Dark Photon
07-21-2010, 10:43 AM
I have an opengl program that a client is reporting fails to run. I wrote him a small program to try and find exactly where the problem is and it looks like the issue is choosing the X visual. I'm using the following attributes as input:
GLX_RGBA,
GLX_RED_SIZE,4,
GLX_GREEN_SIZE,4,
GLX_BLUE_SIZE,4,
GLX_DOUBLEBUFFER,

Presumably one of these is attributes is not supported by his visual; however, when I look at his print out of glxinfo, there is a visual listed which matches this minimal criteria

0x24 24 tc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 0 0 None

Or am I reading the output incorrectly.
No, I think you're reading it fine. That looks like my visual 0x24 in glxinfo here (NVidia card).

That's the same visual I end up with from glXChooseFBConfig if I don't force multisampling.

Providing this to glXChooseFBConfig works for me. If it works from you, you can binary-search it from there:



static const int Visual_attribs[] =
{
GLX_X_RENDERABLE , True,
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
GLX_RENDER_TYPE , GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
GLX_RED_SIZE , 8,
GLX_GREEN_SIZE , 8,
GLX_BLUE_SIZE , 8,
GLX_ALPHA_SIZE , 8,
GLX_DEPTH_SIZE , 24,
GLX_STENCIL_SIZE , 8,
GLX_DOUBLEBUFFER , True,
None
};

jmiller
07-22-2010, 09:44 AM
Thanks for the suggestion. It turns out that the client has both 64 bit and 32 bit versions of gl on his system. The 32 bit version is not picking up the any visuals while the 64 bit version works fine. He's using FC13 with GeForce 9700M. I'm going to suggest that he use the 64 bit version of the software or trying to re-install the 32 bit nvidia drivers. But I wasn't sure if others had run into this issue and/or had ideas to offer.

Thanks

Dark Photon
07-22-2010, 09:59 AM
Wild guess, but I'll bet the 32-bit libGL on his system is a Mesa GL client lib, not an NVidia GL client lib.

When installing the NVidia drivers on a 64-bit system, you have to tell it you want to install the 32-bit files too.

To confirm, tell him to try this:

> nm -Do /usr/lib/libGL.so | egrep -i 'nv|mesa'
> nm -Do /usr/lib64/libGL.so | egrep -i 'nv|mesa'

For a given lib, if he gets a bunch of NV symbols, it's an NVidia lib. If he gets a bunch of MESA symbols, it's a Mesa lib.