-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable option to not switch to dedicated GPU on mac also with an integrated GPU #894
Conversation
Thanks for the PR. As usual I'm not familiar enough with MacOS to have an opinion on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked into this same issue and this is the correct and necessary thing to do. It shouldn't break anything existing since you also need the Info.plist key for it to actually do anything, and even with that key most things should just work.
This is also pretty much a prerequisite for nice GUI frameworks on OSX. Nobody wants their non-intensive apps switching to the high-power GPU.
Err I totally forgot about this PR. |
Thanks for the insight @trishume |
Seems to fail the CI on macOS(Rust nightly): https://travis-ci.org/tomaka/glutin/builds/251043521 |
@lilianmoraru the CI breakage isn't related to this PR, it seems to be the |
This commit is cherry-picked from the upstream PR rust-windowing#894 .
Specify the NSOpenGLPFAAllowOfflineRenderers attribute. This commit is cherry-picked from the upstream PR rust-windowing#894 . Without this attribute, on dual-GPU Macs, creating the context will always force a switch to the dedicated GPU. With this attribute, applications can opt in to using the integrated GPU by adding the `NSSupportsAutomaticGraphicsSwitching` key to their app bundle's Info.plist. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/glutin/137) <!-- Reviewable:end -->
Adding this flag allows an app built with glutin to run without triggering a switch to the dedicated GPU on a mac (eg on a macbook with low power intel GPU and high power dedicated GPU).
This is mainly for this issue on the alacritty project
From testing, the app also needs to set
NSSupportsAutomaticGraphicsSwitching
totrue
in the Info.plist in its app bundle to stop the GPU switch. That means this flag is probably OK to add by default since app behaviour won't change without also having that Info.plist setting.There are some details about multiple GPU support in this technical note