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 validation layers are (still) crashing Android emulators. #148481

Closed
matvuric opened this issue May 16, 2024 · 15 comments
Closed
Assignees
Labels
e: impeller Impeller rendering backend issues and features requests P1 High-priority issues at the top of the work list team-engine Owned by Engine team triaged-engine Triaged by Engine team

Comments

@matvuric
Copy link

matvuric commented May 16, 2024

Steps to reproduce

  1. Run the project with an argument "--enable-impeller".

Expected results

App is running on the emulator

Actual results

After running the project my screen is locked and doesn't react on any input actions. Computer is still running, but doesn't show anything new.

Code sample

Code sample

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
√ Built build\app\outputs\flutter-apk\app-dev-profile.apk (93.4MB)
[IMPORTANT:flutter/shell/platform/android_context_vulkan_impeller.cc(67)] Using the Impeller rendering backend (Vulkan).

Flutter Doctor output

Doctor output
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.19045.4170], locale ru-RU)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2023.2)
[√] VS Code (version 1.89.1)
[√] Connected device (3 available)
[√] Network resources

• No issues found!
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label May 16, 2024
@danagbemava-nc
Copy link
Member

Hi @matvuric, did this happen prior to flutter 3.22?
Does this happen with the counter app?

What gpu is your device using?

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 16, 2024
@matvuric
Copy link
Author

matvuric commented May 16, 2024

@danagbemava-nc, no that also was happening on 3.19 too. I've started trying yesterday with 3.19 and had the same problem. Now I have flutter 3.22.
Yes, it is happening to counter app too.
I have geforce gtx 1060.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 16, 2024
@jonahwilliams
Copy link
Member

Which Android emulator version and API level are you using? I would recommend updating to the very latest AVD that you can.

@matvuric
Copy link
Author

@jonahwilliams, I've tried pixel 3a and pixel 8 pro. API 34 x86_64

@jonahwilliams
Copy link
Member

The device skin doesn't matter, its the AVD version. Can you try updating to latest and/or listing the AVD version you have installed?

@matvuric
Copy link
Author

matvuric commented May 16, 2024

@jonahwilliams I have Android 14.0 API 34 x86_64 and installed Android VanillaIceCream x86_64. With the last one I have no problem with GPU, but emulator is crashing.

Launching lib\main.dart on sdk gphone16k x86 64 in debug mode...
Running Gradle task 'assembleDebug'...                             16,7s
√ Built build\app\outputs\flutter-apk\app-debug.apk
Installing build\app\outputs\flutter-apk\app-debug.apk...          434ms
I/flutter ( 4662): [IMPORTANT:flutter/shell/platform/android/android_context_vulkan_impeller.cc(67)] Using the Impeller rendering backend (Vulkan).
Error connecting to the service protocol: failed to connect to http://127.0.0.1:52232/rzqyY807_Lo=/

@ciriousjoker
Copy link

ciriousjoker commented May 16, 2024

App crashes for us as well.

  • Everything is running fine when running the app in Flutter 3.22.0 without Impeller
  • Enabling Impeller makes it so not just the app crashes on launch, but the entire emulator

Unless you want me to update to API level 35, I already have the latest version of the latest production Android version.
CleanShot 2024-05-16 at 21 40 18@2x

I'm running this on a 2022 m2 mac mini.


I just tried using it on the VanillaIceCream emulator:

  • App launches, but hangs immediately on the first drawn frame. It seems(!) like the frame is drawn by Flutter (as opposed to being drawn by Android through the Splashscreen api)
  • ANR dialog after 10 secs or so

CleanShot 2024-05-16 at 21 57 46@2x

@jonahwilliams
Copy link
Member

The emulator version is the important part, not the API level or phone form factor. You can look up the emulator version with:

$ANDROID_HOME/sdk/emulator/emulator --version

@danagbemava-nc
Copy link
Member

@ciriousjoker @matvuric please run the command in #148481 (comment) and provide the output.

Thank you

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 17, 2024
@matvuric
Copy link
Author

matvuric commented May 17, 2024

INFO    | Storing crashdata in: C:\Users\matvuric\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.1.20.db, detection is enabled for process: 7556
INFO    | Android emulator version 34.1.20.0 (build_id 11610631) (CL:N/A)
ERROR   | No AVD specified. Use '@foo' or '-avd foo' to launch a virtual device named 'foo'

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 17, 2024
@ciriousjoker
Copy link

INFO | Storing crashdata in: /tmp/android-ciriousjoker/emu-crash-34.2.13.db, detection is enabled for process: 53017
INFO | Android emulator version 34.2.13.0 (build_id 11772612) (CL:N/A)
ERROR | No AVD specified. Use '@foo' or '-avd foo' to launch a virtual device named 'foo'

As per Android Studio sdk manager, this already is the newest version:
CleanShot 2024-05-17 at 16 43 04@2x

@jonahwilliams jonahwilliams changed the title Run the app with "--enable-impeller" on Android Emulator crashes computer's GPU [Impeller] Vulkan validation layers are (still) crashing Android emulators. May 17, 2024
@jonahwilliams jonahwilliams added e: impeller Impeller rendering backend issues and features requests team-engine Owned by Engine team and removed in triage Presently being triaged by the triage team labels May 17, 2024
@jonahwilliams
Copy link
Member

Thanks! This is unfortunate. We suspect the crash is related to vulkan validation layers being enabled by default for debugging, and while we've reached out to the Android emulator team about this several times they've been unable to fix it.

On the current master channel, we've disabled the validation layers and intend to keep them opt in, so you might be able to try there to see if it works. Otherwise, if you choose an ABI that we support profile/release builds for (x86_64, arm32, arm64), running in a profile build will disable validation layers.

@jonahwilliams
Copy link
Member

We're going to cherry pick a change to turn off validation layers on 3.22, that should work around this problem

@jonahwilliams
Copy link
Member

CP request and PR opened.

@jonahwilliams jonahwilliams added the P1 High-priority issues at the top of the work list label May 17, 2024
@jonahwilliams jonahwilliams self-assigned this May 17, 2024
@jonahwilliams jonahwilliams added the triaged-engine Triaged by Engine team label May 20, 2024
@jonahwilliams
Copy link
Member

I believe the latest flutter hotfix should have resolved this issue. if not, please comment on this bug or file a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e: impeller Impeller rendering backend issues and features requests P1 High-priority issues at the top of the work list team-engine Owned by Engine team triaged-engine Triaged by Engine team
Projects
None yet
Development

No branches or pull requests

4 participants