Hardware acceleration seems to require discrete GPU on Macs with two GPUs

RESOLVED FIXED

Status

()

Core
Graphics
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: rik, Unassigned)

Tracking

(Blocks: 1 bug, {perf})

Trunk
x86_64
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [gs][workaround: comment 2][battery], URL)

(Reporter)

Description

7 years ago
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 http://forum.macbidouille.com/index.php?s=&showtopic=222018&view=findpost&p=3414014
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' ?
(Reporter)

Comment 2

7 years ago
I've found this app that lets users select the GPU they want : https://github.com/codykrieger/gfxCardStatus

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"
Do we have Apple contacts we could ask about this?
CC'ing Chris Marrin at Apple.
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.
Blocks: 568327
The WWDC 2011 slide suggest information about this:

 Pixel Format must track multiple GPUs
■ CGLFPAAllowOfflineRenderer • Supporting Integrated GPUs
■ Add Info.plist attribute NSSupportsAutomaticGraphicsSwitching = YES
I quickly tried using NSOpenGLPFAAllowOfflineRenderers and couldn't get it to work. Safari does use NSOpenGLPFAAllowOfflineRenderers.
(Reporter)

Comment 8

6 years ago
I've found this technical note: http://developer.apple.com/library/mac/#technotes/tn2229/_index.html

Also, maybe checkout a 2010 session called "Taking Advantage of Multiple GPUs" http://developer.apple.com/videos/wwdc/2010/
Keywords: perf
Whiteboard: [gs][workaround: comment 2]

Updated

6 years ago
Whiteboard: [gs][workaround: comment 2] → [gs][workaround: comment 2][battery]

Comment 9

6 years ago
Dup of bug 604135?

Updated

6 years ago
Depends on: 687864
Duplicate of this bug: 691077
This should be resolved on Nightly running on 10.7. Is it working properly?

Comment 12

6 years ago
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.
Duplicate of this bug: 673896
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.