Skip to content

flutter gpu crash on Xiaomi #164745

Description

@JaffaKetchup

Recently (not sure whether Flutter has changed, or I've updated to Android 15), my device defaults to running Flutter apps with OpenGL Impeller, even though Vulkan appears to work correctly, and when running a flutter_gpu app, only Vulkan works at all.

My device is a 23090RA98G (Xiaomi with a Mali-G610). Here's the vulkan.gpuinfo.org report (fresh from my device): https://vulkan.gpuinfo.org/displayreport.php?id=37373.

Running any app defaults to OpenGL. I force apps to run with Vulkan by using the following snippet inserted into the AndroidManifest (which I realise is for debugging only):

<meta-data
            android:name="io.flutter.embedding.android.ImpellerBackend"
            android:value="vulkan" />

The first issue is that, at least in my case, running with Vulkan seems to be OK. Perhaps it may be broken on other devices, I'm not sure. But looking at some issue history, there seems to be multiple issues recently reported with Mali GPUs running into with OpenGLES. On my device, both are OK on normal apps - if Vulkan is indeed OK, I would expect it to be selected. This is not true, however, on a flutter_gpu app.

Here's an example of the black screen I see - it is not entirely black, but the section with flutter_gpu is:

Image

The image above is from an app built from the master branch, which is making extensive use of flutter_gpu. The second part to this issue is that using OpenGL with flutter_gpu appears to be unsupported (the same occurs for another developer): I'm not sure whether this is supposed to be the case, but it happens across 2 flutter_gpu apps and I cannot see any documentation saying Vulkan is required - just that Impeller is required (https://github.com/flutter/engine/blob/main/docs/impeller/Flutter-GPU.md)?

The first app (screenshot above) is too complicated to share or compress into an MRE, but the issue with the second flutter_gpu app occurs on the same MRE as #164278.

No idea if it's useful, but here's a perfetto trace capturing the entire system. com.example.example is the first app (after ~2 seconds I turn on a debug view, so GPU activity appears). Here's one for the MRE, com.example.flutter_gpu_memory_leak. Both are running with OpenGL.

TLDR; OpenGL appears to be selected over Vulkan even though Vulkan appears to work on at least one system. This impacts flutter_gpu apps, which appear to be incompatible with OpenGL. (Not sure if this is more suited to two issues, but I have a feeling maybe it's expected flutter_gpu only works with Vulkan, I just can't be sure?)

Happy to provide more info if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectflutter-gpuplatform-androidAndroid applications specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    🤔 Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions