[X11] BadMatch error in glXMakeCurrent on 3.x contexts #108

thefiddler opened this Issue Apr 30, 2014 · 7 comments


None yet

5 participants


Originally reported here: http://www.opentk.com/node/3652

I recently started testing out OpenTK on Linux after some time on Windows but I can't get it to run. (Just for the record: I started a new project in MonoDevelopment. So there isn't any Windows stuff in there causing issues)
It already fails inside the constructor of the GameWindow Class:

Game game = new Game(1280, 720, OpenTK.Graphics.GraphicsMode.Default, "INSERT_GAME_NAME", OpenTK.GameWindowFlags.Default, DisplayDevice.Default, 3,3, OpenTK.Graphics.GraphicsContextFlags.ForwardCompatible);

Giving me the following error:

X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 155 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 66
Current serial number in output stream: 66

(Has to be something XServer and OpenGL context creation related.) I installed the latest Nvidia drivers and checked whether direct rendering is enabled.

If I change the major version to anything lower than 3 it suddenly works. I didn't find an answer after searching for about an hour and I'm kinda desperate now.


Apitrace log

More information at http://www.opentk.com/node/3652#comment-15612


// Workaround for OpenTK issue #108
Game game;
if (OpenTK.Configuration.RunningOnMac)
    game = new Game(/* parameters */, 3, 2, GraphicsContextFlags.ForwardCompatible);
    game = new Game(/* parameters */, 1, 0, GraphicsContextFlags.Default);

This should be fixed now (or at least "works for me")

@thefiddler thefiddler closed this May 20, 2014
icefoxen commented Jan 1, 2015

Just FYI, I was bitten by this bug using Linux Mint 17 (which is based on Ubuntu, so not a huge shock). Changing "new GraphicsMode()" to "new GraphicsMode(32, 24, 0, 0)" in my GameWindow init as you suggested in the forum thread that originated this issue did not solve the problem, it crashes with the same error message. However, "new GraphicsMode(24, 24, 0, 0)" works and gets me an OpenGL 3.3 context (what I'm requesting), and "new GraphicsMode(32, 32, 0, 0)" works and gets me an OpenGL 4.4 context (max the graphics driver supports), which is a little weird.

Not sure if it's worth re-opening this issue, but I figured more info never hurts. Using the latest OpenTK download from the website, and the latest Linux NVidia drivers on an NVidia 730M graphics card (version 331.113).


I just encountered this issue. Ive tried every parameter in GraphicsMode constructor, I just can't get it to work. OpenGL version 1.0 works fine with GraphicsMode.Default, however when trying to construct a 3.3 context it won't work (the GPU supports OpenGL 4.4 as reported by the terminal).

Frassle commented Mar 13, 2015

Reopening, two reports is enough to suggest this is still an issue.

Could we have OS and driver information for failing cases.

@Frassle Frassle reopened this Mar 13, 2015

I am using:
OS: Ubuntu 14.10 64-bit
GPU Driver: NVIDIA binary driver - version 331.113

I'm not in a virtual machine

Might I say that OpenTK works fine with the default X.Org X server graphics driver. I think this is just mostly nvidia drivers being silly on linux. I can't even get vsync working correctly with the linux desktop.

Nihlus commented Oct 19, 2016 edited

I'm experiencing this bug as well on the following configuration:
Linux Mint 18, Cinnamon Edition (x64)
NVIDIA binary driver - version 370.28 and version 367.57.
GLWidget for GTK3

It appears to be related to issue #143, which was reportedly fixed in PR #153. One workaround for the issue is to explicitly set the requested ColourBPP to 24 instead of 32. Doing so allowed my program to successfully run.

As far as I've been able to ascertain, this is unique to the NVIDIA drivers.

This is using OpenTK 2.0 from Nuget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment