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

[Impeller] Create a global Vulkan instance in PlaygroundImplVK to prevent SwiftShader from being unloaded after a test completes #47781

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

jason-simmons
Copy link
Member

Libcxx is leaking a thread-local storage key each time SwiftShader is loaded and unloaded. If a test's Vulkan instance is the only one in the process, then SwiftShader will be unloaded after the test ends. If many Vulkan playground tests run in a suite, then eventually the leak will cause the process to exceed its limit of TLS keys and the suite will fail.

The process can ensure that SwiftShader remains loaded by holding another Vulkan instance that persists across all tests in the suite.

Fixes flutter/flutter#138028

@flutter-dashboard

This comment was marked as outdated.

…vent SwiftShader from being unloaded after a test completes

Libcxx is leaking a thread-local storage key each time SwiftShader is loaded
and unloaded.  If a test's Vulkan instance is the only one in the process,
then SwiftShader will be unloaded after the test ends.  If many Vulkan
playground tests run in a suite, then eventually the leak will cause the
process to exceed its limit of TLS keys and the suite will fail.

The process can ensure that SwiftShader remains loaded by holding another
Vulkan instance that persists across all tests in the suite.

Fixes flutter/flutter#138028
Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

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

LGTM! Requested and awaiting a test exemption.

@bdero
Copy link
Member

bdero commented Nov 8, 2023

Changes to impeller/playground will become test exempt with flutter/cocoon#3240, so I think this is fine to land without an explicit exemption.

auto-submit bot pushed a commit to flutter/cocoon that referenced this pull request Nov 8, 2023
…o. (#3240)

* `impeller/fixtures` contains only test fixtures.
* `impeller/golden_tests` contains a test harness for goldens.
* `impeller/playground` contains a test harness that spawns Impeller backends. Also used for capturing goldens.

Patch where this was noticed: flutter/engine#47781
@bdero bdero merged commit b3af5d6 into flutter:main Nov 8, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 8, 2023
…lVK to prevent SwiftShader from being unloaded after a test completes (flutter/engine#47781)
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 8, 2023
…138113)

flutter/engine@21f055f...b3af5d6

2023-11-08 [email protected] [Impeller] Create a global Vulkan instance in PlaygroundImplVK to prevent SwiftShader from being unloaded after a test completes (flutter/engine#47781)

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Engine tree closed on Linux host_debug_impeller_vulkan
2 participants