16 lines
216 B
Go
16 lines
216 B
Go
|
//+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")
|
||
|
}
|
||
|
}
|