Ebiten: gpu: Export globals NvOptimusEnablement and AmdPowerXpressRequestHighPerformance to force high-perf rendering

Created on 18 Jul 2020  路  4Comments  路  Source: hajimehoshi/ebiten

The problem
For laptops with multiple GPUs, its likely that applications wont launch using the discrete GPU, but rather than integrated GPU. This can lead to games under-performing by default which is less than ideal.

Proposed solution
Investigate possible ways we can set these global variables so that Ebiten applications will use the more powerful CPU.
Ideally, I'd like to see if we could achieve this without CGo, but at the very least, someone was able to get this behavior working (see the last reply in this thread)
https://groups.google.com/forum/#!topic/golang-nuts/7OHZcXUegF0

Examples of other lib implementations

Other related resources:

documentation feature windows performance

All 4 comments

Hi, thank you for your suggestion.

Is this issue only for Windows?

Ideally, I'd like to see if we could achieve this without CGo, but at the very least, someone was able to get this behavior working (see the last reply in this thread)

Hm, as long as this requires Cgo, Ebiten cannot adopt this.

As this option can be applied on the user side, adding a tip to the documentation sounds fine. What do you think?

I think that sounds like a good idea. I spent some of the day exploring some options but couldn't find a way to do this without CGo unfortunately :(

I was able to put a library together with tests though, so should the documentation on Ebiten just point here?
https://github.com/silbinarywolf/preferdiscretegpu

Thanks! I think I'll update performance tips with your link. Thank you for your experiments!

Was this page helpful?
0 / 5 - 0 ratings