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

Conversation

@jonahwilliams
Copy link
Contributor

Removes the rest of the validation errors by increasing the size of the query ring buffer. Because we rely on callbacks fired from the fence waiter, when the phone is under load these can be substantially delayed from the frame finishing.

Adjusts presentation to use a dedicated default priority/slow core affinity/single threaded task runner. From the ARM video guide, submitKHR will block until all previously submitted work has been scheduled. This needs to happen in order, and doesn't need to run at high priority or even on medium speed cores.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

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.

@jonahwilliams
Copy link
Contributor Author

I can't provide it, but I think this fixes flutter/flutter#135642

@chinmaygarde chinmaygarde changed the title [Impeller] adjustments to submitKHR and queries. [Impeller] Adjustments to SubmitKHR and queries. Oct 24, 2023
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

Suggestion about using fml::Thread instead of a "concurrent" runner with count 1. But just nits. LGTM.

submit_message_loop_ = fml::ConcurrentMessageLoop::Create(1u);
submit_message_loop_->PostTaskToAllWorkers([]() {
// submitKHR is extremely cheap and mostly blocks on an internal fence.
fml::RequestAffinity(fml::CpuAffinity::kEfficiency);
Copy link
Member

Choose a reason for hiding this comment

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

How about just fml::Thread? That has a handy way to name the thread too. You can still post task to it to set it as an efficiency affinity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh neat, didn't realize that. makes more sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

std::shared_ptr<CommandPoolRecyclerVK> command_pool_recycler_;
std::string device_name_;
std::shared_ptr<fml::ConcurrentMessageLoop> raster_message_loop_;
std::shared_ptr<fml::ConcurrentMessageLoop> submit_message_loop_;
Copy link
Member

Choose a reason for hiding this comment

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

Here and elsewhere, perhaps call it queue_submit_task_runner? I was initially wondering, "submit what"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

jonahwilliams added 2 commits October 23, 2023 22:12
// found in the LICENSE file.

#include "impeller/renderer/backend/vulkan/context_vk.h"
#include "fml/concurrent_message_loop.h"
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Newline between primary header and the rest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 24, 2023
@auto-submit auto-submit bot merged commit fcb7fd7 into flutter:main Oct 24, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 24, 2023
fluttermirroringbot pushed a commit to flutter/flutter that referenced this pull request Oct 24, 2023
…137135)

flutter/engine@d588950...8f7488e

2023-10-24 [email protected] Roll Skia from b3923b715c50 to 70978e42479c (1 revision) (flutter/engine#47257)
2023-10-24 [email protected] Update fml::ThreadPriority enum to match style guide. (flutter/engine#47255)
2023-10-24 [email protected] [Impeller] Adjustments to SubmitKHR and queries. (flutter/engine#47249)

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],[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
@jonahwilliams jonahwilliams deleted the actually_fix_end_timing branch October 25, 2023 18:13
auto-submit bot pushed a commit that referenced this pull request Oct 27, 2023
It turns out the fixing #47249 revealed further bugs: we were actually overwriting previous presents and dropping frames, which was what the forward progress error was hinting. Once this problem is fixed, we started hitting present timeouts or overdraw of swapchain images.

The fix for this is that we shouldn't even ask for a swapchain image until after we've called present, which actually wasn't tracked with anything.

The error:

```
A Dart VM Service on Pixel 6 Pro is available at: http://127.0.0.1:62491/_N4PSEPUtA0=/
The Flutter DevTools debugger and profiler on Pixel 6 Pro is available at: http://127.0.0.1:9102?uri=http://127.0.0.1:62491/_N4PSEPUtA0=/
W/OnBackInvokedCallback(19160): OnBackInvokedCallback is not enabled for the application.
W/OnBackInvokedCallback(19160): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
W/vulkan  (19160): dequeueBuffer timed out: Function not implemented (-38)
E/flutter (19160): [ERROR:flutter/impeller/base/validation.cc(49)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not acquire next swapchain image: Timeout
E/flutter (19160): [ERROR:flutter/shell/gpu/gpu_surface_vulkan_impeller.cc(64)] No surface available.
```
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

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants