-
Notifications
You must be signed in to change notification settings - Fork 2
Description
I've stumbled across your blog post http://lucasmagder.com/blog/2014/05/exporting-data-symbols-in-c-for-nvidia-optimus/ ending with "I've never tested this on an optimus system". Well, I just did that as a proof of concept and it works. I've learned about this problem yesterday due to the fact that by default my poor integrated graphics is used for my 3D OpenGL WPF application.
In that post you wrote
Our address definitely doesn't contain the right DWORD to control the Optimus state, it actually has a jmp into some code
following by quite some magic code that I didn't understand. I wanted to let you know that this code is not required at all. A static method stub and the post build to inject the .export [0] as NvOptimusEnablement are sufficient to make NV activate its GPU.
FYI: I used the SharpGL nuget package to initialize a OpenGL context and query vendor and renderer. Your magic rewrite makes my Nvidia card being used while the integrated graphics shows up when I disable the post build (or rename the method stub).