nVidia Optimus Problem

Hey All,

In the course of porting the OpenGL Wikibook to LWJGL (which I’ve posted about before) I have come across quite a curious case and was wondering if anyone can provide any input on the subject.

I have a Dell XPS 502 laptop with nVidia Optimus on board. Now my problem is this: when I run any of the code (you can take a look at the github repo) everything runs well and dandy. However, if I switch the option on the nVidia control panel to ALWAYS use the nVidia chip instead of auto selecting, I get a blank screen, without anything drawn. The screen is cleared to the correct colour though, which makes me believe its something to do with the drawing code and not the initialisation?

As I mentioned, you can checkout the code on the github repo, or for a quick look, you can check the question I posted here a few days ago, that has been solved, but without changing the code much (except of course for calling buffer.flip() which solved the problem)

A friend of mine have a computer with Optimus (don’t know why, though, his NVidia GPU isn’t much faster than the Intel one…) and he couldn’t play Heroes of Newerth because it crashed on startup. In the end I managed to get it running by simply forcing it to use the Intel card instead.
Now that isn’t very interesting as I didn’t really solve the problem, but the log files from HoN was very interesting. The crash seemed to happen because the OS or whatever reported that the computer only had an Intel card, and most likely a list of driver DLLs and other files for the game to use. Things obviously didn’t turn out as the game expected when it then tried to use the wrong driver. There is a big chance something similar is happening inside the LWJGL natives, and that’s pretty much a lost call. You could however try to use NVidia Inspector to experiment with the (few) Optimus related settings in there, and try to create a profile for java.exe (you might have to wrap your jar in an exe-file to be able to have a non-general profile like java.exe…) which might make the game load the right drivers… Honestly, I think it’s a lost cause though.
This is just pure speculation of course, you shouldn’t draw any real conclusions from just this. :stuck_out_tongue: