Nvidia Optimus question

Joined
Sep 16, 2002
Messages
634
Not sure if this question should go in mobile computing or Nvidia graphics cards, but since optimus is primarily a mobile thing, lets try here.

Is there a way to make a particular shortcut use the Nvidia GPU by default?

Background: I've got a laptop with Windows 7 x64, a Nvidia NVS 3100M with optimus. Running minecraft, which is a java application, by default will render on the integrated Intel GPU. The performance is obviously poor. If I right-click on the shortcut and choose "Run with NVIDIA processer" it works great. I can, in Nvidia control panel, set all java applications to run using the Nvidia GPU, but I don't want that, only the minecraft shortcut should. I have other java applications that I run where using the nvidia gpu would just waste battery life.

So my question is, can I make a particular shortcut use the nvidia GPU, without matching everything that is ran by java? It seems like there should a command line tool that I could wrap it in to use the faster GPU for this application, but my google searches for such a thing have turned up empty.
 
If you have the Optimus/Verde package installed you should be able to right click on your desktop in W7, Nvidia something... then add applications that should trigger the dGPU.

Does that help? (currently have Optimus disabled so I don't get that context menu on right click)
 
Slight bump since this fell a little bit.

I'm currently doing some research into Optimus, how it works, passive x1 PCIe lanes, etc...
and reading the whitepaper (specifically page 17)

Launch Nvidia Control Panel--->3d Settings--->Manage 3d Settings--->Program Settings Tab (add the .jar or Minecraft binary to the Optimus list).

Ideally, Optimus is supposed to kick in whenever DirectX call is made, DXVA call is made, or a CUDA call through the API. I noticed this isn't always the case though (I had to add SWAT 4 and Atom Zombie Smasher to my Optimus Program list)
 
Launch Nvidia Control Panel--->3d Settings--->Manage 3d Settings--->Program Settings Tab (add the .jar or Minecraft binary to the Optimus list).

Well, the actual process is 'javaw.exe'. The minecraft exe is actually just a wrapper that launches java on the system that does all the heavy lifting. I can add it, but then, by my understanding, any java application will spin up the Nvidia GPU then. That isn't what I want, because there are other applications running under java that do not need the Nvidia GPU. Under the hood, minecraft is a java application running in the JVM. My minecraft shortcut is just a command line that runs:

Code:
javaw.exe -Xmx4096M -Xms1024M -cp C:\Games\Minecraft\Minecraft.jar net.minecraft.LauncherFrame

What I would love to do is just place a wrapper command or such in front of the above command line that is equivalent to right-clicking on the shortcut and choosing "Run with Nvidia GPU". That way only this invocation of java will run using the Nvidia GPU, but any other java application will continue to operate in the usual fashion.

What I suppose I could do is hunt through the registry today to see if I can figure out what exactly the right-click menu does, maybe I can reproduce that on the shortcut.

Ideally, Optimus is supposed to kick in whenever DirectX call is made, DXVA call is made, or a CUDA call through the API. I noticed this isn't always the case though (I had to add SWAT 4 and Atom Zombie Smasher to my Optimus Program list)


Minecraft (and java) uses OpenGL for its rendering. I agree, ideally it should just auto-switch when an OpenGL call is made, but it doesn't in this case. I can right-click on the shortcut and choose "Run with Nvidia GPU", and that works great, but it would be nice to modify this particular shortcut to always launch using the Nvidia GPU, and not just globally match all javaw.exe processes.

Thanks for your insights on this question so far!
 
Yeah that would be a waste to have the dGPU idle whenever the JVM is running.

I looked quickly but I could find anything in the registry.

Try:
[HKCR\lnkfile\shellex\ContextMenuHandlers\]
[HKCR\exefile\shell\]
[HKCR\exefile\shellex\ContextMenuHandlers\]
[HKCR\AllFilesystemObjects\shell\]
[HKCR\*\shell\]
[HKCR\*\shellex\ContextMenuHandlers\]

[HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\]
 
Yeah, I couldn't find any references to it in the registry, so I'm not sure what the right-click menu actually does. I also took a look through the NVIDIA control panel API (link: pdf ) but couldn't find any API documentation on Optimus.

So, I guess I'm stuck with right-click in this case.
 
do all laptops with discreet nvidia gpus of optimus nowadays?

Yeah, I believe so. The advantage with Optimus is that you remove a lot of the hardware multiplexers to switch from integrated to discrete. So you save money removing physical hardware. Another consideration is that "gen 1" and "gen 2" switchable graphics would have direct memory access to applications that were being rendered and thus needed to be killed so that the discrete or dGPU could access that memory (known as 'blocking' in the switchable world).

Of course the disadvantage is software complexity. I read somewhere that Nvidia Optimus's code has more lines than Windows NT. You're also limited to quarterly releases of drivers and such, but they're trying to improve that. A lot of people have issue with Optimus (not myself) but I'm not sure that they're enthusiast users like the ones that typically frequent here.

(e.g: I want to open my Thinkpad and probe the interconnects of the discrete GPU with a logic analyzer to see if it meets regular PCIe 16x specs)
 
Back
Top