libgdx / gdx-liftoff

A modern setup tool for libGDX Gradle projects
Apache License 2.0
530 stars 50 forks source link

[LWJGL] GLFW_VERSION_UNAVAILABLE error on Linux #33

Closed DeveloperMCD closed 4 years ago

DeveloperMCD commented 4 years ago

I downloaded the latest release as of today, and ran the Jar file as-is with no modifications.

Screenshot at 2020-10-03 16-58-48 java -jar gdx-liftoff-1.9.11.3.jar [LWJGL] GLFW_VERSION_UNAVAILABLE error Description : GLX: Failed to create context: BadValue (integer parameter out of range for operation) Stacktrace : org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:1714) org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1897) com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createGlfwWindow(Lwjgl3Application.java:465) com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:409) com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:395) com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.(Lwjgl3Application.java:114) com.github.czyzby.setup.MainKt.main(main.kt:87) com.github.czyzby.setup.MainKt.main(main.kt) Exception in thread "main" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't create window at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createGlfwWindow(Lwjgl3Application.java:468) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:409) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:395) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.(Lwjgl3Application.java:114) at com.github.czyzby.setup.MainKt.main(main.kt:87) at com.github.czyzby.setup.MainKt.main(main.kt)

lsb_release -a No LSB modules are available. Distributor ID: LinuxMint Description: Linux Mint 19.3 Tricia Release: 19.3 Codename: tricia

crykn commented 4 years ago

GLFW_VERSION_UNAVAILABLE is defined as:

The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.

I don't think liftoff is changing the required OpenGL version, so it should require the default version, which is OpenGL 3.2. Your graphics card, the 1050 TI, should be able to handle 4.5/4.6. Considering you're using X-Server, I found this issue, where indirect rendering is forcing OpenGL version 1.4, which would explain the error.

tommyettinger commented 4 years ago

Thanks, @crykn ! It looks like there's some possible solutions in that issue thread. Depending on what you need configured, just using a template like https://github.com/tommyettinger/libgdx-lwjgl3-html-template may be an easy approach to getting started. Although... without semi-recent OpenGL, you won't be able to run a libGDX application/game, except as an HTML app/game hosted on a server (which the above template handles). I'm curious to know if any solutions work for this, but since I can't change something in libGDX to suddenly fix this, I don't think this is something I can address other than by suggesting alternatives.

DeveloperMCD commented 4 years ago

How come I don't have this problem running any actual LibGDX games? It's just your setup utility that has an issue with the indirect rendering, etc. I'm running the latest NVidia driver, 440. I'm not on some outdated system, OS, or driver. Linux Mint is the most popular variant of Ubuntu Linux. "Although... without semi-recent OpenGL, you won't be able to run a libGDX application/game" -- not an issue. My OpenGL is plenty recent. It's just being run in some indirect mode, according to that thread. But I don't have problems running any LibGDX games on my PC, so...

DeveloperMCD commented 4 years ago

I solved the problem. Apparently my PC hadn't been rebooted in 65 days (yay Linux!). I recently upgraded my NVidia driver to 450 (from 440). After the reboot, your LibGDX setup utility launched just fine. I guess I just needed a reboot after the driver upgrade.

tommyettinger commented 4 years ago

Yay Linux! I can only look forward to such issues myself, as this Windows laptop gradually dies and I switch primarily to my Manjaro Linux laptop. I definitely have noticed rebooting less frequently since... Windows Vista, I guess. Both Windows (once hardware is configured) and especially Linux are usually so good at avoiding reboots now. I'll close this, but I'll keep it in mind for any potential future mind-boggling OpenGL indirection issues people have.