Dealing with 3D crash in RHEL 8.4 with mesa driver

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

Dealing with 3D crash in RHEL 8.4 with mesa driver

goodwilling
Java3D is of great work. Unfortunately, all JogAmp-Java3d versions, from 1.6 to 1.7.1, crashes on RHEL 8.4 with mesa drivers (fatal error),
either using Java 11, Java 17, or Java 20.

(Crash point: getBestConfiguration)

   GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
   GraphicsConfiguration gc =
            GraphicsEnvironment.getLocalGraphicsEnvironment().
            getDefaultScreenDevice().getBestConfiguration(template);

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000000000000, pid=3896076, tid=3896362
#
# JRE version: OpenJDK Runtime Environment Zulu17.44+15-CA (17.0.8+7) (build 17.0.8+7-LTS)
# Java VM: OpenJDK 64-Bit Server VM Zulu17.44+15-CA (17.0.8+7-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C  [libjogl_desktop.so+0x9e067]  Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXSwapIntervalEXT0__JJIJ+0x3c
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /home/user/core.3896076)
#
# An error report file with more information is saved as:
# /home/user/hs_err_pid3896076.log
#
# If you would like to submit a bug report, please visit:
#   http://www.azul.com/support/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

(hs_err_pid3896076.log)
Internal exceptions (20 events):
Event: 6.239 Thread 0x00007fe8e002ebf0 Exception  (0x0000000080ecee30)
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 759]


(System Information)

Linux 4.18.0-305.3.1.el8.x86_64

server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
OpenGL vendor string: Mesa/X.org


The fatal error in RHEL 8.4 does not occur in other versions of RHEL 8, and RHEL 7, RHEL 9.

Similar reports in Advanced Design System 2022 Release Notes:
------------
https://edadocs.software.keysight.com/display/engdocads/ADS+2022+Release+Notes

In a vncserver session running on RHEL 8.4, you may encounter a critical error, "EMPro exited unexpectedly during execution." This is related to the graphics driver software contained in the mesa-*.x86_64.20.3.3-2.el8 packages.
Workaround: Downgrade the packages to the previous version using the following command:

sudo yum downgrade mesa-*
The packages mesa-*-20.1.4-1.el8.x86_64, and the dependent llvm package work.
------------

However, for a non-root user of a RHEL 8.4 system which is even without internet connection,
I wonder whether there is a workaround for this problem. Thank you very much.
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

philjord
Goodwilling,
This is entirely a Jogl and Mesa Driver issue rather than a Java3D issue.
A search on this forum for mesa returns plenty of results in several posts, so these drivers causes lots of headaches.
I can't help you out, and the other posts don't look like they have solutions other than going software renderering only
https://forum.jogamp.org/jogl-problems-on-mesa-20-branch-td4040546.html#a4040552
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

gouessej
Administrator
In reply to this post by goodwilling
It's a regression in the driver itself. It's not up to JOGL to work around driver bugs. Writing such workarounds may require weeks or even months of work. Please ensure that you use JOGL 2.5, indicate very precisely which hardware you use and if your problem occurs only when using vncserver.

By the way, I use Mesa 22.3.6 under Debian Linux with Intel hardware without having such crashes. I mainly use Adoptium OpenJDK 11 and 17.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

goodwilling
Thanks for the comments. The crash problem occurs for various software in various systems, either on a Virtual machine inside Windows or a real Linux server running RHEL 8.4. This problem is definitely regarded as the graphics driver issue, which can be solved by upgrading the RHEL system (and the driver) or downgrading of the driver only. For RHEL 8.4 inside VirtualBox, the problem can also be solved by enabling the 3D acceleration in the VirtualBox.

For users without available solutions as above, there seems to be a way of switching to Java 3D 1.5.2 as reported in the forum of Sweethome 3D:

Linux java3d not working with mesa 20.0.2
https://sourceforge.net/p/sweethome3d/bugs/945/

As a matter of fact, the old version of our software using Java3D 1.5 (with Java 8) can also run normally on RHEL 8.4 with mesa driver. However, presently it switches to Java3D 1.7 (JOGL 2.3.2) with Java 17, which is necessary for many systems such as Windows 11 and RHEL 9, and thus it cannot easily switch to Java3D 1.5.

For a test, we tried the following change in the initialization of 3D (with the inclusion of j3dcore-1.5.jar, j3dutils-1.5.jar, vecmath-1.5.jar, libj3dcore-ogl.so, together with Java3D 1.7):

if(useJava3D_15){
     GraphicsConfiguration gc = com.sun.j3d.utils.universe.SimpleUniverse.getPreferredConfiguration();
     canvas3d = new Canvas3D(gc);
}else{
     GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
     GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().
            getDefaultScreenDevice().getBestConfiguration(template);
     canvas3d = new Canvas3D(gc);
}

then there comes out the following error if useJava3D_15 is true:

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: 'void javax.media.j3d.NativeScreenInfo.createNativeScreenInfo()'
        at javax.media.j3d.NativePipeline.initialize(NativePipeline.java:108)
        at javax.media.j3d.Pipeline.createPipeline(Pipeline.java:151)
        at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:926)
        at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:280)

By the way, Java3D-1.7 in the deployment of Java3D (https://jogamp.org/deployment/java3d/) seems to give error if used with JOGL 2.5. I wonder what is the correct procedure to make Java3D work with JOGL 2.5.
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

goodwilling
In reply to this post by philjord
Sorry to notice that the following environment setting does not solve the issue.
 export LIBGL_ALWAYS_SOFTWARE=true
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

gouessej
Administrator
In reply to this post by goodwilling
Don't advise people to use an obsolete unmaintained version of Java3D. I totally understand that some developers can have a different point of view but such "workarounds" have side effects that the JogAmp community doesn't have to handle. The errors whose message is "Profile GL2 is not available on null" are often but not always fixed by using a more recent driver or a more recent version of JOGL. Java3D 1.5.2 has many unfixed bugs, it's a matter of facts, what seems to work in a particular case will exhibit the bugs fixed in the meantime, I remember that Harvey (mostly) and some other contributors fixed numerous bugs even before I ported Java3D to JOGL 2.

Moreover, I remind you that Java3D 1.7 uses a different package namespace as we're not allowed to use the javax namespace (it's the same for Jakarta EE):
https://jogamp.org/deployment/java3d/1.7.0-pre1/javadoc/ (rather use the documentation in maven-java3d if you need something more recent). We use "org.jogamp" instead of "javax.media".

What you are doing is nonsensical, never mix several versions of Java3D, libj3dcore-ogl.so isn't used by JogAmp Java3D. Have you ever read my tutorial? I'll update it as soon as possible to be sure that it works as expected.

Keep in mind that there is a known problem with some Intel drivers under Windows with Java >= 9, it even affects Minecraft that doesn't use JOGL.

Finally I remind that the current release of Mesa is the version 23.1.6, the Mesa Amber release is the version 21.3.9. Please don't use an obsolete version of Mesa, we cannot handle bugs that affect terribly old version of Mesa (Mesa 20 had many minor releases between March 2020 and March 2021, i.e more than two years ago).

Sorry to be harsh. Thank you for the feedback anyway.

P.S: Please use official sources of information about JogAmp Java3D. The dirty kludges used outside will lead you nowhere.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

philjord
In reply to this post by goodwilling
Goodwilling, thanks for testing Java3D 1.7 with Jogl 2.5.0

I'm currently building Java3D 1.7.2 that will be compatible with 2.5.0

So far I haven't had any issue other that the Newt UI API has changed, could you give me more detials on the erro you get?

Thanks,
Phil.
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

goodwilling
Many thanks to all the comments. I tested Java3d-1.7.1 and jogl 2.5 in the deployment again, and I am so pleased to find that the crash disappears in the test!  Java3D-1.7.1 works in RHEL 8.4 with the mesa driver 20.3.3 !

In my previous test, it seems that I forgot to update all jogl*.jar and gluegen-rt*.jar and accordingly that caused the error.

Thanks to all the efforts in developing Java3D!
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

gouessej
Administrator
Thank you for the feedback.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

Sven Gothel
Administrator
In reply to this post by goodwilling
Great it all works out now!

For the future, please attach the JOGL test output
with and w/o debug info.

https://jogamp.org/wiki/index.php?title=Jogl_FAQ#Bugreports_&_Testing

JOGL,_Platform_and_OpenGL_Version
https://jogamp.org/wiki/index.php?title=Jogl_FAQ#JOGL,_Platform_and_OpenGL_Version

Detailed_Debug_Log
https://jogamp.org/wiki/index.php?title=Jogl_FAQ#Detailed_Debug_Log

All piped out w/ joined stdout + stderr of course, like 'command >& test.log'
use and/or see the etc/test_dbg.sh or etc/test_dbg.bat files.

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Dealing with 3D crash in RHEL 8.4 with mesa driver

goodwilling
Sorry for the late response.
I downloaded jogamp-all-platform.7z from /deployment/jogamp-current/archive and did the test.

sh etc/test.sh test.log
sh etc/test_dbg.sh test_dbg.log

The log files are attached. Thank you.