OSX Seems too "eager" to use Dedicated Graphics [MBP 15" Late 2011]

Discussion in 'MacBook Pro' started by ScottishDuck, Feb 16, 2012.

  1. ScottishDuck macrumors 6502a


    Feb 17, 2010
    Argyll, Scotland
    The Intel 3000 GPU inside of Core i processors is a very capable chip, certainly capable of doing 1080p video and "light" 3D work, yet when Automatic graphics switching is enabled on my 15" MBP Late 2011, it is almost constantly using the dedicated AMD chip, even during very light work, draining the battery at an accelerated rate.

    What is the reasoning for this?

    Anyone else noticing this?
  2. Erasmus macrumors 68030


    Jun 22, 2006
    Hiding from Omnius in Australia
    Simply bad programming of some apps. For example, Firefox likes to use Discrete GPU even though there is no need to, and it still works fine if the discrete chip is forced off. However Safari, which was obviously coded with graphics switching in mind, tends to use the Integrated GPU.

    As far as I know, any default code that uses GPU will be run on discrete. I can only assume that it takes special consideration by the programmer to add support for running code on the integrated GPU, which many programmers don't bother to do.
  3. NutsNGum macrumors 68030


    Jul 30, 2010
    Glasgow, Scotland
    Have you downloaded gfxcardstatus? I run integrated all the time, pretty handy for squeezing a bit more battery life out of her, also!
  4. throAU macrumors 603


    Feb 13, 2012
    Perth, Western Australia
    +1 for gfxcardstatus.

    i set it to integrated only unless i'm running something explicitly 3d.

    the cause of the switching apparently is any app that uses core animation (i addition to openGL it would appear).

    which means even stuff like twitter (ffs) kicks off the discrete GPU.

    I agree, it needs to be fixed, but until apple make it more intelligent, gfxcardstatus is the way to keep your battery life.

    I can get a genuine 8 hrs browsing out of my 2011 15" pro with integrated graphics only, as soon as the discrete GPU kicks in life expectancy drops to about 2-2.5hrs on a full battery.... even when just browsing and running non-3d apps.

    its my one complaint with this machine really...
  5. natejohnstone@g macrumors regular


    Jan 6, 2007
    This is why I keep my 17" on "Battery Life" to force the smaller GPU. I only switch to the bigger one when I know I'll need it or if I notice issues.
  6. dusk007 macrumors 68040


    Dec 5, 2009
    Apple's so called automatic graphic switching is a broken thing. It always has been.

    You need to do it manually. Force the Intel GPU always unless you think you need the other or you mean to attach an external display.

    It is not bad programming of apps such as Erasmus says it is bad programming on Apples part. The problem is that without a quite big amount of work by the app developer it cannot just switch the GPU while running at least not without some possible problems. Thus it doesn't switch when load or task require the stronger GPU. It switches if there is any chance at all the application uses a graphical framework which can given the right tasks require a strong GPU.
    In a way if you have a app that just draws a red border around a windows and uses a graphical framework for a job that the CPU could do without any effort it will cause the dedicated GPU to take over. Because it doesn't know if the framework might not be used to its full extent which might require a stronger GPU.
    Why there isn't at the very least a simple way for any given app to tell the OS that it really doesn't need a lot of GPU power and is quite satisfied with the Intel GPU, is beyond me? I expect the problem is the context switching doesn't work very well or not at all. If a GPU says it is okay with HD 3000 and later another application requires the dGPU to kick in. The framework needs to be reinitialized. With iphoto it is very obvious. It starts fine, works well with the HD 3000 forced but if you switch the GPU while it is running. Some things don't work and some animations get so slow they must run in software.

    I hope Apple does come to its senses with the 2012 MBP update and use a proxy driver solution such as Nvidia Optimus or AMD ADS. Those have none of the problems and require zero extra work from developers. It is completely transparent to applications. In the end it would offer better battery life too if you end up using the dGPU much less frequently and it is the same if you run off the integrated GPU.
  7. macuser2134 macrumors member

    Feb 15, 2012
    This is a good question, because it reveals the very crux of the problem here. What I want to see is something like this Profiles business but simpler.

    There aren't many apps that need context switching - so lets not bother worrying about that for now. Since as you explained it would take a lot of extra development work to iron all that out.

    All I want is a simpler scheme. A booleen option I can set in a plist file. Either inside the .app bundle itself or 1 centralized file stored in ~/Library/Preferences. That lets me specify on a per-app basis which ones I want to launch into dGPU and which ones integrated. Then just 1 default setting for all apps, the ones i don't specify, or cant be bothered to set. That default of course would usually be Intel HD Graphics for mobile people (or possibly dGPU for those who are desktop-only). Whatever. Job done.

    If I want to open an App in the other graphics mode for just 1 time, I should be able to hold down some option key or something whilst clicking and launching the App. Job done.

    If Apple are uwilling to implement this, then I'm curious if there could be some sort of pretty simple hack to fool OS X when the application loads and it chooses which graphics to use. Some hack that hides the CoreAnimation framework being loaded. Whilst still actually loading the framework, perhaps just under a different name. Whatever is minimally sufficient so that the OS X graphics check is fooled. The hack could be tied in to a background task or system service if necessary. Using the same scheme explained above about setting up a plist file with all the preferences for each application.

    Surely there must have already been some investigation into this business elsewhere on the net? Kind regards.
  8. thundersteele macrumors 68030

    Oct 19, 2011
    The problem is that the discrete GPU supports a few graphics accelerations (OpenCL in particular) that the integrated GPU doesn't support. Applications written with performance in mind will, upon launch, ask the OS for the best available graphics features, and OSX will provide them by switching to the discrete GPU.

    There is a flag in the info.plist that you can set for some applications, and it will make them run using the integrated GPU. See my longer post about this for more information.

    As far as other hacks are concerned:
    I think the best approach might be to extend gfxcardstatus to detect application launches, and perform the graphics switch only for a set of "allowed" applications. I don't know how easy this would be to implement. In the meantime, just perform manual switching.
  9. ScottishDuck thread starter macrumors 6502a


    Feb 17, 2010
    Argyll, Scotland
    Thanks for all the posts about gfxcardstatus. Really useful!

    Hopefully Apple can sort out a better solution in the future.
  10. thundersteele macrumors 68030

    Oct 19, 2011
    Things are being optimized... e.g. the latest versions of flash very rarely trigger the discrete GPU... this has happened to a point where I sometimes use gfxcardstatus to force the discrete GPU, e.g. when web browsing becomes too choppy with a video playing on the side.

    Graphics switching will always remain a compromise. I hope that the 2013 Intel CPUs will have a GPU that is strong enough to make a discrete GPU obsolete. The next revision of thunderbolt might be fast enough to fully use an external middle class GPU, for gamers :)
  11. hammie14 macrumors regular


    Mar 18, 2010
    London, UK

Share This Page