Keyboard maestro is triggering the dedicated graphics card?

What is the reason behind keyboard maestro engine triggering the dedicated graphics card on my 2011 15" MBP?
Is this a bug?

What does “triggering the dedicated graphics card” mean?

The MacBook Pro in question has dual graphic cards. One is the integrated Intel and the other one is an AMD Radeon.

The integrated uses far less power than the dedicated Radeon card and is preferred when the computer is powered by battery.

I have a hard time understanding why the KM engine needs the more powerful graphics card to run!?

Hey Eric,

If memory serves anything that calls Core Animation will cause this, and so the problem is not strictly caused by Keyboard Maestro.

Yeah, this is a response from a bug-report I sent in years ago (related to an app other than KM):

“It's Core Animation that causes so many disparate apps to activate the graphics hardware.”

-Chris

1 Like

Thanks for the reply Chris.
As far as I can see it’s the only service running on my computer that triggers this switch.
I have plenty of other services running in the background like: Hazel, 1Password, Dropbox, Mountain…
If I quit the KM Engine I get automatically switched to the integrated graphics card instead.

As @ccstone notes, Keyboard Maestro (and Keyboard Maestro Engine) do various animating processes. For whatever reason, the system decides it wants to use the other graphics card. That is largely beyond my control I’m afraid, I just tell the system what I want to do and it decides what it wants to do as far as graphics cards. I’m afraid I don’t even know what it is that triggers the behaviour - if I did, maybe I would change the behaviour to avoid it. But then again, all the behaviour is there for a reason, so it’s hard to say without any idea why the system chooses to do this - presumably it has a good reason, whatever it is.

Peter - I’m not sure what animations the KM engine does, but… Perhaps you could add an option to turn the animations off? My guess is that this is not as simple as it sounds, but I thought it was worth mentioning.

I wouldn’t even know what to remove or make conditional, and as far as I am aware, the change happens as soon as Keyboard Maestro is launched, so it’s based on the ability to access something rather than the actual access.

1 Like

I don’t know if this fixes it but I found an article speaking of this exact issue in the apple dev site.
You should apparently use:

NSSupportsAutomaticGraphicsSwitching and a boolean of true

in the info playlist to make sure that your app can use the integrated GPU instead of the discrete one.

Here’s the article:
https://developer.apple.com/library/mac/qa/qa1734/_index.html

Ok. I tried it here and it definitely fixes the problem.
Could you incorporate this in the next subversion?

PS. The same is probably true for the Editor too.

According to that document, it also says:

Additionally, you must make sure that your application works correctly with multiple GPUs or else the system may continue forcing your application to use the discrete GPU. TN2229 Supporting Multiple GPUs on Mac OS X discusses in detail the required steps that you need to follow. You're highly recommended to check it out.

Important: You must check that features you desire to use exist on the GPU you are using.

Features that are available on the discrete GPU may not be available on the integrated GPU. You must check that features you desire to use exist on the GPU you are using. For a complete listing of supported features by GPU class, please see: OpenGL Capabilities Tables.

But since I am not directly using OpenGL, and just using Core Animation or Core Image, I have not the slightest idea what features the system desires to use. It's not clear to me that enabling NSSupportsAutomaticGraphicsSwitching, while ignoring the feature test is a safe thing to do. If you can get some sort of confirmation that it is always safe to set that flag, and the system will force the change if required, them I am happy to set it.

I would be happy to assist you with this in any way I can.
I can beta test a version and see if I run into any issues.

I’d be happy to assist as well. I’ve never run into this until I recently reinstalled KB Maestro, now it constantly tags my discrete graphics card. Please let us know whatever we can do… this is a massive hit to battery life on the laptop left unchanged.

Thanks!

1 Like

Trying it and finding that it works does not tell me whether it will fail catastrophically for other users.

The documentation is very clear that if you enable that flag then:

Important: You must check that features you desire to use exist on the GPU you are using.

I have no idea what features are required as I have no idea why the system is deciding it needs to use that card.

Simply enabling the flag and ignoring that instruction might be completely safe. Or it might result in it failing (crashing or other serious issue) for some or many users. I have no way to know, and without confirmation from Apple that it is safe to do so it would be reckless to simply turn on the flag in the face of that warning.

I will endeavour to ask Apple for clarification, but without it I am unlikely to just turn on the flag.

Is there any way you could add a hidden, "undocumented" way for an individual user to have KM set the flag (or reset it, or whatever it takes), so people could try it "at their own risk" if they wanted to?

Obviously I have no idea how much work this would involve, but I thought I'd throw it out there. This doesn't affect me, so I'm just kibitzing.

It appears it is a flag in the info.plist for the application, so no, it is not apparently configurable, though I did ask that too.

I hate to say this out loud, but technically, couldn’t someone save a copy of the app and then modify the info.plist file themselves? I mean, it’s possible to get into the contents of an application bundle, right? Certainly not recommend, but…

You could, but it breaks the code signing, which these days is far from ideal.

Yeah, I was afraid of that. Thanks.

Would it be possible to throw out a beta version and let us test it for you? I rely heavily on KBM for my daily functions but the battery hit is too much with being on the road all the time. :frowning:

1 Like