question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lwjgl-3.3.0 GLFW cannot create a GL window on armhf

See original GitHub issue

I have tested jme3-lwjgl3 dependency with :

  1. Lwjgl-3.3.0 GLFW and natives, the GLFW cannot create the GL window :
pi@raspberrypi:~/NativeJmeTemplate/output/run $ ./run.sh 
Run
..................................
Dec 09, 2021 12:44:14 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.5.0-alpha1
 * Branch: HEAD
 * Git Hash: dc91668
 * Build Date: 2021-11-14
Dec 09, 2021 12:44:16 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 3.3.0 build 21 context running on thread jME3 Main
 * Graphics Adapter: GLFW 3.4.0 Wayland X11 GLX Null EGL OSMesa monotonic shared
Dec 09, 2021 12:44:16 PM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
 * Vendor: Broadcom
 * Renderer: V3D 4.2
 * OpenGL Version: 2.1 Mesa 19.3.2
 * GLSL Version: 1.20
 * Profile: Compatibility
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.ogre.MeshLoader
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.ogre.SkeletonLoader
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.ogre.MaterialLoader
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.ogre.SceneLoader
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.fbx.FbxLoader
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.gltf.GltfLoader
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.gltf.BinLoader
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.gltf.GlbLoader
Dec 09, 2021 12:44:16 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.audio.plugins.OGGLoader
Dec 09, 2021 12:44:16 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.NullPointerException
	at org.lwjgl.system.Callback.get(Callback.java:190)
	at org.lwjgl.glfw.GLFWWindowSizeCallback.create(GLFWWindowSizeCallback.java:36)
	at org.lwjgl.glfw.GLFWWindowSizeCallback.createSafe(GLFWWindowSizeCallback.java:45)
	at org.lwjgl.glfw.GLFW.glfwSetWindowSizeCallback(GLFW.java:3139)
	at com.jme3.input.lwjgl.GlfwMouseInput.initCallbacks(GlfwMouseInput.java:243)
	at com.jme3.input.lwjgl.GlfwMouseInput.initialize(GlfwMouseInput.java:184)
	at com.jme3.app.LegacyApplication.initInput(LegacyApplication.java:337)
	at com.jme3.app.LegacyApplication.initialize(LegacyApplication.java:640)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:198)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:524)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:640)
	at com.jme3.system.lwjgl.LwjglWindow.create(LwjglWindow.java:477)
	at com.jme3.app.LegacyApplication.start(LegacyApplication.java:491)
	at com.jme3.app.LegacyApplication.start(LegacyApplication.java:443)
	at com.jme3.app.SimpleApplication.start(SimpleApplication.java:126)
	at test.TestJni.main(TestJni.java:18)

Dec 09, 2021 12:44:16 PM com.jme3.app.LegacyApplication handleError
SEVERE: Failed to destroy context
java.lang.NullPointerException
	at org.lwjgl.system.Callback.get(Callback.java:190)
	at org.lwjgl.glfw.GLFWErrorCallback.create(GLFWErrorCallback.java:40)
	at org.lwjgl.glfw.GLFWErrorCallback.createSafe(GLFWErrorCallback.java:49)
	at org.lwjgl.glfw.GLFW.glfwSetErrorCallback(GLFW.java:1288)
	at com.jme3.system.lwjgl.LwjglWindow.destroyContext(LwjglWindow.java:436)
	at com.jme3.system.lwjgl.LwjglWindow.deinitInThread(LwjglWindow.java:624)
	at com.jme3.system.lwjgl.LwjglWindow.lambda$initInThread$12(LwjglWindow.java:494)
	at java.base/java.lang.Thread.dispatchUncaughtException(Thread.java:2002)

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x1a00061
  Serial number of failed request:  1818
  Current serial number in output stream:  1818

Seems that GLFW cannot find the graphics adapter :

INFO: LWJGL 3.3.0 build 21 context running on thread jME3 Main

  • Graphics Adapter: GLFW 3.4.0 Wayland X11 GLX Null EGL OSMesa monotonic shared

I believe that this is a lwjgl issue, but we are expecting its from jme until proved otherwise.

  1. Lwjgl-3.2.3 GLFW and natives, the app works fine with a non null graphics adapter :

image

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
stephengoldcommented, Apr 14, 2022

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.

2reactions
Ali-RScommented, Dec 19, 2021

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

GLFW/GLES cant create window with GLES30 support on ...
glfwMakeContextCurrent (window); org.lwjgl.system.Configuration.OPENGLES_EXPLICIT_INIT.set(true); GLES.create(GL.getFunctionProvider()); ...
Read more >
multithreading - LWJGL3 shared context throws ...
You could do this by calling GLFW.glfwMakeContextCurrent(0) in the main thread (or the thread where you are creating the main window) and then ......
Read more >
Get started with LWJGL 3
This guide will help you get started with LWJGL 3. ... Following is a simple example that utilizes GLFW to create a window...
Read more >
OSX M1 OpenAL error JME3.5.2 - jMonkeyEngine Hub
I tried just dumping the LWJGL3.jar into the library and removing the LWJGL.jar and ... Lwjgl-3.3.0 GLFW cannot create a GL window on...
Read more >
Set window icon in lwjgl 3.1 - support - GLFW
I've been trying to set a png icon for my application (both taskbar and title bar) using the following example: GLFWImage images[2]; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found