Repository navigation
[Android] Log why Impeller falls back to OpenGLES - #194764
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If both you and the PR author believe this PR qualifies for a test exemption, escalate to the tech lead for the changed area to review and apply the |
There was a problem hiding this comment.
Code Review
This pull request introduces detailed logging at the IMPORTANT level in android_context_dynamic_impeller.cc and android_context_vk_impeller.cc when falling back to OpenGLES due to emulator detection, specific hardware workarounds, or Vulkan context creation failures. The review feedback suggests keeping a split string literal on a single line in android_context_vk_impeller.cc to adhere to the Google C++ Style Guide and improve searchability.
19074bc to
6ce9abd
Compare
gaaclarke
left a comment
There was a problem hiding this comment.
FML_LOG(INFO) is the appropriate level for this sort of information. Otherwise I'm on board.
|
I tried INFO on a moto g54 (MediaTek gate). With no flags the only line in logcat is the backend line: The reason only appears with These are startup-only diagnostics, printed only when Vulkan is skipped (a reason line, plus the driver dump on the denylist path), and |
It's not really my decision in this case. I'm just enforcing the policy that is standard across the team. One could make an argument here that it is IMPORTANT and that can play out across many different places, then we have a very chatty engine that makes IMPORTANT messages just noise. Let's keep it as INFO. |
|
Ok then, INFO it is. Pushed as bb27645. |
gaaclarke
left a comment
There was a problem hiding this comment.
Okay, this is looking good to me. I just have one request about introducing a new shortcut.
|
@walley892 can you be a second reviewer for this please? |
Impeller autoselect returned OpenGLES silently for emulators, Huawei devices and MediaTek vendor SDKs below 32, and logged known bad SoCs and drivers only at INFO. A profile log then shows "Using the Impeller rendering backend (OpenGLES)." with no reason. Log every fallback branch at IMPORTANT, the level of the backend line, with the property values that triggered it. Vulkan setup failures name the failing step, and a known bad driver dumps its driver info.
|
autosubmit label was removed for flutter/flutter/194764, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/flutter/194764, because - This pull request has the |
2863b1d to
d47b283
Compare
|
@gaaclarke rebased onto master so Linux customer_testing picks up the tests.version fix (#194968). The bot dropped the CICD label on push. Could you re-add it and, if you agree the log-only change qualifies, route the test exemption? |
|
autosubmit label was removed for flutter/flutter/194764, because - The status or check suite ci.yaml validation has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/flutter/194764, because - This pull request has the |
|
autosubmit label was removed for flutter/flutter/194764, because - This pull request has the |
|
test exempt: just updating logging |
Impeller's Android autoselect falls back to OpenGLES for several reasons. Some were silent: emulators, Huawei devices, and MediaTek vendor SDKs below 32. Known bad SoCs and known bad Vulkan drivers were logged only at INFO, which is hidden by default, with the same text for both. A profile or release log therefore shows only `Using the Impeller rendering backend (OpenGLES).`, and app developers and triagers cannot tell why Vulkan was not used. This PR logs every fallback branch at `FML_LOG(INFO)`, visible with `--verbose-system-logs`, one line each and with the values that triggered it. All lines are in `GetActualRenderingAPIForImpeller` (`android_context_dynamic_impeller.cc`) unless noted: | branch | message | |---|---| | emulator | `Emulator detected, falling back to OpenGLES.` | | Huawei | `Huawei device detected (ro.com.google.clientidbase=android-huawei), falling back to OpenGLES.` | | MediaTek vendor SDK | `MediaTek vendor API level <n> is below 32 (ro.vendor.mediatek.platform=<value>), falling back to OpenGLES.` | | known bad SoC | `Known bad SoC encountered (ro.product.board=<board>), falling back to OpenGLES.` | | Vulkan probe invalid | `Could not create a Vulkan context, falling back to OpenGLES.` | In `android_context_vk_impeller.cc` (`CreateImpellerContext`), the failing step is logged just before the probe line: | step | message | |---|---| | device selection | `Could not select a Vulkan device: <absl status message>` | | known bad driver | `Known bad Vulkan driver encountered.` followed by `DriverInfoVK::DumpToLog()` (name, API version, driver version, vendor, device type) | | context setup | `Could not set up the Vulkan context on the selected device.` | The vk messages do not say "falling back", because forced Vulkan (`ImpellerBackend=vulkan`) uses the same function and aborts instead. The `Using the Impeller rendering backend (Vulkan)` banner keeps the structure from flutter#193875: it only prints for a non-null context. No new log line contains the phrase "Using the Impeller rendering backend". devicelab `hello_world_impeller.dart` counts logcat lines with that phrase, so its backend count is unchanged. ### Observed on device moto g54 5G (MediaTek MT6855, PowerVR BXM-8-256, Android 15, Vulkan driver 1.15@6133110), profile build of master plus this PR, default backend selection, `--verbose-system-logs`, logcat from process start: ``` I flutter : [INFO:flutter/shell/platform/android/android_context_dynamic_impeller.cc(116)] MediaTek vendor API level 31 is below 32 (ro.vendor.mediatek.platform=MT6855), falling back to OpenGLES. I flutter : [IMPORTANT:flutter/shell/platform/android/android_context_gl_impeller.cc(105)] Using the Impeller rendering backend (OpenGLES). ``` Before this PR, only the second line was printed. With Vulkan forced (and the PowerVR denylist disabled locally for the experiment), no fallback line appears and the only Impeller line is the `(Vulkan)` banner. Only the MediaTek branch fired on hardware. The emulator, Huawei, bad SoC and bad driver branches and the three Vulkan setup-failure steps were not exercised on a device; each is a log-only addition next to an existing `return nullptr`. ### Tests None added. The change is log-only and the tree has no tests asserting these messages: `shell/` has no other matches for "Known bad Vulkan" or "falling back", and `android_context_dynamic_impeller_unittests.cc` has no log checks. I'd like to request a test exemption, since behavior is unchanged beyond logging. ### Related issues - flutter#192467: the engine ignores `ImpellerBackend` in release builds, and the maintainer answer asked for device properties in order to denylist. With this PR, the fallback reason and the triggering property values are in the default log. - flutter#193502 (fixed by flutter#193875): skip full Vulkan setup on denylisted drivers. This PR adds the reason line on that early-reject path, and on the device-selection and context-setup failures. - flutter#193148: the MediaTek vendor-SDK gate from flutter#186405. A build with this PR is how the gate was confirmed as the cause on a second device: flutter#193148 (comment) ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/CONTRIBUTING.ai.md [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Roll Flutter from fcfb4f203eae to 934720261be0 (38 revisions) flutter/flutter@fcfb4f2...9347202 2026-11-03 [email protected] Roll Skia from 5bceaa033999 to c733ad3e37cb (5 revisions) (flutter/flutter#195872) 2026-11-03 [email protected] Roll Skia from 34d2bf479385 to 5bceaa033999 (9 revisions) (flutter/flutter#195864) 2026-11-03 [email protected] fix: prefer pointer events over semantics tap for mouse clicks on web (flutter/flutter#191529) 2026-11-03 [email protected] [VPAT] Expose a semantics text field value while it is not being edited (flutter/flutter#195445) 2026-11-03 [email protected] [Impeller] Make a GL context current before constructing an AiksContext without a surface (flutter/flutter#195629) 2026-11-03 [email protected] [flutter_tools] Eliminate globals.dart from project.dart (flutter/flutter#194066) 2026-11-03 [email protected] [tool] Complete context runner elimination and migrate AppContext usages to ToolContext (flutter/flutter#190797) 2026-11-03 [email protected] [web] Unify font collections between CanvasKit and Skwasm (flutter/flutter#195539) 2026-11-03 [email protected] [Android] Replay predictive back state for retained engines (flutter/flutter#192286) 2026-11-03 [email protected] [vulkan]: Adds depth/stencil synchronization for subpasses (flutter/flutter#195689) 2026-11-03 [email protected] [web] Honor requested upscaling in instantiateImageCodecWithSize and ImageDescriptor.instantiateCodec (flutter/flutter#195836) 2026-11-03 [email protected] Roll Skia from 866b61ca92c9 to 34d2bf479385 (9 revisions) (flutter/flutter#195848) 2026-11-03 [email protected] Roll Fuchsia Test Scripts from xl1LWBuppzu-BnOzV... to B6zarykZp6PKWRueg... (flutter/flutter#195847) 2026-11-03 [email protected] Remove unused ffi (flutter/flutter#195710) 2026-11-02 [email protected] Revert: [Android] Let the raster thread use every core of a chip without little cores (flutter/flutter#195838) 2026-11-02 [email protected] Run 10 impeller iOS benchmarks as one devicelab task (flutter/flutter#195661) 2026-11-02 [email protected] Use named uniforms instead of setFloat in StretchEffect (flutter/flutter#195372) 2026-11-02 [email protected] [flutter_tools] Report when the browser disconnects during a web test run (flutter/flutter#192198) 2026-11-02 [email protected] fix: Resolve memory leak in image_list example (flutter/flutter#189526) 2026-11-02 [email protected] Only run the common local engine configurations in presubmit (flutter/flutter#195688) 2026-11-02 [email protected] Update gcloud_version to version [email protected] (flutter/flutter#195769) 2026-11-02 [email protected] [Impeller] Order the Vulkan copy-texture-to-texture layout transition after the copy (flutter/flutter#195814) 2026-11-02 [email protected] [Impeller] Order the Vulkan ResizeTexture layout transition after its blit (flutter/flutter#195721) 2026-11-02 [email protected] [web] Fix CanvasKit fragment shader uniforms being freed or mutated after recording (flutter/flutter#195718) 2026-11-02 [email protected] Roll Fuchsia Linux SDK from MqypI6RNyVZ_FLUE-... to T_-6-6X1lDMghhAvX... (flutter/flutter#195809) 2026-11-02 [email protected] [Android] Log why Impeller falls back to OpenGLES (flutter/flutter#194764) 2026-11-02 [email protected] Roll Skia from 3f35fb6e591b to 866b61ca92c9 (11 revisions) (flutter/flutter#195802) 2026-11-02 [email protected] Roll Skia from 3f35fb6e591b to 866b61ca92c9 (11 revisions) (flutter/flutter#195802) 2026-11-02 [email protected] Only run the common local engine configurations in presubmit (flutter/flutter#195688) 2026-11-02 [email protected] Balance tool_integration_tests subshards by expected duration (flutter/flutter#195628) 2026-11-02 [email protected] [web_paragraph] Map code units without a cluster to a cluster (flutter/flutter#195384) 2026-11-02 [email protected] [web] Hide synthetic autofill inputs from assistive technology (flutter/flutter#195618) 2026-11-02 [email protected] Roll Packages from 3742a4e to 3f34a6f (8 revisions) (flutter/flutter#195795) 2026-11-02 [email protected] [web] Unskip web tests that pass on CanvasKit and Skwasm: platform_view_test, route_notification_messages_test (flutter/flutter#195605) 2026-11-02 [email protected] Roll Skia from e5ad3868b8db to 3f35fb6e591b (1 revision) (flutter/flutter#195789) 2026-11-02 [email protected] Roll Skia from f5215e74aa16 to e5ad3868b8db (3 revisions) (flutter/flutter#195779) 2026-11-02 [email protected] Roll Skia from e43478a2f9f8 to f5215e74aa16 (1 revision) (flutter/flutter#195776) 2026-11-01 [email protected] Roll Fuchsia Linux SDK from kW0A0xxNkqf38ljm4... to MqypI6RNyVZ_FLUE-... (flutter/flutter#195768) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose ...
Impeller's Android autoselect falls back to OpenGLES for several reasons. Some were silent: emulators, Huawei devices, and MediaTek vendor SDKs below 32. Known bad SoCs and known bad Vulkan drivers were logged only at INFO, which is hidden by default, with the same text for both. A profile or release log therefore shows only
Using the Impeller rendering backend (OpenGLES)., and app developers and triagers cannot tell why Vulkan was not used.This PR logs every fallback branch at
FML_LOG(INFO), visible with--verbose-system-logs, one line each and with the values that triggered it. All lines are inGetActualRenderingAPIForImpeller(android_context_dynamic_impeller.cc) unless noted:Emulator detected, falling back to OpenGLES.Huawei device detected (ro.com.google.clientidbase=android-huawei), falling back to OpenGLES.MediaTek vendor API level <n> is below 32 (ro.vendor.mediatek.platform=<value>), falling back to OpenGLES.Known bad SoC encountered (ro.product.board=<board>), falling back to OpenGLES.Could not create a Vulkan context, falling back to OpenGLES.In
android_context_vk_impeller.cc(CreateImpellerContext), the failing step is logged just before the probe line:Could not select a Vulkan device: <absl status message>Known bad Vulkan driver encountered.followed byDriverInfoVK::DumpToLog()(name, API version, driver version, vendor, device type)Could not set up the Vulkan context on the selected device.The vk messages do not say "falling back", because forced Vulkan (
ImpellerBackend=vulkan) uses the same function and aborts instead. TheUsing the Impeller rendering backend (Vulkan)banner keeps the structure from #193875: it only prints for a non-null context.No new log line contains the phrase "Using the Impeller rendering backend". devicelab
hello_world_impeller.dartcounts logcat lines with that phrase, so its backend count is unchanged.Observed on device
moto g54 5G (MediaTek MT6855, PowerVR BXM-8-256, Android 15, Vulkan driver 1.15@6133110), profile build of master plus this PR, default backend selection,
--verbose-system-logs, logcat from process start:Before this PR, only the second line was printed. With Vulkan forced (and the PowerVR denylist disabled locally for the experiment), no fallback line appears and the only Impeller line is the
(Vulkan)banner.Only the MediaTek branch fired on hardware. The emulator, Huawei, bad SoC and bad driver branches and the three Vulkan setup-failure steps were not exercised on a device; each is a log-only addition next to an existing
return nullptr.Tests
None added. The change is log-only and the tree has no tests asserting these messages:
shell/has no other matches for "Known bad Vulkan" or "falling back", andandroid_context_dynamic_impeller_unittests.cchas no log checks. I'd like to request a test exemption, since behavior is unchanged beyond logging.Related issues
ImpellerBackendin release builds, and the maintainer answer asked for device properties in order to denylist. With this PR, the fallback reason and the triggering property values are in the default log.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.