When running the JGears demo from the jogl-demos project I get exceptions depending on what command line arguments I pass. With
-Dsun.java2d.opengl=True
or
-Dsun.java2d.opengl=True -Dsun.java2d.opengl.fbobject=false
I repeatedly get
exception in QueueFlusher:
javax.media.opengl.GLException: context creation error: couldn’t find a suitable frame buffer configuration
at com.sun.opengl.impl.x11.X11ExternalGLDrawable$Context.create(X11ExternalGLDrawable.java:180)
at com.sun.opengl.impl.x11.X11ExternalGLDrawable$Context.makeCurrentImpl(X11ExternalGLDrawable.java:123)
at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
at javax.media.opengl.GLJPanel$2.run(GLJPanel.java:629)
at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
The frame opens, Swing stuff is rendered, but no OpenGL on top of it. When I omit
-Dsun.java2d.opengl=True
i.e., no arguments except for the native libs, I repeatedly get
Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: Error making context current
at com.sun.opengl.impl.x11.X11GLContext.makeCurrentImpl(X11GLContext.java:141)
at com.sun.opengl.impl.x11.X11OffscreenGLContext.makeCurrentImpl(X11OffscreenGLContext.java:74)
at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:640)
at demos.jgears.JGears.paintComponent(JGears.java:56)
at javax.swing.JComponent.paint(JComponent.java:1022)
at javax.swing.JComponent.paintChildren(JComponent.java:859)
at javax.swing.JComponent.paint(JComponent.java:1031)
at javax.swing.JComponent.paintChildren(JComponent.java:859)
at javax.swing.JComponent.paint(JComponent.java:1031)
at javax.swing.JComponent.paintChildren(JComponent.java:859)
at javax.swing.JComponent.paint(JComponent.java:1031)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
at javax.swing.JComponent.paintChildren(JComponent.java:859)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5111)
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
at javax.swing.RepaintManager.paint(RepaintManager.java:1132)
at javax.swing.JComponent.paint(JComponent.java:1008)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1797)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:738)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:683)
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:663)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:997)
at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1323)
at com.sun.opengl.util.Animator.display(Animator.java:158)
at com.sun.opengl.util.Animator$MainLoop.run(Animator.java:181)
at java.lang.Thread.run(Thread.java:619)
The checkbox is rendered, but no gradient background or fps counter. I use an Ubuntu feisty box with the proprietary ATI drivers. When I resize the frame, the JVM crashes with:
An unexpected error has been detected by Java Runtime Environment:
SIGSEGV (0xb) at pc=0xb54e6317, pid=6644, tid=3023276944
Java VM: Java HotSpot™ Client VM (1.6.0-b105 mixed mode, sharing)
Problematic frame:
C [libX11.so.6+0x32317] XQueryExtension+0x17
An error report file with more information is saved as hs_err_pid6644.log
If you would like to submit a bug report, please visit:
http://java.sun.com/webapps/bugreport/crash.jsp
Similar for the most recent jdk7 build. The non-Swing Gears demo works like a harm without the Java2D OpenGL pipeline. With
-Dsun.java2d.opengl=True
the frame opens, renders a frame and then crashes with
An unexpected error has been detected by Java Runtime Environment:
SIGSEGV (0xb) at pc=0xb4cafd00, pid=6875, tid=2741103504
Java VM: Java HotSpot™ Client VM (1.6.0-b105 mixed mode, sharing)
Problematic frame:
C [fglrx_dri.so+0x2d9d00]
An error report file with more information is saved as hs_err_pid6875.log
If you would like to submit a bug report, please visit:
http://java.sun.com/webapps/bugreport/crash.jsp
The last crash report sounds like this is a problem the fglrx drivers.
Ingo
(fglrxinfo and glxinfo output follow)