I have a laptop in a docking station on which I cannot select GPU preference at autostart. The laptop has one integrated Intel GPU and one "extra" Nvidia GPU.
I can select GPU preference clicking the context menu which has the intended effect: my program reports Intel/Nvidia as graphics vendor as expected (using OpenGL API glGetString(GL_VENDOR)). However the application is supposed to be autostarted (semi-embedded scenario) and for what I know I cannot autostart it using a context menu (right?)
I've tried editing the windows registry, both manually and using the "Graphics Settings". Both GPU show up (Intel as Power Saving GPU, Nvidia as High Performance GPU). Despite what I set here the application says it is running the Intel GPU. Editing the registry I've tried setting both the program and system default GPU preference - with no effect whatsoever.
Starting the Nvidia control panel to set GPU preference opens a dialog saying "no display connected" and exits. Looking into dxdiag the display is connected to the Intel GPU, and there is another tab labeled "Render" where the Nvidia GPU is listed as "Render only display device". Maybe important, maybe not.
Google searches pulls me to pages where above solutions are suggested. They are obviously not working out for me.
I suspect the docking station is to blame since it works just fine without it.
Question: How to autostart my application with Nvidia GPU preferred, considering registry and Nvidia Control Panel fails and opening using context menu selection works?
Reading this discussion on docking station GPU issue, I followed the advice of one comment to configure duplicate displays instead of extended and registry GpuPreference=2 as default. Works great, but I'm not to happy about being limited to display duplication, and my program halts when switching between the modes, hence leaving the question open.