Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

zeno
Hello all,
I've got some issues regarding jogl context initialization while using new Mesa 17.2.0 on my arch linux machine. To make some short summary, while using slightly older Mesa (17.1.5), GL renderer was named:
Gallium 0.4 on AMD HAWAII (DRM 3.15.0 / 4.12.12-1-ARCH, LLVM 4.0.1)
and all was working well, while the new renderer is named:
AMD Radeon R9 200 Series (AMD HAWAII / DRM 3.15.0 / 4.12.12-1-ARCH, LLVM 4.0.1)
GLContext would therefore not recognize by this new name that it is actually Mesa renderer/driver - context and profile initialization fails and things does not work at all.

Its quite easy, anyway here are some informations regarding my machine and jogl:
OS/Distro: Linux/Archlinux (up to date)
Graphics card: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii XT / Grenada XT [Radeon R9 290X/390X]
Video drivers: xf86-video-amdgpu-1.4.0-1-x86_64 (radeon module is blacklisted because of OpenCL incompatibility, so amdgpu module is used in all setups.)
jogl version and package is from: http://jogamp.org/deployment/v2.3.2/archive/jogamp-fat-all.7z
All other important informations could be found in all of the following debug outputs....

debug output of GLProfile.get(GLProfile.GL2) on Mesa 17.1.5 - mesa driver recognized:
https://pastebin.com/PQ1jrmtZ

debug output of GLProfile.get(GLProfile.GL2) on Mesa 17.2.0 - mesa driver NOT recognized:
https://pastebin.com/3SAuNfv7

debug output of GLProfile.get(GLProfile.GL2) on Mesa 17.2.0 with modified GLContextImpl - mesa driver recognized:
https://pastebin.com/cJJ6cp1x

I was able to recognize the problem just by diffing first two debug outputs (lines 212-216 quirks...) where renderer names are shown (or missing in the buggy case). After putting some breakpoints to quirks init, the issue immediately shown itself.

To sum it up, actual problem lies in function setRendererQuirks in class GLContextImpl.java on line 2116 (alternatively https://github.com/sgothel/jogl/blob/master/src/jogl/classes/jogamp/opengl/GLContextImpl.java#L2136) where:
final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ");
needs to be changed to:
final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ") || glRenderer.startsWith("AMD ");
this causes the context to be correctly initialized and things work well again. It even looks like there was already some intention to implement this Mesa AMD renderer - as seen commented 8 lines above the culprit, where:
// final String MesaRendererAMDsp = " AMD ";
I do not know whether this is the best solution as I do not see too deep to JOGL internals, so I am just documenting my findings for you this way. Hope this helps.

Have a nice day.
Zeno
Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

gouessej
Administrator
Hi

The suggested fix would cause a regression as a renderer can contain AMD and can have nothing to do with Mesa.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

gouessej
Administrator
In reply to this post by zeno
You should fill a bug report. I'll try to reproduce this bug on my own machine under Mageia Linux 6.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

zeno
In reply to this post by gouessej
Hi,
glVersion string could be of some help then, (loaded at GLContextImpl.java:1634 -> glGetStringInt(GL.GL_VERSION, glGetStringPtr)), returns following:
OpenGL ES 3.1 Mesa 17.2.0
Well, to be honest, it is quite a mess, according to: https://www.khronos.org/opengl/wiki/OpenGL_Context#OpenGL_version_number 
this could change to anything anytime as it depends on specific GL implementations.
Have a nice day.
Zeno
Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

gouessej
Administrator
I'm currently using Mesa 17.1.4. I'll fill a bug report soon. Thank you for the hints.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

Xerxes Rånby
There are two ways to fix this issue
 A ) the best option: fix all outstanding issues with mesa 3d so that we no longer require any quirks, this would fix mesa 3d initialization in combination with the current jogamp version.

B) add yet another workaround in jogamp, this will only push the issue into the future

2017-09-14 9:43 GMT+02:00 gouessej [via jogamp] <[hidden email]>:
I'm currently using Mesa 17.1.4. I'll fill a bug report soon. Thank you for the hints.
Julien Gouesse | Personal blog | Website



To start a new topic under jogl, email [hidden email]
To unsubscribe from jogamp, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

gouessej
Administrator
The option A seems to be infeasible to me. I can't fix Mesa itself and there are still buggy versions installed on numerous computers.

In my humble opinion, it will force us to release a maintenance version because the impact is quite big. We can't stay with such an important unfixed bug affecting GNU Linux.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

Karl Voss
I can replicate the error. I was wondering whether the maintenance version was released, and where I might be able to find it.

Also on Arch Linux x64, running JOGL v2.3.2.

Code is extending GLCanvas, and upon trying to add an event listener it crashes with the following stacktrace:

Exception in thread "AWT-EventQueue-0" java.lang.InternalError: XXX0 profile[1]: GL3bc -> profileImpl GL4bc !!! not mapped
        at com.jogamp.opengl.GLProfile.computeProfileMap(GLProfile.java:2071)
        at com.jogamp.opengl.GLProfile.initProfilesForDeviceCritical(GLProfile.java:1954)
        at com.jogamp.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1875)
        at com.jogamp.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1842)
        at com.jogamp.opengl.GLProfile.access$000(GLProfile.java:80)
        at com.jogamp.opengl.GLProfile$1.run(GLProfile.java:230)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.opengl.GLProfile.initSingleton(GLProfile.java:216)
        at com.jogamp.opengl.GLProfile.getDefaultDevice(GLProfile.java:2027)
        at com.jogamp.opengl.awt.GLCanvas.<init>(GLCanvas.java:264)
        at com.jogamp.opengl.awt.GLCanvas.<init>(GLCanvas.java:231)
        at com.jogamp.opengl.awt.GLCanvas.<init>(GLCanvas.java:218)
        at JOGL2Setup_GLCanvas.<init>(JOGL2Setup_GLCanvas.java:27)
        at JOGL2Setup_RendererMain.<init>(JOGL2Setup_RendererMain.java:26)
        at JOGL2Setup_RendererMain$2.run(JOGL2Setup_RendererMain.java:62)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Process finished with exit code 0

Line 27 in JOGL2Setup_GLCanvas is:
public JOGL2Setup_GLCanvas() {
        this.addGLEventListener(
   }


OpenGL renderer string: AMD HAWAII (DRM 2.50.0 / 4.13.5-1-ARCH, LLVM 5.0.0)

Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

gouessej
Administrator
We have found a fix, it will be put into the next maintenance release:
https://jogamp.org/bugzilla/show_bug.cgi?id=1357
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error

Karl Voss
Thanks for the link to the bug report.

I'll recompile it on my system in the meantime using the suggested fix.