In normal C/C++ SDL2 related app I write, adding the following code

extern "C" {
   _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}

causes the driver system with integrated and dedicated nvidia gpu, to auto 
select the dedicated nvidia gpu. 

See here for some explanation of the mechanism->
https://github.com/urho3d/Urho3D/issues/139
http://stackoverflow.com/questions/16823372/forcing-machine-to-use-dedicated-graphics-card


<http://stackoverflow.com/questions/16823372/forcing-machine-to-use-dedicated-graphics-card>

I can view the exports of the final executable with "dumpbin /exports 
<executable name>"

[dumpbin is a tool installed with visual studio C++ tools]


How can I make my go executable export this value symbol?

I searched go link documentation but could not find something useful to 
achieve this.

I did some tests with cgo and "//export" command with a simple var, but 
that did not have any effect on "dumpbin /exports" output (no symbols 
exported)


I can see which GPU the executable is using by inspecting it with "process 
explorer" and its "dedicated GPU memory usage"


The go build "go-sdl2" app, by default, uses the CPU's embedded low 
performance integrated GPU, since I can not export this value with the 
executable.


Thanks for any help.



-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to