Last Comment Bug 646043 - Hardware acceleration seems to require discrete GPU on Macs with two GPUs
: Hardware acceleration seems to require discrete GPU on Macs with two GPUs
[gs][workaround: comment 2][battery]
: perf
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86_64 Mac OS X
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Milan Sreckovic [:milan]
: 673896 691077 (view as bug list)
Depends on: 687864
Blocks: 568327
  Show dependency treegraph
Reported: 2011-03-29 06:46 PDT by Anthony Ricaud (:rik)
Modified: 2011-11-04 06:28 PDT (History)
26 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Anthony Ricaud (:rik) 2011-03-29 06:46:26 PDT
I've seen several user reports [1] saying that opening Firefox 4 enables the discrete GPU. While it may improve performance, it's also consuming a lot more battery than the integrated GPU.

I believe this is automatically done by OS X when doing some OpenGL calls. Maybe there is a way to disable the automatic switching?

[1] One report in French
Comment 1 User image Benoit Jacob [:bjacob] (mostly away) 2011-03-29 06:49:13 PDT
I've heard about that too. The on-board low-power GPU should be powerful enough for Layers acceleration so it is really unwanted behavior on the part of the OS that it enables the discrete GPU for that.

Does Core GL (CGL) provide some API to say 'hello, no need to enable the GPU for these OpenGL calls' ?
Comment 2 User image Anthony Ricaud (:rik) 2011-03-29 07:26:44 PDT
I've found this app that lets users select the GPU they want :

So somewhere in the code, there might be something to stay on the integrated GPU. Although I guess it is a system-wide force switch where we only want to say "Firefox doesn't need the integrated GPU"
Comment 3 User image Boris Zbarsky [:bz] (still a bit busy) 2011-03-29 09:24:08 PDT
Do we have Apple contacts we could ask about this?
Comment 4 User image Benoit Jacob [:bjacob] (mostly away) 2011-03-29 10:22:01 PDT
CC'ing Chris Marrin at Apple.
Comment 5 User image Jeff Muizelaar [:jrmuizel] 2011-05-12 11:28:19 PDT
We cause the use of the external GPU by calling code that does something like the following:

IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("AppleGraphicsControl"), &iterator);
service = IOIteratorNext(iterator);
/* passing 1 instead of 0 causes the external GPU to be used */
IOServiceOpen(service, mach_task_self(), 1, &switcherConnect);

I don't know why Safari gets a 0 and we get a 1.
Comment 6 User image Jeff Muizelaar [:jrmuizel] 2011-06-23 21:15:50 PDT
The WWDC 2011 slide suggest information about this:

 Pixel Format must track multiple GPUs
■ CGLFPAAllowOfflineRenderer • Supporting Integrated GPUs
■ Add Info.plist attribute NSSupportsAutomaticGraphicsSwitching = YES
Comment 7 User image Jeff Muizelaar [:jrmuizel] 2011-06-27 16:36:37 PDT
I quickly tried using NSOpenGLPFAAllowOfflineRenderers and couldn't get it to work. Safari does use NSOpenGLPFAAllowOfflineRenderers.
Comment 8 User image Anthony Ricaud (:rik) 2011-06-27 23:06:04 PDT
I've found this technical note:

Also, maybe checkout a 2010 session called "Taking Advantage of Multiple GPUs"
Comment 9 User image Jesse Ruderman 2011-09-03 13:39:42 PDT
Dup of bug 604135?
Comment 10 User image Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-10-01 17:01:59 PDT
*** Bug 691077 has been marked as a duplicate of this bug. ***
Comment 11 User image Jeff Muizelaar [:jrmuizel] 2011-10-08 05:53:06 PDT
This should be resolved on Nightly running on 10.7. Is it working properly?
Comment 12 User image Travis Tabbal 2011-10-29 10:00:51 PDT
Nightly downloaded 10/28/2011 seems to be working properly on 10.7.2 MBP early 2011. gfxCardStatus app set to Dynamic Switching, shows integrated GPU enabled with the Nightly running. Running FF7 release causes discrete GPU to enable under the same setup. Thanks for fixing this, it's nice to be able to leave it on dynamic.
Comment 13 User image Wayne Mery (:wsmwk, NI for questions) 2011-11-04 05:55:15 PDT
*** Bug 673896 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.