Skip to content

GPU frame time metrics in benchmarks are measured incorrectly #196096

Closed

Description

@smgpie3

Steps to reproduce

Run a flutter macrobenchmarks devicelab task that measures gpu frame time with vulkan backend like cubic_bezier_perf__timeline_summary

Expected results

The frame build time should be measured correctly

Actual results

metrics like average_gpu_frame_time and worst_gpu_frame_time are all 0.

Code sample

Just run the devicelab tasks, we have reproduced this locally while the flutter benchmarks dashboard also shows this.

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

[✓] Flutter (Channel stable, 3.47.8, on Ubuntu 24.04.5 LTS 7.0.0-42-generic, locale en_US.UTF-8) [53ms]
• Flutter version 3.47.8 on channel stable at /home/xxx/projects/flutter-demo/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 737ba8f (2 weeks ago), 2026-10-22 21:37:31 -0700
• Engine revision cf636b1
• Dart version 3.13.7
• DevTools version 2.60.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[!] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [1,041ms]
• Android SDK at /home/xxx/Android/Sdk
• Emulator version 36.6.11.0 (build_id 15507667) (CL:N/A)
• Platform android-37.1, build-tools 37.0.0
• ANDROID_HOME = /home/xxx/Android/Sdk
• Java binary at: /opt/android-studio/jbr/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [10ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop [178ms]
• Android (13691557, +pgo, +bolt, +lto, +mlgo, based on r522817d) clang version 18.0.4 (https://android.googlesource.com/toolchain/llvm-project d8003a456d14a3deb8054cdaa529ffbf02d9b262)
• cmake version 3.28.3
• ninja version 1.11.1
• pkg-config version 1.8.1
! Unable to access driver information using 'eglinfo'.
It is likely available from your distribution (e.g.: apt install mesa-utils)

[✓] Connected device (2 available) [163ms]
• 25098PN5AC (mobile) • 95330132 • android-arm64 • Android 17 (API 37)
• Linux (desktop) • linux • linux-x64 • Ubuntu 24.04.5 LTS 7.0.0-42-generic

[✓] Network resources [614ms]
• All expected network resources are available.

! Doctor found issues in 2 categories.

Activity

  1. smgpie3 commented on Nov 6, 2026

    @smgpie3
    Author

    We have identified a cause for this:
    In the vulkan backend impl, both KHR and AHB swapchains for onscreen command buffer call MarkFrameEnd() before ending the command buffer. With AHB, when RecordCmdBufferEnd() is called, in_frame_ is already false, so no end timestamp is ever recorded. While with KHR, RecordCmdBufferEnd() was never ever called. So either way, for a frame without offscreen passes, only a start timestamp exists.

  2. sreevishnuqa commented on Nov 6, 2026

    @sreevishnuqa

    @smgpie3
    Reproduced successfully on Samsung SM-S931B (Android 17, API 37).

    average_gpu_frame_time: 0.0
    worst_gpu_frame_time: 0.0
    90th_percentile_gpu_frame_time: 0.0
    99th_percentile_gpu_frame_time: 0.0
    average_gpu_memory_mb: 95.14

    **Flutter doctor **
    vishnu@vishnu ~ % flutter doctor -v
    [✓] Flutter (Channel stable, 3.47.9, on macOS 27.3 26C5035r darwin-arm64, locale en-US) [554ms]
    • Flutter version 3.47.9 on channel stable at /Users/vishnu/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c197ca5 (8 days ago), 2026-10-29 10:10:20 -0400
    • Engine revision 89c39ed
    • Dart version 3.13.7
    • DevTools version 2.60.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android,
    enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager,
    omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
    [✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [1,073ms]
    • Android SDK at /Users/vishnu/Library/Android/sdk
    • Emulator version 37.2.13.0 (build_id 16740729) (CL:N/A)
    • Platform android-37.2, build-tools 37.0.0
    • ANDROID_HOME = /Users/vishnu/Library/Android/sdk
    • Java binary at: /Applications/Android Studio 2.app/Contents/jbr/Contents/Home/bin/java
    This JDK is specified in your Flutter configuration.
    To change the current JDK, run: flutter config --jdk-dir="path/to/jdk".
    • Java version OpenJDK Runtime Environment (build 25.0.4+-16339643-b508.27)
    • All Android licenses accepted.
    [✓] Xcode - develop for iOS and macOS (Xcode 27.3) [1,096ms]
    • Xcode at /Applications/Xcode-27.3-Beta-3.app/Contents/Developer
    • Build 27C5020n
    • CocoaPods version 1.16.2
    [✓] Chrome - develop for the web [4ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    [✓] Connected device (4 available) [6.3s]
    • SM S931B (mobile) • RZGYB1QW1XB • android-arm64 • Android 17 (API 37)
    • iPhone 18 Pro (mobile) • 2D97F738-B075-4A11-9935-A77396DDA018 • ios •
    com.apple.CoreSimulator.SimRuntime.iOS-27-2 (simulator)
    • macOS (desktop) • macos • darwin-arm64 • macOS 27.3 26C5035r darwin-arm64
    • Chrome (web) • chrome • web-javascript • Google Chrome 157.0.8103.39
    ! Error: Browsing on the local area network for Quincy iphone 14 pro. Ensure the device is unlocked and attached
    with a cable or associated with the same local area network as this Mac.
    The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for flutter’s iPhone. Ensure the device is unlocked and attached with a
    cable or associated with the same local area network as this Mac.
    The device must be opted into Developer Mode to connect wirelessly. (code -27)
    [✓] Network resources [940ms]
    • All expected network resources are available.
    • No issues found!

    Logs : attached
    cubic_bezier_benchmark.log

    Attached the complete benchmark logs and for investigation.

  3. added
    in triage
    on Nov 6, 2026
  4. puneetkukreja98 commented on Nov 6, 2026

    @puneetkukreja98
    Contributor

    @sreevishnuqa Thanks for testing this, routing this to team-engine for further investigation.

  5. added
    engine
    e: impeller
    team-engine
    c: performance
    and removed
    in triage
    on Nov 6, 2026
  6. gaaclarke commented on Nov 9, 2026

    @gaaclarke
    Member

    @andywolff can you check our CI measurements to see if we are getting zero?

  7. added
    P2
    on Nov 9, 2026
  8. andywolff commented on Nov 9, 2026

    @andywolff
    Contributor

    Confirmed that for test cubic_bezier_perf__timeline_summary (dashboard link) metrics average_gpu_frame_time and worst_gpu_frame_time and such are all 0 in our CI benchmarks.

    Good catch, thanks, I'll take a look at fixing it

  9. added
    triaged-engine
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2c: performancee: impellerengineteam-enginetriaged-engine

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions