Bug 103078

Summary: MATLAB broken with mesa software rendering
Product: Mesa Reporter: sergio.callegari
Component: Drivers/X11Assignee: mesa-dev
Status: RESOLVED NOTOURBUG QA Contact: mesa-dev
Severity: major    
Priority: medium CC: aidan.walton, azari4096
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description sergio.callegari 2017-10-03 16:44:06 UTC
Software rendering with recent mesa (either LLVMPipe, softpipe or swr) breaks matlab.

Seen with MATLAB 2016a on Kubuntu 17.04 with the latest (git) mesa as of today.

Graphic commands (e.g. plot) hang and make it impossible to close Matlab cleanly.

On llvmpipe the 'opengl info' matlab command crashes with

Error using hgopengl
Java exception occurred:
java.lang.RuntimeException: Waited 5000ms for: <38d5ebf2, 64757a04>[count 2 [ add. 0, orig 2], qsz 0, owner
<Startup Class Loader>, add.owner Startup Class Loader-SharedResourceRunner] - <main>
	at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
	at com.jogamp.opengl.GLProfile.initSingleton(GLProfile.java:199)
	at com.jogamp.opengl.GLProfile.getDefaultDevice(GLProfile.java:2003)
	at com.jogamp.opengl.GLCapabilities.<init>(GLCapabilities.java:84)
	at com.mathworks.hg.uij.OpenGLUtils$MyGLListener.getGLInformation(OpenGLUtils.java:320)
	at com.mathworks.hg.uij.OpenGLUtils$MyGLListener.getGLData(OpenGLUtils.java:498)
	at com.mathworks.hg.uij.OpenGLUtils.getGLData(OpenGLUtils.java:78)

Error in hgopengl

On softpipe, the same command hangs.

This is curious because matlab has itself a software rendering mode, that seems to rely on mesa X11. The opengl info for it returns

                          Version: '2.1 Mesa 10.5.2'
                           Vendor: 'Brian Paul'
                         Renderer: 'Mesa X11'
                   MaxTextureSize: 16384
                           Visual: 'Visual 0x72, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleratio…'
                         Software: 'true'
             HardwareSupportLevel: 'none (known graphics driver issues)'
        SupportsGraphicsSmoothing: 0
    SupportsDepthPeelTransparency: 1
       SupportsAlignVertexCenters: 0
                       Extensions: {151x1 cell}
               MaxFrameBufferSize: 16384

So, it looks like mesa was supporting matlab 2016a just fine at the time of 10.5.2 and that we are now facing a regression.
Comment 1 Emil Velikov 2017-10-03 17:09:01 UTC
Hi Sergio,

I won't be looking at the issue, I'm afraid yet here's a couple of ideas/suggestions that should help:

- try to track down the first Mesa version (ideally a commit) that breaks things
- isolate that the issue is not LLVM related by rebuilding mesa without it
- check that the correct libraries are picked (using strace or LD_DEBUG=libs) 
Matlab might be shipping libraries (say libc/libstdc++) that are older than the ones Mesa is build against.
- try to get more verbose information of the issue - not sure if the dev. will have a matlab license to debug themselves
Comment 2 sergio.callegari 2017-10-04 06:48:26 UTC
Hi,

I totally understand the difficulty in looking into an issue related to (expensive) commercial, that - as such - is hard to reproduce.

Thanks for the suggestion, even if - on a machine that is in use - I will not be able to do any bisection.

I'll try to work on the last point aka get more verbose information.

In any case, my intent was mostly to assure that a trace of the problem is present on the bug tracker, in case other users run into the issue and possibly to guide them if they need to get new hardware with the need to run Matlab on it. 

Unfortunately the Matlab experience on Linux is sad. Not working with nouveau. Not working with soft rendering, either. Working with its own soft rendering, but with many limitations. Fortunately, it seems OK on intel graphics.
Comment 3 Brian Paul 2017-10-04 17:52:10 UTC
Sergio, I installed the 30-day trial of Matlab r2017b and typed 'opengl info' in the command window.  I did not get a java exception.  I got an error message that reads:

"""
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.
"""

I don't see that issue when using NVIDIA's driver.

I used apitrace to create a trace of Matlab's GL calls with llvmpipe and with NVIDIA's linux driver.  It looks like Matlab begins by trying to find the highest supported GL version of the core profile.  With NVIDIA's driver it finds 4.5.  With llvmpipe it finds 3.3.

Then, it also tries to create compatibility profile context.  With NVIDIA's driver it again gets a 4.5 context.  With llvmpipe, we don't have such profiles and Matlab stops after getting a GL 3.1 context.

Finally, with llvmpipe, Matlab tries to create a 3.3 compatibility profile and fails.  It then successfully creates a legacy context with glXCreateNewContext().  It calls glGetIntegerv(GL_MAJOR/MINOR_VERSION) then destroys the context.

As far as I an tell, Matlab simply doesn't accept llvmpipe's context/version offerings.  Either that's by design or there's some sort of logic bug in MatLab that gives up on GL support after failing to create a particular kind of context.

You could try installing some older versions of Mesa to see if Matlab 2016a works/fails.  But Matlab 2017b seems to act differently.
Comment 4 sergio.callegari 2017-10-04 20:09:48 UTC
@Brian

thanks for testing! Indeed, I think that Matlab 2016 is fine with the NVIDIA proprietary driver. However, I cannot use it because I have a KDE desktop and the nvidia proprietary drivers hang the konsole as per

https://devtalk.nvidia.com/default/topic/879586/linux/kf5-konsole-15-04-and-15-08-consumes-100-cpu-on-close-only-with-proprietary-nvidia-driver/2

https://bugs.kde.org/show_bug.cgi?id=343803

https://bugreports.qt.io/browse/blockquote%3E

Furthermore, I prefer the free drivers when my graphics card copes with them.

The different response to the opengl info may be related to a slightly different mesa/graphics stack combination. Incidentally, it is unclear to me whether you got the "MATLAB has experienced a low-level graphics error" with llvmpipe or the hardware driver.

Matlab seems to use some java library to interact with opengl and I do not know if it is something commercial or something open source that MathWorks has adapted to its needs. In the latter case, testing might be easier.
Comment 5 sergio.callegari 2017-10-11 13:06:15 UTC
... looks like also scilab has issues with the software renderer. With LIBGL_ALWAYS_SOFTWARE=1, scilab cannot plot (shows empty plot windows). May be a totally unrelated issue, but I think that scilab and matlab have in common the use of jogamp for graphics rendering.
Comment 6 sergio.callegari 2017-10-11 13:10:03 UTC
Scilab gives

Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Caught GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1757)
        at javax.media.opengl.awt.GLJPanel.initializeBackendImpl(GLJPanel.java:1339)
        at javax.media.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:550)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JViewport.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintToOffscreen(Unknown Source)
        at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
        at javax.swing.RepaintManager.paint(Unknown Source)
        at javax.swing.JComponent._paintImmediately(Unknown Source)
        at javax.swing.JComponent.paintImmediately(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.access$1000(Unknown Source)
        at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.media.opengl.GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:390)
        at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:696)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:589)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:539)
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1693)
        ... 41 more
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Caught GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1757)
        at javax.media.opengl.awt.GLJPanel.initializeBackendImpl(GLJPanel.java:1339)
        at javax.media.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:550)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JViewport.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at org.flexdock.docking.defaults.DefaultDockingPort.paint(DefaultDockingPort.java:1983)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paintToOffscreen(Unknown Source)
        at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
        at javax.swing.RepaintManager.paint(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
        at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
        at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
        at java.awt.Container.paint(Unknown Source)
        at java.awt.Window.paint(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.access$1000(Unknown Source)
        at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.media.opengl.GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:390)
        at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:696)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:589)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:539)
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1693)
        ... 57 more
Exception in thread "Thread-5" javax.media.opengl.GLException: java.lang.reflect.InvocationTargetException
        at javax.media.opengl.awt.GLJPanel.display(GLJPanel.java:460)
        at org.scilab.modules.gui.bridge.canvas.SwingScilabCanvasImpl$SafeGLJPanel.display(Unknown Source)
        at org.scilab.forge.scirenderer.implementation.jogl.JoGLCanvas$CanvasAnimator.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at java.awt.EventQueue.invokeAndWait(Unknown Source)
        at java.awt.EventQueue.invokeAndWait(Unknown Source)
        at javax.media.opengl.awt.GLJPanel.display(GLJPanel.java:458)
        ... 3 more
Caused by: javax.media.opengl.GLException: Caught GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1757)
        at javax.media.opengl.awt.GLJPanel.initializeBackendImpl(GLJPanel.java:1339)
        at javax.media.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:550)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintToOffscreen(Unknown Source)
        at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
        at javax.swing.RepaintManager.paint(Unknown Source)
        at javax.swing.JComponent._paintImmediately(Unknown Source)
        at javax.swing.JComponent.paintImmediately(Unknown Source)
        at javax.media.opengl.awt.GLJPanel$11.run(GLJPanel.java:1497)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.media.opengl.GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:390)
        at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:696)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:589)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:539)
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1693)
        ... 28 more
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Caught GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1757)
        at javax.media.opengl.awt.GLJPanel.initializeBackendImpl(GLJPanel.java:1339)
        at javax.media.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:550)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JViewport.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at org.flexdock.docking.defaults.DefaultDockingPort.paint(DefaultDockingPort.java:1983)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paintToOffscreen(Unknown Source)
        at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
        at javax.swing.RepaintManager.paint(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
        at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
        at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
        at java.awt.Container.paint(Unknown Source)
        at java.awt.Window.paint(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.access$1000(Unknown Source)
        at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.media.opengl.GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:390)
        at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:696)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:589)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:539)
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1693)
        ... 57 more
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Caught GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1757)
        at javax.media.opengl.awt.GLJPanel.initializeBackendImpl(GLJPanel.java:1339)
        at javax.media.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:550)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JViewport.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at org.flexdock.docking.defaults.DefaultDockingPort.paint(DefaultDockingPort.java:1983)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paintToOffscreen(Unknown Source)
        at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
        at javax.swing.RepaintManager.paint(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
        at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
        at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
        at java.awt.Container.paint(Unknown Source)
        at java.awt.Window.paint(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.access$1000(Unknown Source)
        at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.media.opengl.GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:390)
        at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:696)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:589)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:539)
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1693)
        ... 57 more
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Caught GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1757)
        at javax.media.opengl.awt.GLJPanel.initializeBackendImpl(GLJPanel.java:1339)
        at javax.media.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:550)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JViewport.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at org.flexdock.docking.defaults.DefaultDockingPort.paint(DefaultDockingPort.java:1983)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JLayeredPane.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paintToOffscreen(Unknown Source)
        at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
        at javax.swing.RepaintManager.paint(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
        at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
        at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
        at java.awt.Container.paint(Unknown Source)
        at java.awt.Window.paint(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at javax.swing.RepaintManager$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
        at javax.swing.RepaintManager.access$1000(Unknown Source)
        at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.media.opengl.GLException: AWT-EventQueue-0: X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, ES2 compat, FBO, software) - 3.0 Mesa 17.3.0-devel
        at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:390)
        at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:696)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:589)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:539)
        at javax.media.opengl.awt.GLJPanel$OffscreenBackend.initialize(GLJPanel.java:1693)
        ... 57 more
Comment 7 sergio.callegari 2017-10-11 13:17:50 UTC
Obviously, at least with scilab, there is an important regression.

Note that the scilab website itself, since the release of scilab 5.X (for the last 2-3 years) has advised to use LIBGL_ALWAYS_SOFTWARE=1 with mesa to work around hw driver issues:

https://wiki.scilab.org/Graphical%20issues%20with%20Scilab%205.X
Comment 8 Scott D Phillips 2017-10-11 21:41:12 UTC
scilab breaks starting with:

commit 92b4ca45504e7ffc5f4fa385ada1be48e6123181
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Wed Jun 7 22:00:48 2017 +0200

    st/mesa: remove the "Gallium 0.4 on" prefix from GL_RENDERER
    
    If you want to keep it for your driver, please raise your hand.
    The prefix will probably have to be added into the driver instead of here.
    
    I cringe when I look at my long renderer string:
      Gallium 0.4 on AMD Radeon R9 Fury Series (DRM 3.17.0 / 4.11.0-staging-01277-gab25a9e, LLVM 5.0.0)
    
    I'm sincerely sorry for all apps that detect Mesa by expecting "Gallium"
    in the string.
    
    Reviewed-by: Eric Anholt <eric@anholt.net>

It seems jogl wants to detect mesa and alter its behavior based on that:

https://github.com/sgothel/jogl/blob/45cc13c4d68fb3137b741cbc39ea653c15db2f66/src/jogl/classes/jogamp/opengl/GLContextImpl.java#L2136
Comment 9 Roland Scheidegger 2017-10-11 22:56:14 UTC
(In reply to Scott D Phillips from comment #8)
> It seems jogl wants to detect mesa and alter its behavior based on that:
> 
> https://github.com/sgothel/jogl/blob/
> 45cc13c4d68fb3137b741cbc39ea653c15db2f66/src/jogl/classes/jogamp/opengl/
> GLContextImpl.java#L2136

At a quick glance, my guess would be the issues are around GLRendererQuirks.GLNonCompliant which would be set with detected mesa driver and requested (compatCtx && (major > 3 || (major == 3 && minor >= 1)).
It would then refuse to use such contexts.
(I would tend to think it is a bug in jogl somewhere with different gl versions being available for core/compat contexts but I have no idea really.)
Comment 10 Timo Aaltonen 2018-01-12 22:08:55 UTC
*** Bug 103976 has been marked as a duplicate of this bug. ***
Comment 11 Timo Aaltonen 2018-01-12 22:11:09 UTC
*** Bug 103217 has been marked as a duplicate of this bug. ***
Comment 12 Timo Aaltonen 2018-01-12 22:19:41 UTC
this is a bug in jogl, and apparently changing it to detect current Mesa makes it work again:

https://jogamp.org/bugzilla/show_bug.cgi?id=1357
Comment 13 Roland Scheidegger 2018-01-12 22:25:05 UTC
(In reply to Timo Aaltonen from comment #12)
> this is a bug in jogl, and apparently changing it to detect current Mesa
> makes it work again:
> 
> https://jogamp.org/bugzilla/show_bug.cgi?id=1357

They really should fix whatever it's doing wrong, rather than trying to avoid doing the wrong stuff when detecting a mesa-based driver... (I suspect it might be related to mesa not supporting compat profiles higher than 3.3 and jogl not handling this correctly, but really no idea. Doing hacks such as renderer detection might be ok as quick workarounds, but really the root cause should be fixed wherever it is.)
Comment 14 Timothy Arceri 2018-05-01 06:51:49 UTC
*** Bug 105847 has been marked as a duplicate of this bug. ***
Comment 15 Dylan Baker 2018-08-15 20:18:35 UTC
It sounds like this was actually a jogl bug, thus not our bug. Please re-open if I've misunderstood.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.