Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There is a big difference in both performance and power consumption between the two video cards in a MacBook Pro.

The problem is, I often forget which one I am running. This can end up with a dead battery while on an airplane pretty quickly. As far as I can tell, you have to open the Energy Saver System Preference to see which one is active.

Does anyone know of a tool that will display (in the menu bar, on the desktop, whatever) my current video card status? Especially good would be a terminal command that would report which one was active. I could use that as part of my GeekTool setup.

I'm also capable of writing my own tool if anyone happens to know where in the API I would look for this information.

Anyone have any ideas?

EDIT: The answers below concerning system_profiler are definitely a step in the right direction. The MBP shows information for BOTH video cards, regardless of which is active... BUT will show "display not connected" for the display attached to the inactive card. I should be able to script something that figures it out from there.

EDIT2: The key is getting the output from system_profier in the xml format (using the -xml switch). Scripts are below to parse the resulting plist and display the result.

share|improve this question

5 Answers 5

Assuming system_profiler will only report the active display (I'm not near a MBP to know) how about plugging this into GeekTool:

system_profiler | grep GeForce | sed -e 's/:/ /'

Edit:

If it lists the non active one on the same line as "display not connected" how about:

system_profiler | grep GeForce | grep - v "display not connected" | sed -e 's/:/ /'

If it lists the active one first how about:

system_profiler | grep GeForce | head -n 1 | sed -e 's/:/ /'

If active is second then replace head with tail.

share|improve this answer
    
Why do you substitute the colons for spaces? –  Dan the Man Oct 10 at 17:51

http://codykrieger.com/gfxCardStatus

This is a small app that resides in the bar and gives you not only the card in use but also the control over how and when to switch the card. For example you can set only integrated graphics card to run when on battery power - etc...

share|improve this answer
    
gfxCardStatus has been updated for Mountain Lion and the Retina MacBook Pro. –  slothbear Aug 30 '12 at 21:43
up vote 3 down vote accepted

Using the basic idea presented in the other two answers, I wrote the following scripts to determine if you are using the "correct" video card (Correct = "on battery and using the 9400" or "on ac adapter and using the 9600")

I have no idea how fragile these scripts are... they rely on specific data appearing in a particular order in the system_profile plist... but this order seems consistent on my machine. Placing it here for anyone who ever finds this via Google.

Ruby: (requires the "Plist" gem to be installed)

# video_profiler.rb
require 'rubygems'
require 'plist'

# calculate video data
data = `system_profiler SPDisplaysDataType -xml`
structured_video_data = Plist.parse_xml(data)
display_status = structured_video_data[0]["_items"][0]["spdisplays_ndrvs"][0]["spdisplays_status"]

if (display_status.eql?('spdisplays_not_connected')) then 
    card = '9400'
else
    card = '9600'
end

# calculate power source data
data = `system_profiler SPPowerDataType -xml`
structured_power_data = Plist.parse_xml(data)
on_ac_power = (structured_power_data[0]["_items"][3]["sppower_battery_charger_connected"] == 'TRUE')

# output results
if (on_ac_power and card.eql?'9400') or (not on_ac_power and card.eql?'9600'):
    result = 'You\'re on the wrong video card.'
else
    result = "You\'re on the correct video card."
end

puts(result)

Python:

# video_profiler.py
from subprocess import Popen, PIPE
from plistlib import readPlistFromString
from pprint import pprint
sp = Popen(["system_profiler", "SPDisplaysDataType", "-xml"], stdout=PIPE).communicate()[0]
pl = readPlistFromString(sp)
display_status = pl[0]["_items"][0]["spdisplays_ndrvs"][0]["spdisplays_status"]
if (display_status == 'spdisplays_not_connected'): 
    card = '9400'
else:
    card = '9600'

# figure out battery status
sp = Popen(["system_profiler", "SPPowerDataType", "-xml"], stdout=PIPE).communicate()[0]
pl = readPlistFromString(sp)
on_ac_power = (pl[0]["_items"][3]["sppower_battery_charger_connected"] == 'TRUE')


if (on_ac_power and card == '9400') or (not on_ac_power and card == '9600'):
    result = 'You\'re on the wrong video card.'
else:
    result = "You\'re on the correct video card."

pprint(result)
share|improve this answer

I know that this question is rather old - but for those still stumbling upon it, it might be nice to know that there are other choices as well. For the simplest solutions, one could check out GFXCheck, which is a simple application which will show the active graphics card in the

share|improve this answer
2  
or gfxcardStatus, which additionally allows you to choose which one to use manually or automatically based on your power profile. –  Robert S Ciaccio Dec 1 '10 at 16:26
2  
Actually, shortly after writing this post I found gfxCardStatus and installed that instead - way better. Has automatic switching and a less annoying interface. –  micdah Dec 2 '10 at 14:16

I don't have one of the new MacBook Pros here but you should be able to see the active Card via the System Profiler. In the terminal just use system_profiler to see the system configuration:

Terminal Screenshot

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.