Skip to content

[Linux] App feels laggy due to raster thread performance issue #182447

@Jappe02

Description

@Jappe02

Steps to reproduce

  1. Boot a fresh Ubuntu 24.04 OS (or other distribution)
  2. Launch a Flutter app
  3. Interact with a draggable widget or look at the animations
  4. Observe inconsistent framerate, input delay and high raster times compared to other platforms

Code sample

Code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      showPerformanceOverlay: true,
      home: DragExample(),
    );
  }
}

class DragExample extends StatefulWidget {
  const DragExample({super.key});

  @override
  State<DragExample> createState() => _DragExampleState();
}

class _DragExampleState extends State<DragExample> {
  double top = 100;
  double left = 100;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      body: Stack(
        children: [
          Positioned(
            top: top,
            left: left,
            child: GestureDetector(
              onPanUpdate: (details) {
                setState(() {
                  left += details.delta.dx;
                  top += details.delta.dy;
                });
              },
              child: Container(
                decoration: BoxDecoration(
                  color: Colors.red,
                  borderRadius: BorderRadius.circular(7.5),
                ),
                clipBehavior: Clip.antiAlias,
                width: 200,
                height: 200,
                child: Center(
                  child: Text("Draggable Widget"),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Performance profiling on master channel

  • The issue still persists on the master channel

Timeline Traces

Timeline Traces JSON

(showPerformanceOverlay: false)

dart_devtools_2026-02-15_18_50_11.775.zip

Video demonstration

Video demonstration

Ubuntu 24.04 (has this issue):
https://github.com/user-attachments/assets/9389ff1c-1215-4c73-8cd9-6e62305a7724

Ubuntu 24.04 - Flutter app runs through Proton Experimental (fork of Wine) (doesn't have this issue):
https://github.com/user-attachments/assets/863e57e9-0c89-4fd4-9532-785cc8dabc7a

Manjaro (has this issue):
https://github.com/user-attachments/assets/7ce327db-1e2f-4704-a7c5-d970add53f2e

Windows 11 (doesn't have this issue):
https://github.com/user-attachments/assets/141fa88c-419d-478d-a026-17aa1dae6e11

What target platforms are you seeing this bug on?

Linux

OS/Browser name and version | Device information

Hardware Information:

  • Hardware Model: Micro-Star International Co., Ltd. Katana A15 AI B8VG
  • Memory: 64.0 GiB
  • Processor: AMD Ryzen™ 9 8945HS w/ Radeon™ 780M Graphics × 16
  • Graphics: AMD Radeon™ Graphics
  • Graphics 1: NVIDIA GeForce RTX™ 4070 Laptop GPU
  • Disk Capacity: 1.0 TB

Software Information:

  • Firmware Version: E158NAMS.50C
  • OS Name: Ubuntu 24.04.3 LTS
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: Wayland
  • Kernel Version: Linux 6.14.0-37-generic

Does the problem occur on emulator/simulator as well as on physical devices?

Unknown

Is the problem only reproducible with Impeller?

No

Logs

Logs

Run the app with integrated AMD GPU:

flutter run --release

Run the app with dedicated Nvidia GPU:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia DRI_PRIME=1 flutter run --release

Running the app with an Nvidia GPU under X11 causes a black screen and the following output:

** (com.example.test:16884): WARNING **: 12:16:03.896: Failed to create OpenGL context: No available configurations for the given RGBA pixel format

** (com.example.test:16884): CRITICAL **: 12:16:04.019: gboolean fl_compositor_present_layers(FlCompositor *, const FlutterLayer **, size_t): assertion 'FL_IS_COMPOSITOR(self)' failed

** (com.example.test:16884): CRITICAL **: 12:16:04.029: gboolean fl_compositor_render(FlCompositor *, cairo_t *, GdkWindow *): assertion 'FL_IS_COMPOSITOR(self)' failed

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.42.0-1.0.pre-138, on Ubuntu 24.04.3 LTS 6.14.0-37-generic, locale en_US.UTF-8) [861ms]
    • Flutter version 3.42.0-1.0.pre-138 on channel master at /home/<user>/DevelopmentTools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 48a9065b69 (5 hours ago), 2026-02-15 10:39:26 -0500
    • Engine revision 48a9065b69
    • Dart version 3.12.0 (build 3.12.0-150.0.dev)
    • DevTools version 2.55.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration, enable-riscv64

[✗] Android toolchain - develop for Android devices [15ms]
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


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

[✓] Linux toolchain - develop for Linux desktop [379ms]
    • Ubuntu clang version 18.1.3 (1ubuntu1)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1
    • OpenGL core renderer: AMD Radeon Graphics (radeonsi, phoenix, LLVM 19.1.1, DRM 3.61, 6.14.0-37-generic)
    • OpenGL core version: 4.6 (Core Profile) Mesa 25.0.7-0ubuntu0.24.04.1
    • OpenGL core shading language version: 4.60
    • OpenGL ES renderer: AMD Radeon Graphics (radeonsi, phoenix, LLVM 19.1.1, DRM 3.61, 6.14.0-37-generic)
    • OpenGL ES version: OpenGL ES 3.2 Mesa 25.0.7-0ubuntu0.24.04.1
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20
    • GL_EXT_framebuffer_blit: yes
    • GL_EXT_texture_format_BGRA8888: yes

[✓] Connected device (1 available) [15ms]
    • Linux (desktop) • linux • linux-x64 • Ubuntu 24.04.3 LTS 6.14.0-37-generic

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

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.from: performance templateIssues created via a performance issue templateplatform-linuxBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform teamtriaged-linuxTriaged by the Linux platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions