Hello Guest

[BUG] Pixel format not accelerated, The driver does not appear to support OpenGL

  • 23 Replies
  • 24573 Views
Hey guys,

first of all, thank you for your software!

the internet is pretty much filled up with Minecraft-guys posting their "Pixel format not accelerated" topics all over all boards, I know, but I have to do this post. I don't play MC, but I'm heavily developing a graphics engine in my freetime (I'm h.pernpeintner from java-gaming.org btw). The project is based on LWJGL 2.9.1 and I never had problems using LWJGL as a dependency. I rewarded myself with a new Notebook recently and now I'm fuled by a GTX 1060 6Gb. With Ubuntu 16 and the latest proprietary drivers from nvidia, everything worked like a charm. Now I switched to Windows 10 and installed the latest drivers. I definetly have the latest drivers installed (378.49, released 24. Jan. 2017) and when I try to run my application, I get a LWJGLException with Pixel format not accelerated. Trying to run the LWJGL 3 examples, I'm getting The driver does not appear to support OpenGL.

I tried to reinstall drivers. I tried to use several older JDK versions. I tried to use 64 and 32 bit java.... running another OpenGL 4 demo works just perfectly fine (no java app). Running World Wind (uses JOGL) just works fine. So I have to assume, that my problem is not driver related.

Is there any chance that we can investigate this problem?

*

Kai

Quote
Trying to run the LWJGL 3 examples, I'm getting The driver does not appear to support OpenGL.
The following is just related to LWJGL 3 and assumes that by the above you meant you tried running an LWJGL 3 example using LWJGL 3 and that failed with this error message.

The first step to narrow it down would be to build and run a native GLFW application, because LWJGL 3 makes use of GLFW to create the window and the OpenGL context. GLFW itself provides a few example programs.
So, you can clone the GLFW GitHub repo and follow its Compiling GLFW guide.
If you've built GLFW successfully, you'll find some exe files under <builddir>/examples/<buildvariant>/
Try to see if you can run those.

*

Offline Cornix

  • *****
  • 488
Does your notebook have integrated graphics on the CPU in addition to the GPU? Could it be that your java application uses the integrated graphics chip instead of the regular graphics card?

Thanks you two :)

I try to build glfw, but I think it will work.. all other OpenGL-dependent applications do run.

No, there are no integrated graphics - I have a gsync display (disabled it currently) that doesn't work with integrated graphics, that's why it is deactivated completely.

*

Kai

Quote
all other OpenGL-dependent applications do run.
What _exactly_ are those other (presumably native) OpenGL applications using for window and OpenGL context creation, then?
SDL, GLFW, GLUT, OpenGLUT or Win32 API and WGL manually?
Each such library may have its own way of doing the necessary native Win32 API calls, obtaining the necessary function pointers, catching errors, handling/finding alternatives for unsupported formats, etc.
We first must rule out any error in GLFW itself, because LWJGL 3 itself really does not do anything in addition.

I understand, i will report later about building glfw. So you have any idea what could cause the problem with lwjgl 2, because thats what i am most interested in.

Okay, all glfw examples are working without any problems. Your turn :)

*

Kai

 :) okay. Next: can you post a self-contained Java example app that uses LWJGL 3 and provokes the error?
Just to see whether you are not suddenly requesting invalid context or pixel format attributes.
You can also just name a demo application somewhere on GitHub or probably even the lwjgl.org site that does not work.
« Last Edit: January 26, 2017, 21:27:44 by Kai »

*

Kai

Btw. can you also try this: https://github.com/httpdigest/lwjgl3-swt/blob/master/test/org/lwjgl/opengl/swt/Swt33CoreMsDemo.java
Just import the project/repo as Maven project into any Java IDE and execute the class. Also supports G-Sync btw.
If that fails, too, then we can at least debug the WGL calls in Java, which are different than the ones done by GLFW at that.
« Last Edit: January 26, 2017, 21:55:53 by Kai »

Woa it's getting more and more wierd. I tried the examples from https://github.com/LWJGL/lwjgl3-demos . Running from IntelliJ produces mentioned errors. Running with java -jar xyz.jar results in the same error and the window cannot be created. java -version states java is on the path and is the correct version of my jdk. What puzzles me is, that running it with java.exe -jar xyz.jar from doesn-t-matter-where, it actually works. java -version and java.exe -version point to the exact same java version. Double-clicking a jar works as well somehow. But since I'm using the cmd all the time, I didn't try this earlier...what's also weird is that my compiled project can be started via a batch file that does java -jar -bla.jar but not directly via the cmd with the exact same command.

So first of all, I want to say SORRY, most likely my problem has nothing to do with lwjgl at all. Do you have nonetheless any idea what's going on here?

*

Kai

I have a hunch that it is somewhat related to: https://github.com/LWJGL/lwjgl/issues/119#issuecomment-173983180
Though it so far only seems to affect Intel cards/drivers. Are you absolutely 100% sure that Optimus is not using your Intel HD chip? Please check with GL11.glGetString(GL_VENDOR).

How can one be 100% sure, I'm currently questioning my whole life because the problem is that strange :)

Since I'm not able to create a Display in my own project (in the regular way), how should I query the vendor string?? Using java.exe instead of java for execution, the string says NVIDIA CORPORATION.

I'm relatively sure that there's no Intel stuff kicking in, because it is completely deactivated (in terms of hardware deactivated thingies) in my notebook - since one has to use nvidia cards with gsync.

Do you have any idea why it does matter if I chose java or java.exe?

*

Kai

Okay, now I've upgraded my Nvidia drivers (from 376.62 to 378.49), too, and I have the exact same symptoms now on Windows 7 x64 with JDK1.8.0_121 x64. WTF...
It indeed works when launching on the cmd with java.exe but fails when using java. It also works when using javaw.exe but fails when using javaw. I've definitely not seen this before.
As for why mentioning the '.exe' extension works: I have no idea what Nvidia did there. The fact is that a program can query the command it was started with, and I assume that the Nvidia driver does just that (this is also likely used to detect games for which Nvidia adds certain performance optimizations in their driver), and it will see whether you started Java with the '.exe' extension or not. They seem to have added some code path in their latest driver that checks for java/java.exe there.
« Last Edit: January 27, 2017, 21:35:28 by Kai »

*

Kai

I've just verified that indeed it has nothing to do with the Java version and neither with LWJGL. It's really only the command you use to start the process/program.
To test this, I renamed the java.exe in the Java installation directory just to java2.exe.
Starting `java2 -jar the.jar` on the cmd worked. So the Nvidia driver is definitely querying the process's command to do its thing.
As another test, I just renamed any of the built GLFW example exe files to java.exe and ran them in the current working directory as `java`. This resulted in the same error. Again, running with `java.exe` did work and ran that respective GLFW example.
I get that renaming any working native OpenGL application to "java.exe" and starting them inside that working directory as `java` will make them not working anymore.

EDIT: They really screwed up with this one. Even Direct3D 9 and 11 applications do not work anymore if being renamed to "java.exe" and started as "java". :(
« Last Edit: January 27, 2017, 23:24:17 by Kai »

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
I can reproduce this too.