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

[Impeller] add parsing of known GPU models #55196

Merged
merged 8 commits into from
Oct 7, 2024

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Sep 14, 2024

We will need to denylist certain Vulkan drivers. This is easier to do if we have some mechanism of determining which GPU model we're currently using. This doesn't add any new denylisting, it just ads a mechanism to parse the driver name into an enum. I mean, there are only so many SoCs, right?

See also flutter/flutter#155185

@jonahwilliams
Copy link
Member Author

From some brief research, we should probably disable all 500 series Adreno's

@jonahwilliams jonahwilliams changed the title [Impeller] disable Adreno 506. [Impeller] add parsing of know GPU models Sep 14, 2024
@jonahwilliams jonahwilliams marked this pull request as draft September 14, 2024 12:55
@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

@jonahwilliams jonahwilliams changed the title [Impeller] add parsing of know GPU models [Impeller] add parsing of known GPU models Sep 14, 2024
@jonahwilliams jonahwilliams marked this pull request as ready for review October 3, 2024 18:31
//
// Reports "VK_INCOMPLETE" when compiling certain entity shader with
// vkCreateGraphicsPipelines, which is not a valid return status.
// See https://github.com/flutter/flutter/issues/155185 .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version of the PR doesn't actually affect that issue, right?

That is, this adds parsing but it doesn't yet change what set of GPUs get treated as known-bad.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're still going to try to aquire a device with a similar GPU and see what isn't working first.


AdrenoGPU GetAdrenoVersion(std::string_view version) {
/// The format that Adreno names follow is "Adreno (TM) VERSION".
auto paren_pos = version.find(")");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be supppper sure; version.find("Adreno (TM) ") - and then just skip.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(or use a regex like below)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to match more of the string.


MaliGPU GetMaliVersion(std::string_view version) {
// These names are usually Mali-VERSION or Mali-Version-EXTRA_CRAP.
auto dash_pos = version.find("-");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would search for 'Mali-' just to be as specific as possible. Are the version strings always at the start of version? You could also be super pedantic and check that it starts at position 0.

Could we also just use regex?

  std::regex reg("^Mali-([\w]+)(-[\w]+)?");
  std::smatch match;
  if (std::regex_search(version, match, re) && match.size() > 1)  {
    const auto& result = kMaliVersions.find(match::str(1));
    if (result == kMaliVersions.end()) {
      return MaliGPU::kUnknown;
    }
  }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm terrified of c++ regex. Though the google c++ style guide says not to use them, that is only because they have a better alternative in RE2 (see https://engdoc.corp.google.com/eng/doc/devguide/cpp/styleguide.md?cl=head )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to match more of the string.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2024
@auto-submit auto-submit bot merged commit e84e303 into flutter:main Oct 7, 2024
30 checks passed
@jonahwilliams jonahwilliams deleted the bad_database branch October 7, 2024 19:21
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 7, 2024
…156356)

flutter/engine@0c9d3f1...e84e303

2024-10-07 [email protected] [Impeller] add parsing of known GPU models (flutter/engine#55196)
2024-10-07 [email protected] Path clarification in Setting-up-the-Engine-development-environment.md (flutter/engine#55529)
2024-10-07 [email protected] Roll Skia from 89284b1d7eeb to 6afbd6253e66 (2 revisions) (flutter/engine#55702)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants