Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] add parsing of known GPU models - #55196

Merged
auto-submit[bot] merged 8 commits into
flutter-team-archive:mainfrom
jonahwilliams:bad_database
Oct 7, 2024
Merged

[Impeller] add parsing of known GPU models#55196
auto-submit[bot] merged 8 commits into
flutter-team-archive:mainfrom
jonahwilliams:bad_database

Conversation

@jonahwilliams

@jonahwilliams jonahwilliams commented Sep 14, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor 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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correct

Copy link
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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-team-archive:main Oct 7, 2024
@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
flutter-team-archive/engine@0c9d3f1...e84e303

2024-10-07 jonahwilliams@google.com [Impeller] add parsing of known GPU models (flutter-team-archive/engine#55196)
2024-10-07 jmccandless@google.com Path clarification in Setting-up-the-Engine-development-environment.md (flutter-team-archive/engine#55529)
2024-10-07 skia-flutter-autoroll@skia.org Roll Skia from 89284b1d7eeb to 6afbd6253e66 (2 revisions) (flutter-team-archive/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 matanl@google.com,zra@google.com 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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…ne#55196)

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#155185
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller

Development

Successfully merging this pull request may close these issues.

4 participants