1

I'm experiencing issues in my application running on NVIDIA Optimus platform: essentially is selects the integrated card instead of the discrete card. Sigh.

This is probably caused by updating the driver from 297.67 to the current one (376). So I tried to follow the NVIDIA indications, but I failed at every try. My application is based on .NET, and it uses my own wrapper to P/Invoke OpenGL functions.

Here is the options tried:

  • Global Variable NvOptimusEnablement: I'm not aware how to expose such element in my executable/library. It is actually possible using UnmanagedExport, or modifying the IL using a post-build event; sadly it's quite limiting because you need to fix binary architecture. I didn't tried this yet.
  • Static Library Bindings: apart that a DLL requires dynamic linking, I tried to load nvapi64.dll or nvapi.dll at startup without success. However, I've downloaded the NvAPI SDK, and it contains only static libraries; additionally I found that the locally available NvAPI DLLs are almost empty and they does not contains any useful symbol (I tried this, without success).
  • Global Profile Settings: I've currently set a NVIDIA graphics card as default; I've also tried Auto-Select options and created custom profiles for my application. The result is that the GLControl design code shows that the VS2015 is running on NVIDIA (as shown in picture, the System.Windows.Forms designer view of my Form)

enter image description here

The problem is that during debugging the application shows that it's using Intel rendered instead of the NVIDIA renderer.

Am I missing something else? How I can be sure to run on NVIDIA cards programmatically during debug?

Just for the record, the application can be built from this repository of mine.


Update: it seems that the process bitness is affecting the NVIDIA driver behavior. If I run my application forced at 32 bit (x86 architecture), the NVIDIA driver works as expected, while setting the archicture to x64 or AnyCPU, it always fallback to the integrated Intel processor. Not very useful, since I'm targeting x64 architecture.

Community
  • 1
  • 1
Luca
  • 11,646
  • 11
  • 70
  • 125

0 Answers0