force NVIDIA on laptops

I have written code that creates a profile for our application and sets some settings.

On laptops with integrated video there is a setting in the UI “Select the preferred graphics processor for the system”. I would like to set this to “High-performance NVIDIA processor” for our profile.

The typedef NV_GPU_TYPE and NvAPI_GPU_GetGPUType() look promising but I don’t see a corresponding way to set the value. Any ideas how to set “use NVIDIA” in the profile?

I have been trying to do the same thing to solve problems with an MSI laptop.

These are useful :

According to this, the settings required for NVIDIA Inspector are :

Enable application for Optimus : SHIM_RENDERING_MODE_ENABLE
Optimus flags for enabled applications : SHIM_MCCOMPAT_ENABLE
Shim rendering mode Options per application for Optimus : SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE

My problem is that NvAPI_DRS_SaveSettings always fails. If you have any idea why I would be keen to hear.

Thanks I will try that. But do you do all this SHIM_ stuff regardless of if you really have Optima? That is what impact does it have if you are on a regular desktop? Is this SHIM_ stuff documented somewhere?

We already have the NvOptimusEnablement flag set so I believe we are getting the discrete. The issue here is just getting the dropdown in the driver such that our profile is enabled on laptops.

This worked for me and SaveSettings worked. I ran the same code on desktop and didn’t seem to do anything which is good. So I think we are good. Sorry your SaveSettings is not working.

We also have the issue mentioned in one of those links that our main EXE does the NVIDIA profile stuff, so technically you need to run the application a 2nd time to get it. Putting the stuff into the installer seems like the solution. Not sure if we will go there or not.

I explored this a little with NVIDIA Inspector on a desktop. The SHIM settings do not seem to have any effect that I can find. I have not found any detailed documentation on these settings and do not know what they actually do. Let me know if you find some.

A custom profile in an installer would be ideal. It appears to me that you have to create a profile and then add EXE programs that will be set by it when they start. I am not sure how to do this within the code.

Not sure what the SaveSettings problem is, maybe permissions. I assume it works for you on a desktop as well.

For anybody interested, the “SaveSettings” problem was fixed by the latest driver 355.82.