Initial commit

This commit is contained in:
2022-01-20 21:58:50 +08:00
commit b44d41ec66
86 changed files with 5415 additions and 0 deletions

View File

@ -0,0 +1,10 @@
// define the two symbols on Windows so that application
// could benefit from using the more powerful discrete GPU
#if defined (_WIN32)
__declspec(dllexport) unsigned long NvOptimusEnablement = 1;
__declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1;
#endif

View File

@ -0,0 +1,3 @@
package gpu_preference
import "C"

View File

@ -0,0 +1,15 @@
//+build nvidia
package gpu_preference
import (
"os"
"runtime"
)
func init() {
if runtime.GOOS == "linux" {
os.Setenv("__NV_PRIME_RENDER_OFFLOAD", "1")
os.Setenv("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
}
}