jME and Nvidia Optimus

Hi all,

I have been developing with jME since some time now and just recently switched over to
my new laptop. But now there are issues with the Optimus technology of Nvidia.

For those who don´t know how it works
There are two GPUs in my laptop, one for easy tasks and one for the difficult ones (like gaming).
Usually the little Intel HD 4000 is used and whenever it´s necessary, the GTX 660M.

When I try to launch my own game in the jME SDK, it apperently uses the HD 4000 and I can´t
change it. (Usually one can change the graphics card to be used by an application, but with jME
there is no .exe that I could tell Nvidia to run on the GTX 660M)

Does anyone have a clue on how to fix this?
I could specify “always use GTX 660M”, but that is not the approach I am looking for since
I would have to change it every time I start programming.
Can you tell the jME SDK on wich GPU to launch?

I hope someone has experienced this before,
thx in advance

So, when you’re running other games and applications that should be using your dedicated graphics card, do you find that the GTX is indeed kicking in for those?

I had a computer like this as well and it seemed to use the integrated card for absolutely everything until I messed around with the drivers and sorted it out. I doubt there’s anything to do on the jME end to solve your problem :expressionless:

yep, I think nvidia has a lookup table with games that require a good gpu and then they switch over (huge difference in terms of fps)
so it of course does not detect my little game…

I supposed there was no built-in solution for this already, but I thought I´d post this question anyway since
one of the users maybe had the same issue and found a workaround already.

Or if I happen to find a better solution than switching everything to GTX, i´ll post it here for others to find, of course.
thx anyway :slight_smile:

it uses java, you could set the java exe for all, also isnt there a manual override for useing the real grafic card?

hm, yes I could try that…
This function is there, the problem was that one could not override it when developing with jME.

It´s not the best solution to do it with java.exe (since it will use it for all java programs), but it should work :slight_smile:

Only apps that use OpenGL or DirectX are effected (e.g. games) so adding java.exe should be fine.

Swing uses opengl/directx for rendering tho. So mostly all java applications save terminals and application servers are affected.

You can use separate JREs, one for development and one for apps. Then you have two different java.exe on your machine.

It seems like there is a way to enable preference for a particular GPU (WGL_AMD_gpu_association and WGL_NV_gpu_affinity extensions), but LWJGL doesn’t support it, so jME3 cannot support it either.