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!
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.
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?
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.
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.
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.