luiscastilho / dungeoneering

Free and slimmed down virtual tabletop (VTT) that can be used as a combat grid and as a dungeon exploration tool, made for local, in-person tabletop RPG sessions
https://dungeoneering.app
GNU General Public License v3.0
45 stars 3 forks source link

Ubuntu 20.04 Runtime Issue #7

Closed mal-w closed 2 years ago

mal-w commented 2 years ago

Output of running /.dungeoneeringDm on ubuntu 20.04 with all dependencies correctly installed...

java.lang.RuntimeException: Profile GL4bc is not available on X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7f6abc019c80, owner true, ResourceToolkitLock[obj 0x19b7411b, isOwner true, <1d88d6f5, 588a4b20>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>]]], but: [GLProfile[GLES1/GLES1.hw], GLProfile[GLES2/GLES3.hw], GLProfile[GL2ES1/GLES1.hw], GLProfile[GL4ES3/GL4.hw], GLProfile[GL2ES2/GL4.hw], GLProfile[GL4/GL4.hw], GLProfile[GLES3/GLES3.hw], GLProfile[GL4/GL4.hw], GLProfile[GL3/GL4.hw], GLProfile[GL2GL3/GL4.hw]]
    at processing.opengl.PSurfaceJOGL$2.run(PSurfaceJOGL.java:410)
    at java.lang.Thread.run(Thread.java:748)

The root issue seems to be documented quite clearly on this thread in the processing repository and I was able to fix the issue by applying the workaround in this comment specifically setting the following environment variable LIBGL_ALWAYS_SOFTWARE=1...

If you want I could submit a patch with a separate run file for linux which applies this workaround and maybe update the docs for the linux version?

Also, they mention in the following comment on the same thread that it should be resolved by using Processing 4 which is now in Beta. I'm ok in Java but not at all familliar with the Processing ecosystem, do you forsee major changes to the application to use processing 4? They may not be so bad at all since based on the Processing 4 readme:

Processing 4 makes important updates to the code to prepare the platform for its future. Most significantly, this includes the move to Java 17 and support for new Java language features. The changes should be transparent to most users, but because of the massive shift behind the scenes, this is 4.0.

luiscastilho commented 2 years ago

Hey @mal-w. Thanks for trying dungeoneering! :)

Unfortunately, from what a read this kind of problem with OpenGL/JOGL usually is hardware/system specific and hard to debug. Before every release I test dungeoneering in two different systems running Ubuntu 20.04 and v1.3.1 worked in both of them without any issues.

Here's what I understood from what I read. dungeoneering uses Processing P2D renderer which uses OpenGL through JOGL, a wrapper library that allows access to the OpenGL API in Java applications. For some reason in your system (and possibly in others as well) the JOGL used by Processing/dungeoneering can't find this "GL4bc profile", which implements the OpenGL 4.0-4.5 API. Using the LIBGL_ALWAYS_SOFTWARE workaround you are telling Mesa, the open source implementation of OpenGL used in Linux systems, to use software rendering instead of hardware rendering. That might work but software rendering is quite slow compared to hardware rendering. So animated maps or maps with dynamic lighting might be difficult or even impossible to use.

Still, the LIBGL_ALWAYS_SOFTWARE workaround might be the only option to get dungeoneering running in some systems so I will add a note under Linux on dungeoneeering's website. Thanks!

luiscastilho commented 2 years ago

About Processing 4, I'm trying to get dungeoneering to work with it but I ran into a few issues. And I will wait until Processing 4 is realeased (currently in beta) before migrating dungeoneering to it. Hopefully it will be released soon.

mal-w commented 2 years ago

Hi @luiscastilho ! Thanks for working on and releasing this tool, my part is much easier :)

Oh very interesting that's a very clear and detailed overview of the issue! I'll have to dig a little into the links you sent and read a little more... I'll have to see if I can find an alternative setup on my system which doesn't require using software rendering. I'll let you know if I figure out something that works.. thanks for adding a note to the website at the very least it might avoid some future frustration for Linux users if they hit that issue. Like you say though it is quite the performance drain, so it might be worth mentioning it's a workaround so people don't do it right away and have bad performance for no reason.

Thanks!

luiscastilho commented 2 years ago

Just in case someone finds this issue in the future, the solution proposed here might help as well: https://discourse.processing.org/t/solved-p2d-p3d-sketches-wont-start-on-fresh-ubuntu-18-04-installation/3568

From JOGL source code:

In case no native OpenGL core profiles are required and if one platform may have a buggy implementation, setting the property jogl.disable.openglcore disables querying possible existing native OpenGL core profiles.