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] Vulkan: Clearing signaled fences and calling dtors stalls fence waiter. #129737

Closed
chinmaygarde opened this issue Jun 28, 2023 · 3 comments · Fixed by flutter/engine#43339
Labels
e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels.

Comments

@chinmaygarde
Copy link
Member

This will delay all further deallocations. On this run on CI, the waiter was stalled for more than 5 frames. That means the tracked resources in the command buffer were not collected during this time. This increases peak memory usage and probably also puts pressure on the allocator as it cannot reuse memory and must allocate newer arenas. The trace is added here.

Screenshot 2023-06-28 at 12 28 33 PM
@chinmaygarde chinmaygarde added engine flutter/engine repository. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Jun 28, 2023
@chinmaygarde chinmaygarde added this to the Impeller on Android milestone Jun 28, 2023
@jonahwilliams jonahwilliams reopened this Jun 29, 2023
@jonahwilliams
Copy link
Member

I guess you can't say "fix" and issue too close together.

auto-submit bot pushed a commit to flutter/engine that referenced this issue Jun 30, 2023
…pport memoryless. (#43349)

For devices that don't support memoryless textures, the fullscreen MSAA texture adds a substantial amount of memory thrashing when it is allocated and deallocated. For these devices, lets cache the MSAA texture in the swapchain image.

flutter/flutter#129737
@jonahwilliams jonahwilliams reopened this Jun 30, 2023
@chinmaygarde
Copy link
Member Author

We have fixed the issue of the dtors being slow which effectively fixes the stall. We should figure out if there is anything to do w.r.t tossing the dtors onto the pool and off the waiter thread so we can never stall on a user workload.

auto-submit bot pushed a commit to flutter/engine that referenced this issue Jul 5, 2023
…fer flags. (#43313)

Following some thresholds from ANGLE, lets try allocating fewer of our resources into dedicated memory to see if that improves allocator performance.

flutter/flutter#129737
kjlubick pushed a commit to kjlubick/engine that referenced this issue Jul 14, 2023
Some Android devices do not support the memory type eLazilyAllocated, which we use for MSAA and stencil textures. These textures were falling back to device local in dedicated allocations, which are expensive to both allocate and free. The dedicated allocation is implied by asking for eLazilyAllocated

Instead, perform a check for support for this memory type. Never request dedicated allocations (at least not until we have a compelling use case)

This should fix flutter/flutter#129737

flutter/flutter#129784
kjlubick pushed a commit to kjlubick/engine that referenced this issue Jul 14, 2023
…pport memoryless. (flutter#43349)

For devices that don't support memoryless textures, the fullscreen MSAA texture adds a substantial amount of memory thrashing when it is allocated and deallocated. For these devices, lets cache the MSAA texture in the swapchain image.

flutter/flutter#129737
kjlubick pushed a commit to kjlubick/engine that referenced this issue Jul 14, 2023
…fer flags. (flutter#43313)

Following some thresholds from ANGLE, lets try allocating fewer of our resources into dedicated memory to see if that improves allocator performance.

flutter/flutter#129737
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels.
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants