Dual Head on Gentoo

I am running JOGL on Gentoo latest build of both. All works as expected but I run a dual head setup and when dragging the jogl window from my primary display to my secondary display i lose the opengl section, essentially it appears to not render at all. Any ideas why and how i can fix it?

Thanks in advance.

The only time I tested dual-head mode on a Linux distribution everything just worked. I tested with an AGP GeForce FX 5800 Ultra and a PCI GeForce FX 5200 Ultra in Xinerama mode with NVidia’s drivers and was able to drag the ProceduralTexturePhysics window from screen to screen. Interestingly it looked like the 5200 was somehow responsible for driving both screens according to GL_VENDOR and GL_VERSION. What graphics cards and drivers are you running with?

Have you tried writing a Java program which iterates the available GraphicsDevices and creates a Frame and GLCanvas on each one (using the method in GLDrawableFactory which takes a GraphicsDevice as argument)? Does that work? If so, one workaround might be for you to detect motion of your window from one screen to another and destroy the one GLCanvas and recreate it on the other GraphicsDevice. I don’t think there are any AWT events we can register for which would allow JOGL to automatically detect such changes (which is why GLEventListener.displayChanged() is currently not supported).

Running AGP GeFORCE 6600 which is dual head on the card one using the DVI port one using the standard VGA port. Running the latest build of the nvidia drivers.

I have tried enumerating the GraphicsDevices and if i try and create a GLCanvas on the second Graphics Device i get the following error.

Exception in thread “main” net.java.games.jogl.GLException: Error while enumerating available XVisualInfos

The method i am using to attempt to create the GLCanvas is

GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(glc, null, null, gd[1]);

where glc is the GLCapabilities instantiated earlier and gd is the array of GraphicsDevices.

It still works fine on the primary device.

There is probably a bug in X11GLContextFactory.chooseGraphicsConfiguration. The error is happening because XGetVisualInfo is failing when supplied with the default display connection and is asked to provide visuals on the second screen. I don’t know enough X11 at this point to understand what’s wrong with the code, though.

Do other OpenGL programs work on your second display? E.g., glxgears?

Oooooh I didn’t even think of trying that. Guess what it does the same thing with glxgears too. Well I’ll be damned. I guess its an issue elsewhere in X11 or something.

I haven’t been using OpenGL outside of jogl so didn’t think much past that. Sorry bout that.

Thanks for narrowing it down though!

nVidia have had massive bugs in their drivers to do with fullscreen for the last 5 years. Even windows was crapped up in a nv driver version from early this year! (faking one display instead of hooking into XP’s dual screen support, and then breaking lots of things, and all of NV’s own desktop features broken in weird and wonderful ways).

Linux, traditionally, from NV was pretty much “primary display gets accelerated, nothing else does. Ha! Suffer, you fools!” (OK, so I added the last bit myself :P, but … they did spend 4+ years disabling all power management AND suspend to disk on ALL laptops running nv cards because they didn’t want to fix a bug in their driver… :o).

They supply extensive release notes with each linux driver - in their defence they are traditionally very honest in this, and confess to the various broken elements they aren’t going to fix, and suggest workarounds etc. Dual-screen support in particular changes subtly from release to release, so you HAVE to read those release notes…