14

All 2010 Macbook Pros come with two graphics cards — a low-performance built-in Intel HD one and a high-performance discrete NVIDIA one — and it switches between them on the fly depending on the needs of the running applications.

I have a simple Cocoa application that consists of just a menu bar item with a NSTextField in it. All I do is update the text field with an NSAttributedString from time to time. The trouble is that my application switches my Macbook Pro to use the high-performance NVIDIA card (I used the gfxCardStatus tool to confirm this).

What could possibly need the high-performance card? Is there a known list of reasons for the applications to require high-performance graphics card? Is there a way to force the computer to use the discrete graphics card?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Alexey Blinov
  • 1,684
  • 3
  • 17
  • 25

2 Answers2

19

There is a good article about GPU switching in the newer MacBook Pros at Ars Technica. I noticed that OS X switches to the dedicated GPU if you

  • Start an application that links against OpenGL
  • Connect a second display

The code of gfxCardStatus is open source. And it seems that the relevant part is located in switcher.m. You can take a closer look here.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Thomas Zoechling
  • 34,177
  • 3
  • 81
  • 112
  • 1
    Thanks for the plug. :) It is indeed open source, and I encourage you to look at it should you desire - however, I would not recommend adding the switching code into other applications. One application trying to control which GPU is active is enough. I managed to corrupt one of my kernel extensions by running 3 copies of it simultaneously and trying to switch with each of them right after the other, just for testing purposes - bad idea. – codykrieger Nov 21 '10 at 09:59
  • 8
    Additionally, anything that uses CALayers will trigger a switch to the discrete GPU. – codykrieger Nov 21 '10 at 10:01
  • 1
    That was it Cody! As soon as I set wantsLayer on one of the controls to NO it stopped switching to discrete GPU. You should put it down as an answer. – Alexey Blinov Nov 22 '10 at 18:10
8

In MacOS 10.7 you can specify a setting in the PList to stop going to discrete graphics:

https://developer.apple.com/library/mac/qa/qa1734/_index.html

Needs to be a 2011+ MacBook Pro.

Alexp
  • 520
  • 1
  • 4
  • 15