Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue where 2010 MBPs switch to Discrete Only after apps quit #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

highandfew
Copy link

Hi Cody,

I'm a 2010 MBP user. I have been a fan of your app for a long time, using it to force the Integrated Only mode. The problem is that the mode will change to Discrete Only after certain apps which use Core Graphics close, such as Chrome or iOS Simulator.

The few lines of code I've added in fixes this problem:

  • Created a static variable in GSMux to note which mode the user has selected
  • In the displayConfigurationCallback section in GSGPU.m, if the user has selected Integrated Only but the discrete graphics is on, there will be a call to [GSMux setMode:] to change it back to Integrated Only.
  • Do note that forceSwitch doesn't help in this case, since it resolves any discrepancy to the system mode, while my solution resolves it to the user's preference, which is how it should be.

Btw, I have also read that you have selected Dynamic Switching to default upon login so that the app runs smoothly. I think a better solution would be to first select Dynamic Switching to ensure the smoothness, then change it immediately afterwards to the user's last selected preference. What do you think?

…screte only, when it was originally Integrated Only, upon the closing of certain rogue apps like Chrome
@swillis11
Copy link

Would this fix the issue for pre-mbp 2011 users to be able to use integrated graphics? This seems to be a big problem. More info here: https://discussions.apple.com/thread/4889454

Seems like this affects a lot of users, including me. I ended up downgrading to gfxcardstatus 2.1 in order to be able to force a certain mode on boot even though its buggy.

@codykrieger
Copy link
Owner

Thanks for this @highandfew!

In your experience using gfxCardStatus with this patch applied, has this caused any sort of negative side effects at any point? I'm wary of doing something like this just because I've seen some reeeeally wonky stuff happen when switching GPUs in rapid succession.

I'm not entirely opposed to pulling this in...I guess I just need more convincing that this won't blow up 2010 machines.

@swillis11 This would likely help work around the issue, but I'd really love to find a proper fix that doesn't require doing something like this.

@highandfew
Copy link
Author

@swillis11 The code I added doesn't force any mode on boot, so it will default to Dynamic Switching. But if you switch to Integrated Only, then it will stay that way until some CoreGraphics-utilizing app, like Chrome or more recently Reeder in 10.8.3, closes. Upon the closure of these apps, OS X automatically changes to Discrete Only for 2010 MBP users and I know of no way to prevent this. What I did was to add code so that once gfxCardStatus detects this, it immediately changes the Discrete Only back to Integrated Only. Hence for all purposes, you can say that your graphics remain in Integrated Only, once you set it as such in gfxCardStatus, until you next reboot your mac.

@codykrieger I have not done any extensive testing, but at least on my machine I can confirm it's very safe. Admittedly, it's quite a dirty fix, but displayConfigurationCallback seems like the only place where it's possible for gfxCardStatus to realize OS X's unwarranted switch to Discrete Only. I strongly urge you to pull this request for two reasons: i) it's a major convenience to MBP 2010 folks. ii) it will only affect the subset of users who use MBP 2010 and Integrated Only; in other words only the people who need the fix are at risk of "blowing up" their machines, and I'm inclined to think that they're very willing to take the gamble.

@Sesquipedalian
Copy link

This problem affects me often, so I would be willing to test highandfew's modifications and report on whether I discover any unpleasant side effects. I have a Mid-2010 15" MacBook Pro.

@henrik242
Copy link

This patch would help me and my MBP 2010 a lot as well.

@Sesquipedalian
Copy link

Any chance you could give us a test build incorporating this patch, @codykrieger? Even just a build attached to this thread or something that we could try out. I swear I'll test it carefully and give feedback. :)

@henrik242
Copy link

Could you post some build instructions, @codykrieger? I've checked out the project with submodules, but I still cannot get it to build. Is a special version of ReactiveCocoa or Xcode needed?

@codykrieger
Copy link
Owner

@henrik242 I haven't built the project in quite some time, so I'm not sure exactly what the problem might be. I'll see if I can give it a shot soon.

@Sesquipedalian
Copy link

I am still interested in testing out the fix that @highandfew created. Unfortunately, I am in the same situation as @henrik242; I can't get the project to build even though I've also checked out ReactiveCocoa (I think I did it correctly). Any chance you could give us that test build incorporating @highandfew's patch, or some directions on how to get the build to work, @codykrieger?

@highandfew
Copy link
Author

If anyone is still interested, the version with my patch can be downloaded here:
http://www.sendspace.com/file/xfzn4g

@Sesquipedalian
Copy link

Excellent! I'll test this out and report back soon. Thanks, highandfew.

Jon

On 2013-07-31, at 2:51 AM, highandfew [email protected] wrote:

If anyone is still interested, the version with my patch can be downloaded here:
http://www.sendspace.com/file/xfzn4g


Reply to this email directly or view it on GitHub.

@Sesquipedalian
Copy link

@highandfew's version seems to work perfectly. I put it through various tests to make sure that it did what it is supposed to do, and that it did not do anything it shouldn't do. It passed them all.

First, I tested it in situations that triggered the bug when using the standard build, and @highandfew's build handled them all excellently, every time.

Then I tried to see if I could find ways to make @highandfew's build perform the wrong behaviour. It always did the right thing.

  • I tried to get the build to switch to the wrong configuration by selecting various modes while launching and quitting different combinations of applications that normally prompt the discrete GPU to activate. None of the permutations I tried resulted in bad behaviour.
  • Most importantly, I also found that @highandfew's build never produced the situation where both GPU's would end up running at once. The existing check that refuses to switch to integrated only mode when an application is using the discrete GPU continues to function as it should with @highandfew's patch.

So, based on my testing, it seems that it would be a good idea to merge @highandfew's pull request into the gfxCardStatus master.

@GraXXoR
Copy link

GraXXoR commented Oct 27, 2013

2010 MPB 17" NVIDIA geforce 330.
Mavericks 10.9

If using "dynamic", things work as expected.
i.e.
open a power hungry program and gfxstatus changes to "discrete"
close the program and it reverts back to "integrated"

However:

If one selects "integrated only" the status still changes to "discrete" on occasion.
In this case, gfxcardstatus menu shows status changed to "discrete only" and doesn't revert to "integrated only" when the dependant program closes...

Is this expected behaviour?

@codykrieger
Copy link
Owner

@GraXXoR That's not the intended behavior, but it's currently expected, yeah...that's the issue that this whole thread is about. There's not a fantastic way to fix it.

@codykrieger
Copy link
Owner

That said, I'm leaning toward merging this pull request in, but I have about zero time to devote to it.

@hemancuso
Copy link

+1 for merging this pull

@nickjf20
Copy link

nickjf20 commented Apr 9, 2014

+1

I'm also using a MBP 2010 - there's one exception I think needs to be catered for:

If someone selects integrated only and then plugs in a display, will the system be caught in a loop of rapid graphics switching?

I've not tested this yet as I only found this thread today

@ytbmulder
Copy link

Any updates on this issue? Can anyone else confirm the behaviour of highandfew's uploaded version?

@Sesquipedalian
Copy link

The build that @highandfew posted above continues to work for me without problems to this very day. I have no idea if @codykrieger ever plans on pulling in the patch. If you want to see more updates on the issue, download highandfew's build and then post an update here describing how it worked for you.

@ytbmulder
Copy link

Thank you for your reply. I ried @highandfew build, but it switches the GPU, which I don't like. I have a mid 2010 MBP with a faulty discrete GPU. I want to force the system in using the integrated only, which is why I still run version 2.1 of gfxCardStatus. I was hoping @highandfew build was a newer version of this, but instead, it switches to the discrete GPU if needed and switch back to the integrated GPU after that. I actually don't want to switch my GPU's anymore because of the faulty hardware.

@codykrieger
Copy link
Owner

I very seriously doubt it's a Yosemite issue — you haven't heard of the issues plaguing lots of 2011 MacBook Pro owners?

On Nov 27, 2014, at 8:22 PM, Christopher Konopka [email protected] wrote:

@codykrieger What is failing? My computer was working fine when I had other OS X 10.* but not Yosemite. This seems to be a pretty common issue with Yosemite right now.


Reply to this email directly or view it on GitHub.

@cskonopka
Copy link

@codykrieger I never ever had a problem with extreme workloads with my graphics card. It is not unsual to run Jitter (real-time OpenGL application), MaxMSP, Ableton (15+ tracks), Chrome (+40 tabs) on a regular evening. I read about it a while back but I don't necessarily believe it was that other it would of happened already, but thats me. This all happened when Yosemite was introduced to my computer and I've read several people have experienced this as well. Odd coincidence.

@swillis11
Copy link

Have you tried a different version of OS X to verify that it's not a hardware failure? Even though it's some effort it's worth it even to swap out HDDs and put an older version on just to see. Maybe the hardware failed some time after Yosemite was installed.

Also have you stress tested both GPUs as mentioned by you after installing Yosemite? These are two things I would definitely try.

@cskonopka
Copy link

After Yosemite, everything went south. I've never experienced an issue like
this before with any Apple product I've ever owned and I started on the
Apple IIc. I pushed my computer to the limit with each operating system
Snow Leopard, Lion, Mountain Lion and Mavericks, all with success. After I
went to Yosemite and tried to even do a bunch of tabs, it would act odd. At
one point I had Yosemite working for about 6 hours then it failed. I have
tried two different HDs already, one SSD and one factory Apple 750GB HD. No
dice. It failed after it said it was switching to dynamic mode with this
application. After that, everything broke, even the app wouldn't let me
change the function of the graphics card again. I tired to re-install but
the internet recovery made me get Yosemite. I wiped everything, went back
to Lion, worked back to Mountain Lion, everything was great. Decided to
risk it, went to Mavericks, and now everything goes to hell again. By
deduction, the only out of color variable is Yosemite. And since there are
thousands of other users who have experienced this same thing, I view it as
a Yosemite problem that triggers this problem. I know its outlandish but
its not out of the realm of possibility that they knew of a faulty
situation and can use the guise of an operating system to cause the issue.
Then make money on both ends, not sure if they would do that, but every
major company does it in some aspect, no product is perfect so how can you
benefit from it. You may not believe me but I've had tons of stuff like
this happen to me, I once fried a wifi card by unplugging an external
monitor. Even the Apple tech who came to replace it said he had never heard
or seen of anything like it. And I once had Logic throw an error from one
of its first versions, destroyed my entire hard drive. Its not uncommon
that Apple doesn't fix tiny aspects to get things out the door and rely on
patches.

On Tue, Dec 2, 2014 at 4:34 PM, swillis11 [email protected] wrote:

Have you tried a different version of OS X to verify that it's not a
hardware failure? Even though it's some effort it's worth it even to swap
out HDDs and put an older version on just to see. Maybe the hardware failed
some time after Yosemite was installed.

Also have you stress tested both GPUs as mentioned by you after installing
Yosemite? These are two things I would definitely try.


Reply to this email directly or view it on GitHub
#107 (comment)
.

@TheBFC
Copy link

TheBFC commented Jan 7, 2015

Just wanted to let this thread know that I have a mid-2010 MacBook Pro with the same failing dGPU and looked to this program to solve/stabilize the system.

Mine STAYS as INTEGRATED on OS X Mavericks 10.9.5 using gfxcardstatus 1.8.1

I have it set as a login item to switch to integrated upon user login.

If I try to mess around with windows that pop up/restore during load up, it usually grey-screen crashes until gfxcardstatus icon in the tray specifically has changed to the "i" indicator.

After this has happened, it NEVER changes again.

I tried the newer versions of this program - 2.1 and 2.3 and they wouldn't stay as integrated. i searched and found the older 1.8.1 that i used to use - and it WORKS. At least for this system.

@codykrieger
Copy link
Owner

@TheBFC That's actually not correct. Versions as old as 1.8.1 have a bug where gfxCardStatus does not notice the GPU change when apps quit. This bug has been present since the earliest versions of gfxCardStatus that supported Integrated Only mode, but only newer versions actually allow you to notice the bug occurring.

@TheBFC
Copy link

TheBFC commented Jan 7, 2015

Well bug or not, all i can say is that your program DOES keep the system from crashing. If it shows "i" up there, the couple of graphics/game type programs that I could throw at it/test with start up in and stay in that "i" mode and work more rough/3D acceleration sucks etc so I'm not sure why that would be the case.

If I close the program and then re-open the same program again, the same poor performance happens.

If I tell it to go to NVIDIA Only then it certainly crashes.

If I tell it to go to Dynamic Switching, 90% of the time it also crashes.

@tyhenry
Copy link

tyhenry commented Jan 7, 2015

@TheBFC Thanks for the tip on 1.8.1. About to test that out on a MBP with faulty GPU (running Yosemite). Just to clarify, how did you set it up to switch to integrated on user login? Is there a command line option?

@codykrieger
Copy link
Owner

@tyhenry Previous versions had a preference to do so, but it was removed for multiple reasons.

@codykrieger
Copy link
Owner

And, just as a general note, using v1.8.1 is not a free lunch...there are plenty of nasty bugs that have been fixed since then. YMMV.

@delllboyyy
Copy link

Hi, I'm having the same problem as you are. I wondered if you have made you OWN version available for public use? Thanks a lot. Dale

@delllboyyy
Copy link

Also, i agree, as when i use INTEGRATED, my mac works smoothly, allowing me to use GarageBAnd and other apps that are in the "Dependencies" list. If i use DISCRETE or DYNAMIC SWITCHING, after i fiddle with said programs/apps my mac then crashes! I use version 2.3 and at times, it will stay on INTEGRATED mode even when using High Dependency apps, when this is done, I choose to keep my mac on, as if i restart it Its hard for me to get INTEGRATED mode to stay on, thus my mac crashing often.
Is there a way I can keep INTEGRATED mode on OR maybe a way to remove some apps from the DEPENDENCIES list, so to override the auto command to switch modes???
Thanks for all the hard work you've put in to GFX as its great and has helped all of us a great deal.
Dale.

@star-szr
Copy link

I have the same issue with a 2010 MBP and for what it's worth I have been running 1.8.1 with about 10 days uptime so far, which is a record this machine hasn't hit in a long time. Thanks for the tip @TheBFC, this has saved me a lot of frustrating kernel panics over the last week and a bit.

Download link: https://gfx.io/downloads/gfxCardStatus-1.8.1.zip

@ThetaSigma312
Copy link

@codykrieger A possible, and safer way to fix the graphics switching is to have gfxcardstatus become a dependency in itself after you select Integrated, so even if you quit a real dependency (for example VLC) OS X won't call for a switch. I don't know how clear that sounds, but how possible is it?

Edit: Would that drain the battery?

@codykrieger
Copy link
Owner

I don't think that's possible.

On Jan 23, 2015, at 5:38 PM, ThetaSigma312 [email protected] wrote:

@codykrieger A possible, and safer way to fix the graphics switching is to have gfxcardstatus become a dependency in itself after you select Integrated, so even if you quit a real dependency (for example VLC) OS X won't call for a switch. I don't know how clear that sounds, but how possible is it?


Reply to this email directly or view it on GitHub.

@ghost
Copy link

ghost commented Jan 25, 2015

@cottser and @TheBFC Thanks for the tip of going back to an older version. I am experiencing the same issues on my Macbook Pro 15" Mid 2010 running OSX Yosemite 10.10.1. Going back from version 2.3 to 1.8.1 has stabilized my system. For the last 48 hours I didn't experience any kernel panics / grey screen issues. Knock on wood that it stays that whay...

@star-szr
Copy link

15+ days uptime and counting for me running 1.8.1. I should have also included: I'm on OS X 10.9.5, Mid 2010, 15" here too. Model ID MacBookPro6,2 (from System Information.app).

Great to hear that it helps with Yosemite too, thanks for that @bsphoto. Helps when considering an update.

@ytbmulder
Copy link

I just wanted to let everyone know that on my 15" mid 2010 Macbook Pro, I am using version 2.1 for a couple of months now without any problems ;)

@marlonleite
Copy link

Hello @cskonopka I had same issue.

I have the same problem. My mb never gave any trouble. But after I installed Yosemite version 10.10.3, began to hang, blue screen and gray screen at boot. I reinstalled a new version and the errors were still there. I believe the Yosemite changes some kernel driver, and causes panic in some older macbooks without retina display.

The only solution I found was to install a new Snow Leopard, after each upgrade version of Leopard, Lion after -> Motain Lion -> Mavericks -> Yosemite. Well that did not solve all, most of the errors was gone. But when I was using an external monitor output by Thundebold my macbook went crazy again.

After I installed gfxCardStatus, everything was normal. I think something strange with the gfx driver kernel.

@codykrieger
Copy link
Owner

I'd strongly encourage you not to downgrade to Snow Leopard just to work around problems like this. Snow Leopard is no longer receiving updates, and lots of critical security fixes have been made to OS X lately. By running such an old operating system you are putting yourself at a pretty severe level of risk.

On May 9, 2015, at 8:12 AM, Marlon [email protected] wrote:

Hello @cskonopka I had same issue.

I have the same problem. My mb never gave any trouble. But after I installed Yosemite version 10.10.3, began to hang, blue screen and gray screen at boot. I reinstalled a new version and the errors were still there. I believe the Yosemite changes some kernel driver, and causes panic in some older macbooks without retina display.

The only solution I found was to install a new Snow Leopard, after each upgrade version of Leopard, Lion after -> Motain Lion -> Mavericks -> Yosemite. Well that did not solve all, most of the errors was gone. But when I was using an external monitor output by Thundebold my macbook went crazy again.

After I installed gfxCardStatus, everything was normal. I think something strange with the gfx driver kernel.


Reply to this email directly or view it on GitHub.

@marlonleite
Copy link

You're right. But in my case, video and boot were giving a lot of problems. So I chose to force the format ssd, install a clean version of the snow leopard and so on upgrading to Lion -> to Montain Lion -> to Mavericks and finally to Yosemite. Only then the firmware has been fixed in the latest version of Yosemite. Thus solved all the bugs presented in bad firmware version I had previously updated. But to my surprise, I found another bug when using an HDMI adapter for external monitor. It made me crazy. The last alternative was found in macissues site of Topher Kessler, updating Yosemite 10.10.3 forced.
"http://www.macissues.com/2015/01/28/how-to-force-os-x-10-10-2-to-install-on-your-mac/".
After the reboot I activated the gfxCardStatus and thus it is apparently stable. But too afraid to appear to fail again. I hope this has fixed the problem permanently.

@codykrieger codykrieger changed the title Fixed an issue for 2010 MBP users Fixed issue where 2010 MBPs switch to Discrete Only after apps quit May 19, 2015
@glaszig
Copy link

glaszig commented Jul 17, 2015

does somebody have a test build of this pr available for me to try? i'm going crazy with this.

to further this endless discussion:

  • everybody with a 2010 macbook, you're too late.
  • everybody with a 2011 macbook, you might be eligible for the free repair program.
  • everybody with newer devices and video issues, please bug apple until they squeak.

@ghost
Copy link

ghost commented Aug 8, 2015

As a mid-2010 15" MBP owner this whole ordeal is rather tragic.
I am on OSX Yosemite 10.10.4

I found gfxCardStatus, v2.3 and also noticed the forced switch back to discrete on closing certain apps...
Fortunately, this progression lead me to you guys and this thread (been about 2 years of trying to figure out what is going on with the comp during my spare time)

So do people recommend v1.8.1 or v2.1 to keep my chosen GPU as Intel (integrated only)?

@ianmartorell
Copy link

I've been running gfxCardStatus 2.1 on my mid-2010 15'' MBP for a while now and it's been working flawlessly. I set it to restore the last used mode on startup and I don't have to keep changing to "Integrated mode" all the time as it was the case with version 2.3. I'm also not experiencing the problem described by this pull request where quitting certain apps forces the switch to the discrete graphics card. I'm curious as to why this issue needs "dirty" workarounds on 2.3 but it doesn't exist on 2.1.

@codykrieger
Copy link
Owner

@ianmartorell Versions older than v2.3 have a bug where they don't realize another switch has occurred after an app quits. v2.1 is not immune to this issue.

Repository owner locked and limited conversation to collaborators Sep 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.