Reputation: 177
After updating NVidia Drivers to 378.49 on EVGA GTX 1080 FTW I started getting this exception using libGDX.
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: OpenGL is not supported by the video driver.
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.createDisplayPixelFormat(LwjglGraphics.java:229)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:174)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:138)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: org.lwjgl.LWJGLException: Pixel format not accelerated
at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:253)
at org.lwjgl.opengl.Display.createWindow(Display.java:306)
at org.lwjgl.opengl.Display.create(Display.java:848)
at org.lwjgl.opengl.Display.create(Display.java:757)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.createDisplayPixelFormat(LwjglGraphics.java:220)
... 3 more
OpenGL Extensions Viewer shows that OpenGL version 4.5 available on my GPU.
I've tried forcing jrm executables to run on my NVidia GPU (they actually were running on it, but I just wanted to ensure)
Other OpenGL-based apps run fine. Also, I've tried to run a compiled libGDX game from Steam and it seems to run just fine.
I've tried to use different JRMs with different Java versions. I performed a clean driver reinstall and rebooted several times.
The exception appears in both Android Studio and IntelliJ.
config.allowSoftwareMode = true;
doesn't work (and shouldn't). Windows only supports software rendering for OpenGL 1.1 when libGTX requires 2.0.
Upvotes: 1
Views: 1351
Reputation: 31
we were recently affected by the crashes the new NVIDIA driver, particularly 3dVision is causing with java and LWJGL.
I tried everything and I finally found out how to completely solve the issue, so I wanted to share my findings.
The bug comes in two stages. One is caused by the driver itself and one by 3dVision. The driver itself stops on using OpenGL initialization functions resulting in "Pixelformat not accelerated", 3dVision might even crash on non LWJGL functions such as GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().
As strange as it sounds, the solution is to strictly use javaw.exe instead of java.exe for windows. I know that the only difference is that javaw targets the WINDOW subsystem, while java targets the CONSOLE subsystem https://msdn.microsoft.com/en-us/library/fcc1zstk.aspx?f=255&MSPPError=-2147217396 but for some reason, it solves the crash.
Here is the catch though. Using just "javaw" will not solve the problem. The executable has to be called directly. The problem with just calling "javaw" on a system with java installed is that it will call a dummy javaw.exe either located in system32 or in C:\ProgramData. This dummy file will delegate the command to the latest installation of java. If this happens, the crash will occur.
If you have a crashing test program you can try executing it with "javaw -jar test.jar" and "C:\PathToJavaHome\bin\javaw.exe -jar test.jar". The first one will crash, the second one will work.
Upvotes: 2
Reputation: 111
I have the same issue.
Exception in thread "LWJGL Application"I just downloaded and installed the previous driver from Nvidia 376.33 and it solved my issue (windows 10 64bit).
com.badlogic.gdx.utils.GdxRuntimeException: OpenGL is not supported by the video driver.
Upvotes: 3