Bug 1357 - Exception in thread "AWT-EventQueue-0" java.lang.InternalError: XXX0 profile[1]: GL3bc -> profileImpl GL4bc !!! not mapped
Summary: Exception in thread "AWT-EventQueue-0" java.lang.InternalError: XXX0 profile[...
Status: IN_PROGRESS
Alias: None
Product: Jogl
Classification: JogAmp
Component: opengl (show other bugs)
Version: 2.5.0
Hardware: pc_x86_64 linux
: P1 critical
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2017-10-10 17:16 CEST by gst0098
Modified: 2017-11-08 16:22 CET (History)
2 users (show)

See Also:
Type: DEFECT
SCM Refs:
Workaround: ---


Attachments
Source code to reproduce the bug and log file obtained with: -Dnewt.debug=all -Dnativewindow.debug=all -Djogl.debug=all (12.44 KB, application/x-compressed-tar)
2017-10-10 17:16 CEST, gst0098
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gst0098 2017-10-10 17:16:33 CEST
Created attachment 798 [details]
Source code to reproduce the bug and log file obtained with: -Dnewt.debug=all -Dnativewindow.debug=all -Djogl.debug=all

With AMD RX590 or RX480 running the program thorws the exception:

Exception in thread "AWT-EventQueue-0" java.lang.InternalError: XXX0 profile[1]: GL3bc -> profileImpl GL4bc !!! not mapped

With recent mesa the naming convention has been changed and now AMD cards are named "AMD" instead of the former name "Gallium". This cause the bug.

Giuseppe
Comment 1 Julien Gouesse 2017-10-11 13:46:02 CEST
It seems to occur with Mesa 17.2.1 but not with earlier versions.
Comment 2 Julien Gouesse 2017-10-11 13:53:45 CEST
Please can you run glxinfo?
https://dri.freedesktop.org/wiki/glxinfo/

I'll compare with the result on my machine using an older version of Mesa.
Comment 3 Julien Gouesse 2017-10-11 14:01:31 CEST
Oops, I occurred with Mesa 17.2.0 too but not with Mesa 17.1.5:
http://forum.jogamp.org/Mesa-17-2-0-renderer-driver-name-change-error-causes-GLProfile-not-mapped-initialization-error-td4038176.html

Gallium 0.4 on AMD HAWAII (DRM 3.15.0 / 4.12.12-1-ARCH, LLVM 4.0.1) -> AMD Radeon R9 200 Series (AMD HAWAII / DRM 3.15.0 / 4.12.12-1-ARCH, LLVM 4.0.1)
Comment 4 Julien Gouesse 2017-10-11 14:05:52 CEST
Using GL_VERSION might help as it should contain:
3.1 (3.1 Mesa 17.2.1)

or something like this:

3.3 (Core Profile) Mesa 17.2.1
Comment 5 Julien Gouesse 2017-10-11 14:13:56 CEST
I suggest this change:
final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ");

-> 

final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ") || glVersion.contains(MesaSP);

It won't break non Mesa AMD drivers :) Guiseppe's second suggestion seems to be viable.
Comment 6 gst0098 2017-10-11 14:56:25 CEST
I'm out of office today and tomorrow, if needed I can give the output of glxinfo on friday morning.
I'll try the fix suggested by Julien and report back result on my environment, I think it will work.
Comment 7 Julien Gouesse 2017-10-11 15:25:19 CEST
(In reply to gst0098 from comment #6)
> I'm out of office today and tomorrow, if needed I can give the output of
> glxinfo on friday morning.
> I'll try the fix suggested by Julien and report back result on my
> environment, I think it will work.

There's no hurry. Thank you. Feel free to make a pull request (only with this tiny change) against my repository if it works as expected.
Comment 8 gst0098 2017-10-13 09:42:50 CEST
Hello,
I tested the patch proposed by Julien and Zeno and it works.

Julien, how can I pull a request against your repo ?

I did the patch on the repo that I cloned with the command: 
git clone --recurse-submodules git://jogamp.org/srv/scm/jogl.git jogl

Giuseppe
Comment 9 Julien Gouesse 2017-10-13 10:52:09 CEST
(In reply to gst0098 from comment #8)
> Hello,
> I tested the patch proposed by Julien and Zeno and it works.
> 
> Julien, how can I pull a request against your repo ?
> 
> I did the patch on the repo that I cloned with the command: 
> git clone --recurse-submodules git://jogamp.org/srv/scm/jogl.git jogl
> 
> Giuseppe

Maybe it would be easier for you just to post here the git diff. I'll credit the change to Zeno and you.
Comment 10 gst0098 2017-10-13 11:54:44 CEST
Here it is:

diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 31a8e489e..c5b3ea8ac 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -2133,8 +2133,7 @@ public abstract class GLContextImpl extends GLContext {
     final boolean isES = 0 != ( ctp & GLContext.CTX_PROFILE_ES );
     final boolean isX11 = NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true);
     final boolean isWindows = Platform.getOSType() == Platform.OSType.WINDOWS;
-    final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ");
-
+    final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ") || glVersion.contains(MesaSP);
     final boolean isDriverATICatalyst;
     final boolean isDriverNVIDIAGeForce;
     final boolean isDriverIntel;

Thank you,
Giuseppe