How does OS X decide when to switch graphics processors?
I use my early 2011 15" MacBook Pro for nearly everything under the sun - I often monitor which GPU is active using gfxCardStatus. I've noticed some idiosyncrasies in how OS X decides when to switch graphics processors:
- MOST apps that require X11 will trigger auto-switching, but not all
- It seems every app that requires java will trigger the auto-switching, though I've not tested this with non-GUI apps.
- Some apps (like Mathematica or XCode) which COULD require a high-performance GPU will force movement to the discrete card straight away, even if only fired up for a trivial task (dynamic switching in-app would be cool, off topic)
- Many legacy apps (silverlight) which have no business asking for my discrete card will force it regarless
- Finally, some apps (GIMP, in particular) which could definitely benefit from a discrete GPU actually don't ask for it at all.
Does Apple document how it chooses when to switch cards? Can apps make an OS-level request for the discrete card if it exists?
Solution 1:
On a high level, it's like an automatic transmission - when you press the gas gently, the throttle increases but when you stomp on the accelerator pedal the engine downshifts the transmission to increase the mechanical advantage.
You can influence switching to the powerful GPU by hitting the API with significant work and expect the "transmission" to dispatch that load to the non-integrated GPU.
The documentation on the API are all in Xcode (and online too, but I prefer using search on Xcode to hunt for a document).
I would start with:
- xcdoc://?url=developer.apple.com/library/etc/redirect/xcode/mac/1153/technotes/tn2335/_index.html (online web link of the same article)
Those links cover the Mac Pro and the "What you should know when using OpenCL" section contains a helpful note that WWDC 2013 Session 508: Working with OpenCL describes how to switch between two GPUs in a Mac portable using power considerations.