Skip to content

MacOSX: don't switch to the dedicated graphic card #3210

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

Closed
ffissore opened this issue May 22, 2015 · 25 comments
Closed

MacOSX: don't switch to the dedicated graphic card #3210

ffissore opened this issue May 22, 2015 · 25 comments
Labels
OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE Upstream notified Related to a software component maintained by someone else. They have been notified of it

Comments

@ffissore
Copy link
Contributor

It looks like the IDE is triggering the more powerful GPU of the two some Macs have installed.
AppBundler supports a flag that disables such switch
https://bitbucket.org/infinitekind/appbundler/pull-request/6/add-support-for/diff

@ffissore ffissore added the OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE label May 22, 2015
@ffissore ffissore added this to the Release 1.6.5 milestone May 22, 2015
@ffissore ffissore self-assigned this May 22, 2015
ffissore pushed a commit that referenced this issue May 25, 2015
…the OSX can switch back to the integrated GPU and save battery. Fixes #3210"

This reverts commit 45b61ef.
@ffissore ffissore reopened this May 25, 2015
@ffissore
Copy link
Contributor Author

ffissore commented Jun 3, 2015

#3225 closed because of lack of feedback. Apparently, too few users are affected by the issue

@ffissore ffissore closed this as completed Jun 3, 2015
@kriegsman
Copy link

Actually @ffissore, I think that basically ALL Mac laptop users are affected by this issue, but since 'graphics card switching' is automatic and invisible under OSX, 99% of users can't tell WHY running the Arduino IDE is draining their battery so quickly. (Installing "gfxCardStatus" makes it abundantly clear where the power is going.)

I'd like to suggest that we re-merge the fix for this. If you'd like more feedback, I will happily round up a dozen Mac laptop Arduino users and get them to report what they're finding.

Please let me know what would help get the patch re-merged and tested for acceptance.

Thanks -Mark.

@kriegsman
Copy link

Actually, using the built-in Activity Monitory, you can see which applications are demanding use of the 'high performance GPU' (which is what also draws much more power). Attached are a couple of screenshots, showing the Arduino IDE sitting 'idle' but still using significant power. Also worth noting that many MacBooks have these dual graphics chips: one energy-efficient one, and one high-performance one. I believe they introduced this hardware first in 2008, and it's still present in the the lastest higher-end MacBook Pros.

screen shot 2015-08-05 at 10 18 28 am

screen shot 2015-08-05 at 10 22 56 am

I'd love to help out all the Arduino developers who are using MacBooks improve their battery life, and let them hack longer between charges.

Thank you so much for all your hard work. It's hard to express how fantastic the whole Arduino project and ecosystem is.

@ffissore
Copy link
Contributor Author

ffissore commented Aug 5, 2015

Happy to see you back.
First two tests I need you to perform:

  1. download latest hourly, edit file Arduino.app/Contents/Info.plist: locate row
<string>-Xmx512M</string>

and, below, add row

<string>-Dsun.java2d.opengl=false</string>

Does you mac still flag the IDE as requiring a high perf GPU?

  1. Download latest Processing and start it. Does you mac flag it as requiring a high perf GPU?

@ffissore ffissore reopened this Aug 5, 2015
@ffissore ffissore modified the milestones: Release 1.6.6, Release 1.6.5 Aug 5, 2015
@ffissore ffissore added the Waiting for feedback More information must be provided before we can proceed label Aug 6, 2015
@kriegsman
Copy link

Even with the "-Dsun.java2d.opengl=false" in the Info.plist, the Arduino IDE app is flagged as requiring the High Performance GPU, as reported by both Activity Monitor and gfxCardStatus.

The latest Processing (v2.2.1) is also flagged as requiring the High Perf GPU.

@kriegsman
Copy link

Unfortunately, this ticket may be relevant: "JDK-8041900 [macosx] Java forces the use of discrete GPU" https://bugs.openjdk.java.net/browse/JDK-8041900
My MacBook that I've been testing on is running java version "1.8.0_51".

There's a second ticket, linked from that one, that may have some relevant code: "JDK-8132775
[macosx] JavaFX forces the use of discrete GPU" https://bugs.openjdk.java.net/browse/JDK-8132775

Also, I do note that "NSSupportsAutomaticGraphicsSwitching" is present in the Info.plist with a value of true in both the hourly build as well as in 1.6.5. It's looking like we'll need at least the NSSupportsAutomaticGraphicsSwitching AND the java2d.opengl=false ... AND something else, it seems.

@ffissore
Copy link
Contributor Author

ffissore commented Aug 7, 2015

Pretty recent too. I guess we'll just sit and wait for a fix from upstream.

@ffissore ffissore added the Upstream notified Related to a software component maintained by someone else. They have been notified of it label Aug 7, 2015
@ffissore ffissore removed this from the Release 1.6.6 milestone Aug 7, 2015
@kriegsman
Copy link

Thank you for the time and attention, and all your work. When they fix it upstream, we'll hopefully get the right behavior "for free".

@ArekSredzki
Copy link

Looks like it is an upstream issue, but I'd like to offer my support in fixing this issue if it persists after the upstream problem has been fixed. This has been a huge problem for all too long.

@ffissore ffissore removed the Waiting for feedback More information must be provided before we can proceed label Sep 17, 2015
@kriegsman
Copy link

It now looks like the upstream issue has been addressed.
https://bugs.openjdk.java.net/browse/JDK-8041900
Thoughts on "what next" now? I'm (still) very happy to help test any revisions and give prompt feedback.

@bafonso
Copy link

bafonso commented Dec 7, 2015

I'd be happy to test this too, it is a big resoure sink to switch to the discrete gpu.

@ffissore
Copy link
Contributor Author

ffissore commented Dec 7, 2015

thank you @kriegsman it seems they've really fixed it. If I get the labels right, fix is in 8u76 which hasn't been released yet. Latest stable jvm is 8u66, latest beta is 8u72. I guess we just have to sit and wait for the fix to be released

@kriegsman
Copy link

Thanks for the cross-check, and I think I agree with your reading of the labels. I will now resume waiting.

@kriegsman
Copy link

The current stable jvm from Oracle appears to now be 8u77, which if I read the labels correctly, includes a fix for the GPU-switching issue. I've installed 8u77 as my system jvm, and I just downloaded the latest hourly Arduino IDE build -- and I'm still seeing the switch to the high-power GPU when I launch the Arduino IDE.
Is there other information I could provide, or tests I could run, that would be helpful?

@facchinm
Copy link
Member

facchinm commented Apr 8, 2016

The IDE bundles its own jvm, so the one installed in the system has no effect. If you could provide a link to the changelog reporting that the issue is closed we can update the bundled jvm and have it available in nightly builds!

@kriegsman
Copy link

Thanks very much @facchinm ... I'm trying to track it down, and I apologize but I'm now I'm a bit confused about which jvm version it is or isn't fixed in. This seems to be the relevant ticket https://bugs.openjdk.java.net/browse/JDK-8041900. Now that I'm reading it again, maybe it's saying that it's fixed in 8u92? If that's the case, then the fix may only be available in the jvm betas, which wouldn't help us here.

@facchinm facchinm added this to the Release 1.6.9 milestone Apr 8, 2016
@facchinm
Copy link
Member

facchinm commented Apr 8, 2016

Thanks a lot @kriegsman for the links! It really looks like we need to wait for u92 to be released to inherit the fix...

@keilunsoftware
Copy link

Just installed the u92 version. Problem still present...

@badgeek
Copy link

badgeek commented Jul 20, 2016

+1 @keilunsoftware

@cmaglie cmaglie modified the milestones: Release 1.6.12, Release 1.6.9 Aug 17, 2016
@kptdobe
Copy link

kptdobe commented Aug 24, 2016

+1, issue still valid with 1.6.8

@kptdobe
Copy link

kptdobe commented Aug 24, 2016

but seems to be fixed in 1.6.10: I do not get the "Requires High Perf Graphic" flag anymore in the Activity Monitor.

@kriegsman
Copy link

kriegsman commented Aug 24, 2016

Just checked Arduino 1.6.11 on OSX 10.11.6 -- good result: no more "Requires High Perf GPU".

@facchinm
Copy link
Member

Closing as fixed

@bafonso
Copy link

bafonso commented Aug 29, 2016

Does anyone know what was changed to fix it?

@facchinm
Copy link
Member

We are now bundling JRE update u92 which contains the fix 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE Upstream notified Related to a software component maintained by someone else. They have been notified of it
Projects
None yet
Development

No branches or pull requests

10 participants