SOLUTION 1
I found this document:
“Starting with the Release 302 drivers, application developers can direct the Optimus
driver at runtime to use the High Performance Graphics to render any application–even
those applications for which there is no existing application profile.”
We must export a variable NvOptimusEnablement that Optimus driver is supposed to detect an enable the nvidia card:
extern "C" {
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}
Even with that variable it’s not working!!! I create a little program in C++ to test it. I even used NVidia Inspector to force some values: nothing!!! I verify the percentage of use with MSI AfterBurner and NVidiaInspector.
For the moment, only google Sketchup and 3DS Max are recognized by the Optimus driver on my computer.
Not working: unreal engine 4, JMonkey Engine, Autodesk Inventor, SolidWorks, etc.
Source code: NVidia Optimus Driver - TEST - Pastebin.com
SOLUTION 2
Some people says that if you call just a CUDA function, the optimus driver will detect it and enable the NVidia card.
Not tested because I’ve to install the CUDA SDK, etc.
SOLUTION 3
I also found an another tricks:
https://forums.geforce.com/default/topic/748213/nvidia-optimus-big-problem-with-my-gtx660m/?offset=24
My solution - works without reboot (!):
After a deep scan - i used sysinternals Tools to understand when optimus is being invoked, and why it cannot start to activate the right GFX choosen in the nvidia control Center.
It is - as i thought - a really simple Problem in the registry.
Each time an appliction starts, nvidia Needs to be triggered to start correctly.
This is done by a registry entry : App_InitDlls
Here you can tell Windows what Needs to be triggered when an app starts.
x32bit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows
x64bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows
There you find the link to the NVINIT.DLL or NVINITx.DLL which lets nvidia invoking the right GFX.
…alright…
But under the reg key RequireSignedAppInit_DLLs the System requires a signed DLL to be invoked/triggered - the value of the key is 1 (true).
After Setting this value to 0 (false) - my System runs perfectly!!
Solution:
set the following keys to 0:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\RequireSignedAppInit
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\WindowsNT\CurrentVersion\Windows\RequireSignedAppInit
Ok, that solution works sometimes but by example Autodesk Inventor goes into an endless loop, Unreal Engine 4 too, etc.
I hope it will help.