Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Macbook Pro from switching to a high performance graphics card in Cocoa?

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?

like image 524
Alexey Blinov Avatar asked Nov 14 '10 12:11

Alexey Blinov


1 Answers

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.

like image 170
Thomas Zoechling Avatar answered Oct 11 '22 18:10

Thomas Zoechling