Closed pavly-gerges closed 2 years ago
Switching between LWJGL 3.2.3 and 3.3.0 requires more than just the right natives. It also involves a small change to "LWJGLOpenVR.java". I think the entire JME 3.5 release should use a single version of LWJGL.
So far, I haven't seen any advantage of LWJGL 3.3.0 over 3.2.3, so returning to 3.2.3 might be our best path.
I don't know about LWJGLOpenVR.java
, for me I just removed the 3.3.0 jar dependencies and added all the 3.2.3 jar dependencies including the native dependencies for both the amd64 and arm32 linux.
EDIT : the right path might be looking onto lwjgl-3.3.0 and lwjgl-3.2.3 release notes and compare them, if there are really no benefits for jme then rolling back to lwjgl-3.2.3 would be the best solution, if there are benefits for jme then pi-users have to add lwjgl-3.2.3 manually and exclude lwjgl-3.3.0 and we should document that inside jme3.5.0 release notes !
I added a commit on my fork that may fix your issue: https://github.com/Ali-RS/jmonkeyengine/commit/5dc3e27d388da9290e967185874920386e6465e0
can you give it a try, please?
I added a commit on my fork that may fix your issue
I doubt it fixes the problem. I hope I'm wrong of course. But this is very good fix nevertheless. Could also cause a memory leak since the MouseInput hijacked the callback but actually never even bothered to close it like the Window tried to. Good stuff!
Thanks
@Scrappers-glitch: does this issue still occur in JME v3.5.1-stable?
@Scrappers-glitch: does this issue still occur in JME v3.5.1-stable?
I haven't tried with jme3.5.1-stable (still using jme3.5.0-alpha), but last week i have tested with removed lwjgl-3.3.0 dependencies and it works fine (with lwjgl-3.2.3).
This is the working update : https://github.com/Scrappers-glitch/NativePiTemplate/tree/master/code/java/dependencies
So far i am not using gradle on this project, so i have my dependencies downloaded from lwjgl official.
If you have changed the default lwjgl3 to be lwjgl3.2.3, then i am expecting the error to be resolved, but let me know if we want to test on gradle.
For the JMonkeyEngine v3.5.1-stable release, the only question was whether to move forward to LWJGL v3.3.1 or stick with LWJGL v3.3.0 . We never considered going back to LWJGL v3.2.3 .
Since you're sure the issue is with LWJGL, then I'd like to know whether LWJGL v3.3.1 works for armhf. Would you be willing to test armhf with a version of LWJGL other than v3.2.3?
Yes, I will try to prepare a testcase for lwjgl-3.3.1 by the next week.
@Scrappers-glitch I gather from the Forum that this issue was caused by a build mixup. Shall I close this as "invalid"?
@Scrappers-glitch I gather from the Forum that this issue was caused by a build mixup. Shall I close this as "invalid"?
The issue is persistent with lwjgl-3.3.0, but it has been resolved on lwjgl-3.3.1, so I tested lwjgl-3.3.1 on the forum and it works fine, now to fix this issue, a PR migrating to lwjgl-3.3.1 should be committed to close this issue 🙂.
Since "master" branch is already on lwjgl-3.3.1, I'm closing this issue.
Now that I have RPi hardware, I'm seeing a similar issue with current "master" branch JMonkeyEngine (which uses lwjgl-3.3.1): GLFW fails to create a window. However, the stack trace is different than the one reported above:
Apr 13, 2022 11:23:15 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.6.0-SNAPSHOT
* Branch: master
* Git Hash: 3d979df
* Build Date: 2022-04-13
Apr 13, 2022 11:23:16 PM com.jme3.app.LegacyApplication handleError
SEVERE: GLX: Failed to create context: GLXBadFBConfig
java.lang.Exception: GLX: Failed to create context: GLXBadFBConfig
at com.jme3.system.lwjgl.LwjglWindow$1.invoke(LwjglWindow.java:229)
at org.lwjgl.glfw.GLFWErrorCallbackI.callback(GLFWErrorCallbackI.java:43)
at org.lwjgl.system.JNI.invokePPPP(Native Method)
at org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:2024)
at org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:2197)
at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:294)
at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:582)
at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:704)
at java.base/java.lang.Thread.run(Thread.java:834)
Apr 13, 2022 11:23:16 PM com.jme3.app.LegacyApplication handleError
SEVERE: Failed to create display
java.lang.RuntimeException: Failed to create the GLFW window
at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:296)
at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:582)
at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:704)
at java.base/java.lang.Thread.run(Thread.java:834)
Apr 13, 2022 11:23:16 PM com.jme3.system.lwjgl.LwjglWindow run
SEVERE: Display initialization failed. Cannot continue.
Interesting, but isn't that a different exception, I mean this takes place at jme creating the context from openGL, while the original exception is due to Glfw window ?! And also this exception didn't info out the lwjgl-3 version and the state of glfw window ? It only says SEVERE : GLX
which I anticipate it as a openGL dependency problem.
You may check other lwjgl-3 dependencies and ensure all are 3.3.1.
You're right that this is a different exception, at a different point in the initialization process. I'm continuing to investigate. If this goes much deeper, I'll file a new issue and close this one.
The root cause of the GLXBadFBConfig
crash was that the RPi doesn't support OpenGL 3.2 . Back in January, PR #1752 made 3.2 the default.
The workaround was to set the renderer to "LWJGL-OpenGL2" in main()
. With that workaround, I was able to run TestJaime
, both with LWJGL 3.2.3 and LWJGL 3.3.1 . I was also able to reproduce the original NPE (in Callback.java line 190) using LWJGL 3.3.0 .
Closing this issue.
The workaround was to set the renderer to "LWJGL-OpenGL2" in
main()
.
The raspberry pi supports upto GLES 3.1 and GL2 for desktop, as raspbian doesn't use OGLES, so should we set opengl to 2 by default for linux arm desktops ?
should we set opengl to 2
That's way outside my area of expertise, so I leave that to others to decide.
The issue is persistent with lwjgl-3.3.0, but it has been resolved on lwjgl-3.3.1
Based on your testing, it's clear we can solve the "Callback.java" NPE in the v3.5 branch by simply backporting https://github.com/jMonkeyEngine/jmonkeyengine/commit/ae750c0696c561774ea8271d521b9bc40a2be0ee (upgrading LWJGL to v3.3.1). My own tests confirm this.
The NPE was a regression relative to JME 3.4.1. Therefore, we should backport the fix ASAP and publish a JME 3.5.2 release. I'll start the process.
I have tested
jme3-lwjgl3
dependency with :1) Lwjgl-3.3.0 GLFW and natives, the GLFW cannot create the GL window :
Seems that GLFW cannot find the graphics adapter :
INFO: LWJGL 3.3.0 build 21 context running on thread jME3 Main
Null
EGL OSMesa monotonic sharedI believe that this is a
lwjgl
issue, but we are expecting its from jme until proved otherwise.2) Lwjgl-3.2.3 GLFW and natives, the app works fine with a non null graphics adapter :
Sorry i am not on the pi now to copy this stack trace, but this is the important finding.
forum thread : https://hub.jmonkeyengine.org/t/jme3-5-0-alpha-on-armhf/45207/2?u=pavl_g