Loss of FBO/UBO contexts on GTX 690 w/Xinerama

I’m having a bit of trouble with OpenGL context loss on my development machine. It’s a triple-headed Gentoo box with a GTX 690 video card. Since it’s a dual-GPU card, the rightmost pair of monitors is on a different GPU to the first. I’m running Xinerama and using the fakexinerama library to feed proper screen bounds to my window environment. I’ve tested without fakexinerama with no effect, so I’m only mentioning it out of completeness.

The game that I’m developing at the moment is the only GL3+ testing application I have at the moment, which makes this a little hard to provide a description for reproduction.

The issue I’m having is that when the game starts on the center or right monitor, many of the OpenGL buffer objects are incorrectly bound, causing rendering problems. At the start, the main FBO is missing, causing a black screen. If I move the window to the left screen, everything renders fine. When I move it back, the main FBO is fine but the one I’m using for render-to-texture is missing, causing my envmap to be undefined (black or floating pixels are common, and sometimes a partial but corrupted render).

I’ve started the process of adding GL4 features recently, and in the process, I discovered that this bug extends to UBOs. I moved my transform and projection matrix into the UBO, and now the right two screens refuse to render any of my geometry. It works fine on the left screen, still.

Downgrading the drivers to 304.88 solve the FBO issue but the UBOs are still broken. I can force the UBOs to refresh by adding an additional call to glBindBufferBase whenever I upload new data, but this is clearly not the right thing to do.

The problem does not appear to extend to VBOs, VAOs, textures, or shader programs. FBO and UBO objects are the only ones (so far) that are losing their state between GPUs. I can’t rule out the possibility that other object types that I am not currently using also suffer from this problem.

Do you have a test program that reproduces the problem? Also, can you use SLI Mosaic or BaseMosaic instead of Xinerama?

I haven’t had a chance to reduce the problem to a simple test program, right now it only effects my in-development game engine.

SLI Mosaic won’t work on a 690, as it’s a multi-GPU board, and the MultiGPU setting doesn’t allow Mosaic. BaseMosaic works, though, and it doesn’t suffer the problem that xinerama does. It also seems to enable xrandr support, cleanly handles 3d windows that span the GPU boundary, and perhaps slightly better video performance than xinerama, so I think I’m going to just stay with this solution.

I can’t help but feel that there’s supposed to be a better mode to use this card in, but at least it works now, so I can stop running all my tests on the left display.