Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Hardware > Notebooks > MacBook Pro

Reply
 
Thread Tools Search this Thread Display Modes
Old May 7, 2010, 03:18 PM   #401
ah-
macrumors member
 
Join Date: May 2010
I took a look at AppleGraphicsControl the last few days and found a way to manually switch cards.

Warning: This will likely make your laptop explode and kill some kittens, so don't run it if you're not absolutely certain what you're doing. Also, I'm not responsible if something like this happens.

Code is at http://pastry.se/554001/

This talks directly to the switching driver, at the moment it's able to force a graphics card switch (regardless if you're in automatic switching mode or not) and to disable switching completely (but it's not possible to reenable it without a reboot atm), look at the code for more.

It's not finished yet, but i think it's possible to extend it so you can choose between automatic switching, always intel and always nvidia.

Another thing I'd like to do is to implement a black/whitelist for applications in dynamic switching but I don't know how it marks an application as bad exactly.

Edit: Everyone likes screenshots, so here's one with X11 running using the intel chip: click

Last edited by ah-; May 7, 2010 at 03:24 PM.
ah- is offline   0 Reply With Quote
Old May 7, 2010, 04:01 PM   #402
Benni-chan
macrumors newbie
 
Join Date: Apr 2010
at last, finally some good news
so glad, that our dreams can really come true

looking forward to see this included in gfxcardstatus
Benni-chan is offline   0 Reply With Quote
Old May 7, 2010, 04:10 PM   #403
MBHockey
macrumors 68040
 
Join Date: Oct 2003
Location: New York
Very interesting

Can't wait to see if we'll be able to do an "intel only" for battery power kind of thing.
MBHockey is offline   0 Reply With Quote
Old May 7, 2010, 04:37 PM   #404
bitninja
macrumors regular
 
Join Date: Jun 2007
Location: California, USA
Quote:
Originally Posted by ah- View Post
I took a look at AppleGraphicsControl the last few days and found a way to manually switch cards.
@ah-: I've got this working in the context of gfxCardStatus - nice work! Right now I've got a menu item for toggling the GPU that's in use, and it works great. I hesitate to uncomment the method call that disables the automatic switching for fear of my laptop and kittens dying...I need this laptop for a presentation tomorrow. After that I'm free to do whatever I wish with it, but not until then.
__________________
http://codykrieger.com
bitninja is offline   0 Reply With Quote
Old May 7, 2010, 04:43 PM   #405
tufty
macrumors newbie
 
Join Date: Jul 2002
Great detective work! I was starting to have some hope because many Apple apps do not switch GPU, but do things that third party ones do, so I suspect Apple has some private list for their apps (at least the ones that they know don't need nVidia).

I did a battery test last night watching the UK election, light surfing and chatting, and got 4.5 hours on nVidia. Not very good.
tufty is offline   0 Reply With Quote
Old May 7, 2010, 04:56 PM   #406
cube
macrumors G3
 
Join Date: May 2004
Is there an app that supports the 2008 Unibody?
cube is online now   0 Reply With Quote
Old May 7, 2010, 05:27 PM   #407
bitninja
macrumors regular
 
Join Date: Jun 2007
Location: California, USA
Interesting, it seems like it doesn't switch back to the 330M if you've manually switched GPUs and you launch another app that would normally trigger it. e.g. Launch Chrome, switch to Intel, then launch Tweetie. It stays on Intel. I'm pushing out v1.6 in a couple minutes - should account for the 'external display' item in the dependent process list and includes a menu item that switches GPUs upon clicking it, but doesn't include the ability to disable automatic switching.

Give me a few minutes!
__________________
http://codykrieger.com
bitninja is offline   0 Reply With Quote
Old May 7, 2010, 05:31 PM   #408
ah-
macrumors member
 
Join Date: May 2010
Quote:
Originally Posted by bitninja View Post
Interesting, it seems like it doesn't switch back to the 330M if you've manually switched GPUs and you launch another app that would normally trigger it. e.g. Launch Chrome, switch to Intel, then launch Tweetie. It stays on Intel. I'm pushing out v1.6 in a couple minutes - should account for the 'external display' item in the dependent process list and includes a menu item that switches GPUs upon clicking it, but doesn't include the ability to disable automatic switching.

Give me a few minutes!
It switched from Intel to Nvidia sometimes when I _closed_ X11 after switching manually before. That's why I'm working on disabling dynamic switching.
ah- is offline   0 Reply With Quote
Old May 7, 2010, 05:46 PM   #409
huythanhv2
macrumors regular
 
Join Date: Apr 2010
Quote:
Originally Posted by bitninja View Post
Interesting, it seems like it doesn't switch back to the 330M if you've manually switched GPUs and you launch another app that would normally trigger it. e.g. Launch Chrome, switch to Intel, then launch Tweetie. It stays on Intel. I'm pushing out v1.6 in a couple minutes - should account for the 'external display' item in the dependent process list and includes a menu item that switches GPUs upon clicking it, but doesn't include the ability to disable automatic switching.

Give me a few minutes!
Bought my MacbookPro i7 3 weeks ago and still haven't got it yet to try on ur fantastic work but please know that even I haven't tried it yet I do really appreciate your contribution to the Mac community =)

Take care =)
huythanhv2 is offline   0 Reply With Quote
Old May 7, 2010, 05:49 PM   #410
bitninja
macrumors regular
 
Join Date: Jun 2007
Location: California, USA
v1.6 is up! See my previous post for details. "Check for Updates" or manually download at the link in my signature.

As usual, let me know if you have any issues! I still have a couple more things to do that I had planned for this release, but I wanted to push out this functionality as soon as possible so it's easy for the less technically inclined to test ah's code.

Quote:
Originally Posted by huythanhv2
Bought my MacbookPro i7 3 weeks ago and still haven't got it yet to try on ur fantastic work but please know that even I haven't tried it yet I do really appreciate your contribution to the Mac community =)

Take care =)
No problem at all! Please let me know how it works for you when it shows up.

Thanks!
Cody
__________________
http://codykrieger.com
bitninja is offline   0 Reply With Quote
Old May 7, 2010, 07:18 PM   #411
bitninja
macrumors regular
 
Join Date: Jun 2007
Location: California, USA
I've decided to open-source gfxCardStatus. I don't feel that it's right to include ah's code without properly crediting him, and this way everything that's going on would be a bit more transparent. I'll post the GitHub link soon.

@ah-: any particular name you'd like me to use in crediting you for your work?

Cody
__________________
http://codykrieger.com
bitninja is offline   0 Reply With Quote
Old May 7, 2010, 08:49 PM   #412
Libertine Lush
macrumors 6502a
 
Join Date: Nov 2009
Wow, switchable GPU implementation! It's a Friday night; I'm at home; and I don't care. This is awesome. Thank you, Cody!

Oddily, my battery runtime goes up a few minutes when I switch to the Nvidia.
Libertine Lush is offline   0 Reply With Quote
Old May 7, 2010, 08:57 PM   #413
bitninja
macrumors regular
 
Join Date: Jun 2007
Location: California, USA
Quote:
Originally Posted by Libertine Lush View Post
Wow, switchable GPU implementation! It's a Friday night; I'm at home; and I don't care. This is awesome. Thank you, Cody!

Oddily, my battery runtime goes up a few minutes when I switch to the Nvidia.
No problem! Thank ah, as well - all I did was modify his code to fit in the context of gfxCardStatus.

Regarding the battery life estimation, that's strange. I usually keep the battery percentage in my menu bar, not the time, so I haven't noticed that. Does it eventually adjust and reflect the correct time remaining?
__________________
http://codykrieger.com
bitninja is offline   0 Reply With Quote
Old May 7, 2010, 09:04 PM   #414
Libertine Lush
macrumors 6502a
 
Join Date: Nov 2009
Quote:
Originally Posted by bitninja View Post
Regarding the battery life estimation, that's strange. I usually keep the battery percentage in my menu bar, not the time, so I haven't noticed that. Does it eventually adjust and reflect the correct time remaining?
I've switched it back and forth to compare, almost 10 times. Most times it still goes down with the Intel GPU. Peculiar. Though completely unrelated to your program.
Libertine Lush is offline   0 Reply With Quote
Old May 7, 2010, 09:07 PM   #415
bitninja
macrumors regular
 
Join Date: Jun 2007
Location: California, USA
Quote:
Originally Posted by Libertine Lush View Post
I've switched it back and forth to compare, almost 10 times. Most times it still goes down with the Intel GPU. Peculiar. Though completely unrelated to your program.
Very peculiar indeed. It may be one of the kinks still present in ah's code.

@ah-: is it possible that the switch is taking place, but it's not actually switching off the power to the 330M?
__________________
http://codykrieger.com
bitninja is offline   0 Reply With Quote
Old May 7, 2010, 09:25 PM   #416
neilio
macrumors newbie
 
Join Date: Oct 2004
Has anyone else noticed if you manually switch to the intel graphics the section of any app that uses core animation is visually broken?

Here's what Tweetie looks like with the intel card switched on:

http://neil.io/XQL64+

And here's Path Finder:

http://neil.io/XQM2v+

Restarting the apps doesn't fix the issue. It's as if any part of an application that calls the frameworks that turn on the nvidia card disappears.

I'm *super* happy this option exists, but it looks like there needs to be some internal massaging by Apple to truly make it work.
neilio is offline   0 Reply With Quote
Old May 7, 2010, 09:34 PM   #417
bitninja
macrumors regular
 
Join Date: Jun 2007
Location: California, USA
Quote:
Originally Posted by neilio View Post
Has anyone else noticed if you manually switch to the intel graphics the section of any app that uses core animation is visually broken?
Hmm...haven't noticed that. Tweetie looked fine for me. Which model MBP do you have? Can anyone else confirm this behavior?
__________________
http://codykrieger.com
bitninja is offline   0 Reply With Quote
Old May 7, 2010, 09:36 PM   #418
neilio
macrumors newbie
 
Join Date: Oct 2004
Quote:
Originally Posted by bitninja View Post
Hmm...haven't noticed that. Tweetie looked fine for me. Which model MBP do you have? Can anyone else confirm this behavior?
What happens when you close the Tweetie window and open a new one (with intel graphics forced on)?

If you leave the window open, it works fine, but as soon as you close it, poof.

I'm running a 15-inch i7.
neilio is offline   0 Reply With Quote
Old May 7, 2010, 09:41 PM   #419
ah-
macrumors member
 
Join Date: May 2010
Quote:
Originally Posted by bitninja View Post
I've decided to open-source gfxCardStatus. I don't feel that it's right to include ah's code without properly crediting him, and this way everything that's going on would be a bit more transparent. I'll post the GitHub link soon.

@ah-: any particular name you'd like me to use in crediting you for your work?

Cody
Great move, I'm looking forward to the open source version. There's a lot of potential for people to improve gfxCardStatus and it's a solid base.
Btw., just ah is fine by me.

Quote:
@ah-: is it possible that the switch is taking place, but it's not actually switching off the power to the 330M?
I don't think so but it's possible. While experimenting on my laptop the logs showed that the 330M gets always powered down and the intel chip stays on all the time, even when the 330M is selected. So if anything the battery life should get better when you select the intel card.

Quote:
Has anyone else noticed if you manually switch to the intel graphics the section of any app that uses core animation is visually broken?
That's probably the reason why Apple disabled this option and I don't think we can do anything about it. But I'll look into it sometime.

In other news, I'm working on getting more info directly out of the driver like which cards are powered on and if dynamic switching is enabled. There's also an option to get the old switching behavior which forces you to log out before switching in case anyone misses that
But I highly doubt this works the other way around and I don't have access to an older mbp to test it.
ah- is offline   0 Reply With Quote
Old May 7, 2010, 09:48 PM   #420
IceBreakerG
macrumors newbie
 
Join Date: Apr 2010
Location: Cordova, TN
This is awesome work. Thanks guys! I have Yahoo Messenger running, and also loaded up iPhoto and Photo Booth (neither of them switched to the nVidia GPU when I started them though). I didn't notice anything out of the ordinary while they were running on the Intel GPU though. So I'm not sure if any other apps will have the same problems as what neilio is seeing. So far so good though. This is awesome though!
__________________
2010 15" MacBook Pro | 2.4GHz Core i5-520M | 4GB RAM | 500GB Hitachi 7K500 HDD
nVidia GeForce GT 330M | OS X 10.6.3 | Windows 7 Ultimate x64
IceBreakerG is offline   0 Reply With Quote
Old May 7, 2010, 09:51 PM   #421
MBHockey
macrumors 68040
 
Join Date: Oct 2003
Location: New York
Wow, never thought this would come so fast! Great job guys!

Looks like it's definitely working. When I open Starcraft 2 the nVidia GPU gets fired up but when I switch them the FPS at the menu screen drops from 80 to 35 haha
MBHockey is offline   0 Reply With Quote
Old May 7, 2010, 11:15 PM   #422
ah-
macrumors member
 
Join Date: May 2010
New Version done, with support for "use intel only": http://pastry.se/557002/

I wasn't able to reproduce the tweetie bug, if someone find a reliable way to trigger the bug please tell me. Also battery life goes way up for me when using the intel graphics.

And it doesn't look like it's possible to change the behavior of the apple dynamic switching, so there won't be black/whitelists in addition to the apple switching.
But I think we could just implement our own Optimus-like switching with a custom blacklist of applications that trigger the nvidia gpu. And different profiles when running on battery or plugged in. Oh, the possibilities

I really hope someone will implement all this as I have almost no experience with mac programming and would rather leave all the gui work to someone with the right skills. So please post your ideas how the interface could look like!
ah- is offline   0 Reply With Quote
Old May 8, 2010, 12:45 AM   #423
murdercitydevil
macrumors 68000
 
murdercitydevil's Avatar
 
Join Date: Feb 2010
Location: california
Quote:
Originally Posted by ah- View Post
New Version done, with support for "use intel only": http://pastry.se/557002/

I wasn't able to reproduce the tweetie bug, if someone find a reliable way to trigger the bug please tell me. Also battery life goes way up for me when using the intel graphics.

And it doesn't look like it's possible to change the behavior of the apple dynamic switching, so there won't be black/whitelists in addition to the apple switching.
But I think we could just implement our own Optimus-like switching with a custom blacklist of applications that trigger the nvidia gpu. And different profiles when running on battery or plugged in. Oh, the possibilities

I really hope someone will implement all this as I have almost no experience with mac programming and would rather leave all the gui work to someone with the right skills. So please post your ideas how the interface could look like!
I second the above. It would be really nice to set which programs trigger different card usage. for instance, I like using chrome but it always makes the 330M kick in, so I'm back to firefox. If you could, hopefully, in the next release, add this, it would be a huge step forward. Pity that apple didn't include this, at the very least, as an optional functionality. Also, I would love to see an option to make the 330M kick in whenever the MBP is plugged into the wall, regardless of apps running. Awesome work, by the way.
__________________
15" High-Res Anti-Glare Macbook Pro, 2.66 GHz Core i7, 8GB RAM, nVidia 330M 512MB, 120GB Vertex 2
iPhone 4 32GB
Please search before you PM me about Wallpapers/Icons/Themes/etc!
murdercitydevil is offline   0 Reply With Quote
Old May 8, 2010, 12:55 AM   #424
KingSpeedy
macrumors newbie
 
Join Date: Apr 2010
Just reverted back to 1.5. I started having horrible graphic corruption with the iGPU, which was fixed by switching to the dGPU. Then I started to get alarming fan noises coming from the back of the laptop. Reverted to the 1.5, and have had no problems so far.
KingSpeedy is offline   0 Reply With Quote
Old May 8, 2010, 01:09 AM   #425
bitninja
macrumors regular
 
Join Date: Jun 2007
Location: California, USA
Quote:
Originally Posted by MBHockey View Post
Wow, never thought this would come so fast! Great job guys!

Looks like it's definitely working. When I open Starcraft 2 the nVidia GPU gets fired up but when I switch them the FPS at the menu screen drops from 80 to 35 haha
Haha, nice! That's proof enough for me.

Quote:
Originally Posted by ah-
New Version done, with support for "use intel only": http://pastry.se/557002/

I wasn't able to reproduce the tweetie bug, if someone find a reliable way to trigger the bug please tell me. Also battery life goes way up for me when using the intel graphics.

And it doesn't look like it's possible to change the behavior of the apple dynamic switching, so there won't be black/whitelists in addition to the apple switching.
But I think we could just implement our own Optimus-like switching with a custom blacklist of applications that trigger the nvidia gpu. And different profiles when running on battery or plugged in. Oh, the possibilities

I really hope someone will implement all this as I have almost no experience with mac programming and would rather leave all the gui work to someone with the right skills. So please post your ideas how the interface could look like!
Nice! I'll implement this as soon as I get a few moments. I'll be super busy tonight and all day tomorrow. Next release will be the first official version up on GitHub.

Quote:
Originally Posted by KingSpeedy
Just reverted back to 1.5. I started having horrible graphic corruption with the iGPU, which was fixed by switching to the dGPU. Then I started to get alarming fan noises coming from the back of the laptop. Reverted to the 1.5, and have had no problems so far.
That's unfortunate - which applications specifically did you experience the graphics corruption in? And by "alarming fan noises," do you mean that they just became loud, or were they whining? Which model MBP do you have?

Thanks!

Quote:
Originally Posted by murdercitydevil
I second the above. It would be really nice to set which programs trigger different card usage. for instance, I like using chrome but it always makes the 330M kick in, so I'm back to firefox. If you could, hopefully, in the next release, add this, it would be a huge step forward. Pity that apple didn't include this, at the very least, as an optional functionality. Also, I would love to see an option to make the 330M kick in whenever the MBP is plugged into the wall, regardless of apps running. Awesome work, by the way.
Agreed. I like Chrome as well. A whitelist would be great, and I dig the power source-based GPU changing idea. Thanks for the suggestions!
__________________
http://codykrieger.com
bitninja is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Hardware > Notebooks > MacBook Pro

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Can the 6 pin gpu power cable in the Mac Pro be used on a 8 pin gpu like a 770? Jake0604 Mac Pro 45 Jul 24, 2014 01:18 AM
GPU choice - handbrake encoding using hardware GPU 775M vs GTX 780M musio iMac 13 Oct 5, 2013 06:24 AM
iMac 27" GT680MX - Faulty GPU (or GPU's Fan?) ///M5 iMac 2 Jan 16, 2013 02:26 PM
dell U2713HM display port macbook pro GPU won't switch to integrated GPU joecool99 Mac Peripherals 4 Dec 28, 2012 07:42 AM
Late 2011 GPU vs 2012 GPU treyh91 MacBook Pro 6 Jun 12, 2012 01:04 PM

Forum Jump

All times are GMT -5. The time now is 02:52 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC