I’m running Ubuntu 18.04 (our supported platform) in a VM.
I haven’t had any success with any of the MESA_GL_VERSION_OVERRIDE related flags (I still get the jogamp issues). But hopefully, if I can get that to work, it should also behave the same way it does for you.
Side note: We’re very eager to switch to LWJGL instead of JOGL. Especially considering that they have a Vulkan/MoltenVK backend which will help on macOS.
Actually I had no issues with Defold at all when I was using Ubuntu 18.04. I didn’t have to mess with MESA overrides. My problems started with Ubuntu 20.04.
Ok, so you don’t use any extra variables to launch Defold on Ubuntu 20.04?
In 1.2.179, you launched the editor like so?
$ ./Defold
I think I misunderstood your comment on the MESA override then.
Which makes sense since it seems it’s something else stopping the engine from running properly.
If I can be helpful, I’ll describe my scenario.
I’m running Steam version of Defold(1.2.180) on my laptop(intel+nvidia graphics, Manjaro linux).
Without launch options and with “MESA_GL_VERSION_OVERRIDE=3.3 %command%” I got
java.lang.ClassCastException: class jogamp.opengl.es1.GLES1Impl cannot be cast to class com.jogamp.opengl.GL2ES2 (jogamp.opengl.es1.GLES1Impl and com.jogamp.opengl.GL2ES2 are in unnamed module of loader ‘app’)
in editor trying to render any opengl context.
With “MESA_GL_VERSION_OVERRIDE=2.1 %command%” build crashes:
Unable to create OpenGL context
FATAL:ENGINE: Could not open window (-2).
INFO:CRASH: Using libunwind.a
With launch option “prime-run %command%” everything seems working.
I just tried to reproduce this on an actual Linux machine (not a VM) running Ubuntu 20.04, but I couldn’t make it crash.
09:50:13 ~/Downloads/Defold $ glxinfo | grep Mesa
client glx vendor string: Mesa Project and SGI
Device: Mesa DRI Intel(R) HD Graphics 4400 (HSW GT2) (0xa16)
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 4400 (HSW GT2)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 20.2.6
OpenGL version string: 3.0 Mesa 20.2.6
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.2.6
I didn’t have to do anything to launch the editor or engine. (i.e. no extra environment flags).
I’ll make a special version of the editor that prints out all the environment variables that it uses to launch the engine. Perhaps we find something there to pinpoint why the engine doesn’t launch properly.
This version outputs the environment variables when launching the engine.
You can use that output and compare it to what you get when you do a export in the Terminal. Hopefully we can detect some variables that trip up the dmengine.
This downloads the engine, changes the executable attribute, and then verifies that it launches correctly (i.e. creates a window and shows the debug app)
Create test script
Create a test.sh with all the environment variables in it, (The ones the new editor output when you tried to launch the engine and it failed).
At the end of the script, we launch the engine.
E.g. something like this (test.sh):
export USER=mawe
export JAVA_CMD=java
... many more
#launch the engine
./dmengine
Run the script
$ sh test.sh
At this point, it should still fail, and we have a repro case.
Now, comment out the environment variables one by one, and test the script.
Once the engine starts running again, we’ll note the environment variables that we’ve removed. Some of them are problematic (but perhaps not all of them)
without any additional env vars dmengine runs perfectly but I get exception in editor trying to open any collection/asset/curve_editor
java.lang.ClassCastException: class jogamp.opengl.es1.GLES1Impl cannot be cast to class com.jogamp.opengl.GL2ES2
with added “export MESA_GL_VERSION_OVERRIDE=2.1” I get perfectly running editor, but dmengine crashes with
Unable to create OpenGL context
FATAL:ENGINE: Could not open window (-2).
INFO:CRASH: Using libunwind.a
Segmentation fault (core dumped)
Using dedicated nvidia graphics solves both problems so I not need any environment variables. Probably I have some driver related problems with my intel graphics.
Here is part of inxi output:
I’ve read that modesetting driver can lead some problems. I’ll try to dig deaper the problem. But as I said previously, using nvidia graphics is a problem solver for me.
I don’t exactly understand this… I am not seeing anything in the terminal apart from the normal boot-up process when I launch these. Also, is there a list of ENV variables we should work against?
Also, is there a list of ENV variables we should work against?
No. But my current theory is that somehow, some variable(s) gets added to the environment before launching the engine.
I base it on the fact that you can launch the engine as a stand alone executable from the Terminal without problem, and then when it’s launched via the editor, it fails.
The only way I can think of that they differ, is the environment they’re executed in.
Perhaps, I’m not entirely sure. We do bundle our own java runtime with the editor so technically it shouldn’t need outside settings.
But the question is, are they affecting the launch of dmengine?