Can not create OpenGL 4.2 context on openSUSE

Hello,

I tried to test OpenGL 4.2 on OpenSUSE 12.1 using glew 1.7, freeglut and nvidia driver 285.05.09. The graphics card is GTX 570.
An error occurred when trying to create context.
“X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 135 (GLX)
Minor opcode of failed request: 34 ()
Serial number of failed request: 63
Current serial number in output stream: 64”

When I tried to create OpenGL 4.1 context everything is OK. It seems this driver doesn’t support OpenGL 4.2 although it should be.
Any ideas? Thanks!

ZHAO Peng

Let’s see your window and context create code. When I’ve seen BadMatch it’s caused by things by not attaching a colormap to the X window or something like that.

Thanks for your reply!
The codes are as follow
" glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DEPTH|GLUT_RGBA | GLUT_DOUBLE);
glutInitContextVersion(4,2);
glutInitContextProfile(GLUT_CORE_PROFILE);
glutInitWindowSize (700, 700);
glutInitWindowPosition(10, 10);
glutCreateWindow(“opengl 4.2 application”);"

These are very common steps for glut application. And I have tried the OpenGL 4.2 samples from g-truc.net which also produced the error message. The other users of openSUSE 12.1 also have the same problem. I don’t know how about the other distribution.

By the way, the glxinfo can create OpenGL 4.2 context and if I don’t call " glutInitContextVersion(4,2); glutInitContextProfile(GLUT_CORE_PROFILE);" the nvidia driver can create default OpenGL 4.2 driver without profile information. Really strange!

This looks more like a bug in FreeGLUT. glxinfo does nothing else than have X create a default GL context. Usually this is the highest versioned compat context the driver will provide.

You can always try another windowing toolkit, like SDL or Qt. If one if these succeed then its GLUT.

I can’t create an OpenGL 4.2 context either. I have a GeForce GTX 580 with Nvidia drivers 290.10 and I’m running Ubuntu 11.10. I use GLFW to create the context, and creating a 4.1 context is fine, but it fails when creating a 4.2 context. So it’s probably not freeglut.

There is the same problem using Qt which means it is not related with freeglut. I am not sure it is the problem of Nvidia driver or x server.

Let’s eliminate GLUT and Qt as possible causes of this problem and try with raw GLX and X11. Try the context creation code at the top of this post:

Just change the GLX_CONTEXT_MAJOR_VERSION_ARB number to 4 and the GLX_CONTEXT_MINOR_VERSION_ARB to 2.

Compile with:
g++ -o tst tst.cxx -lGL -lX11

Thanks for your suggestion!
I gave a try and got results as follow.

When set GLX_CONTEXT_MAJOR_VERSION_ARB number to 4 and the GLX_CONTEXT_MINOR_VERSION_ARB to 2.
"GLX version = 1.4
Getting framebuffer configs
Found 2 matching FB configs.
Chosen visual ID = 0x3a
Creating colormap
Creating window
Mapping window
Creating context
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 135 (GLX)
Minor opcode of failed request: 34 ()
Serial number of failed request: 35
Current serial number in output stream: 36
"

When set GLX_CONTEXT_MAJOR_VERSION_ARB number to 4 and the GLX_CONTEXT_MINOR_VERSION_ARB to 1.
"GLX version = 1.4
Getting framebuffer configs
Found 2 matching FB configs.
Chosen visual ID = 0x3a
Creating colormap
Creating window
Mapping window
Creating context
Created GL 4.1 context
Verifying that context is direct
Making context current
"

I think freeglut and Qt are innocent and this problem may be related to Nvidia driver and X server. What next step can we do to clarify this problem? :confused:

Message from Nvidia on Nv News. Here

This is a known issue that we’ll try to get fixed soon. I think you can work around the problem simply by creating an unversioned “compatibility profile” context, but I’ll have to check tomorrow.

OK, it’s clear. Just waiting!

Ah, great! I’m glad to hear a fix for this is underway. :slight_smile:

This is kind of odd. I’ve downloaded GLFW’s source distribution. It comes with a small test program called ‘version’, which opens a window and polls the context information.

These are tests I’ve done at my work computer, which has a GeForce GT 520 GPU.


$ ./version 
GLFW header version: 2.7.2
GLFW library version: 2.7.2
OpenGL context version string: "4.2.0 NVIDIA 290.10"
OpenGL context version parsed by GLFW: 4.2.0
OpenGL context flags: none
OpenGL profile mask: 0x00000000 (unknown)
OpenGL context renderer string: "GeForce GT 520/PCI/SSE2"
OpenGL context vendor string: "NVIDIA Corporation"
OpenGL context shading language version: "4.20 NVIDIA via Cg compiler"

Apparently it successfully opens a 4.2 context when not specifying the major and minor version numbers. But when explicitly asking for a 4.2 context, I get these errors:


$ ./version -m4 -n2
Setting OpenGL context version hints!
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  130 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  60
  Current serial number in output stream:  60
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  130 (GLX)
  Minor opcode of failed request:  4 (X_GLXDestroyContext)
  Serial number of failed request:  62
  Current serial number in output stream:  68

Also when asking for specific profiles, I get errors – both when explicitly asking for a 4.2 context and when not.


$ ./version -p core
Failed to open GLFW window
$ ./version -p compat
Failed to open GLFW window

Asking for specific profiles for lower versions (3.0, 3.1, 3.2, 3.3, 4.1) works OK.

It seems the NVIDIA driver is happy to give you a 4.2 context by default (ie no version number in create context).

But when you explicitly ask for 4.2 with a version number in create context it barfs.

I would not be surprised someone forgot to add a new if/else statement for 4.2 to the create context function.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.