-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
8251854: [macosx] Java forces the use of discrete GPU #1139
Conversation
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
/label add awt 2d |
/label add build |
@mrserb The |
@mrserb The |
I'm still somewhat unsure whether we want to do this in all cases. As mentioned offline, the discrete GPU will be unused (might as well not be there) for almost all Java applications when using a single screen. When the MacBook Pro is running on battery, this seems like a good thing, but when it is plugged in, it seems like we wasting the discrete GPU. It's too bad Apple doesn't provide a way for an application to hint whether they would like to use the discrete GPU if available. I want to run some performance tests with JavaFX, since it will likely impact JavaFX applications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks ok from a build point of view, but I can't comment on the validity and implications of using this key.
@mrserb This change is no longer ready for integration - check the PR body for details. |
I ran a 3D lighting test that is designed to be a GPU stress test. It's a worst case, to be sure, but it take 10 times as long to render with the integrated GPU as it does with the discrete GPU: attenuation.LightingSample: 500 large quads In a more realistic example of drawing a large number of 2D vectors, it runs 35% slower with the integrated GPU: Vector charting test, oval clip I see similar results in the performance numbers you listed above. An application developer who packages up their JDK, for example, using jpackage, can make the decision for themselves. Application developers who rely on the JDK as delivered will get whatever we choose as the default. So we need to be sure that the benefit of doing this justifies the performance hit. |
The difference between the two is that, if the integrated card is default then it is possible to force the discrete card if needed, but it is not possible to force the integrated card if discrete is the default. In the end, it is a laptop, it will work longer on an integrated card. |
@kevinrushforth @prrace could you please review? |
As we discussed yesterday, it is reviewed but not ready to be approved. |
@prrace |
/csr needed |
@prrace has indicated that a compatibility and specification (CSR) request is needed for this pull request. |
CSR is filed: https://bugs.openjdk.java.net/browse/JDK-8258918 |
Mailing list message from Philip Race on 2d-dev: From the CSR ;
This also has to be a bug. I thought it had gone away. Have we reported -phil. On 12/23/20 5:04 PM, Sergey Bylokhov wrote: |
@mrserb This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@mrserb This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! |
This is a review request for the bug particularly fixed some time ago:
https://mail.openjdk.java.net/pipermail/2d-dev/2015-May/005425.html
In that review request it was found that the old fix does not work well in all cases, see:
https://mail.openjdk.java.net/pipermail/2d-dev/2015-August/005611.html
The current fix updates an embedded plist.info, so the java will not require
discrete graphics by default, same as for any other applications.
The discrete card will be used:
In other cases, the integrated graphics will be used, which should be fine in most cases since this graphic is used/tested in the mbp 13/etc. This is not only about rendering performance but also about startup performance, on my current new laptop mbp 16 + Cataline 10.15.7 the switching discrete/integrated causes unexpected delays up to 10 seconds.
Note that the new "metal" pipeline also does not require discrete graphics.
The documentation for NSSupportsAutomaticGraphicsSwitching:
https://developer.apple.com/documentation/bundleresources/information_property_list/nssupportsautomaticgraphicsswitching
I'll create a release note after approval.
Performance numbers:
https://mail.openjdk.java.net/pipermail/2d-dev/2020-August/010979.html
Old review request:
https://mail.openjdk.java.net/pipermail/2d-dev/2020-August/010973.html
Progress
Integration blocker
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1139/head:pull/1139
$ git checkout pull/1139