Skip to content

Flutter Linux applications crash immediately on startup with the following assertion failure: Assertion 0 && "Couldn't find current GLX or EGL context.\n"' failed. #173837

@Supermagnum

Description

@Supermagnum

Steps to reproduce

This appears to be related to libepoxy not finding a valid OpenGL context when Flutter initializes its rendering engine.

Steps to Reproduce:

  1. Create any Flutter Linux application
  2. Run flutter run -d linux on a system with NVIDIA graphics
  3. Application crashes immediately with epoxy assertion

System Information:

  • OS: Linux mint

  • Flutter version: Flutter 3.32.8 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision edada7c (3 weeks ago) • 2025-07-25 14:08:03 +0000
    Engine • revision ef0cd00 (3 weeks ago) • 2025-07-24 12:23:50 -0700
    Tools • Dart 3.8.1 • DevTools 2.45.1

  • GPU: NVIDIA GeForce RTX 3070 Ti

  • Driver: NVIDIA 550.163.01

  • **Desktop Environment:**Cinnamon

Additional Context:

  • Direct OpenGL rendering works fine (verified with glxinfo)
  • Hardware acceleration is available and functional
  • Issue persists with various environment variables and GL context pre-creation attempts
  • Problem appears to be that Flutter's epoxy integration expects a GL context to already exist when it initializes

Expected Behavior:
Flutter Linux application should start normally and render using hardware acceleration.

Actual Behavior:
Application crashes with epoxy assertion before any Flutter rendering begins.

It is related to this:


supermorse_flutter: ../src/dispatch_common.c:872: epoxy_get_proc_address: Assertion `0 && "Couldn't find current GLX or EGL context.\n"' failed.`

=== Flutter Version ===
Flutter 3.32.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision edada7c56e (3 weeks ago) • 2025-07-25 14:08:03 +0000
Engine • revision ef0cd00091 (3 weeks ago) • 2025-07-24 12:23:50 -0700
Tools • Dart 3.8.1 • DevTools 2.45.1


[✓] Flutter (Channel stable, 3.32.8, on Linux Mint 22.1 6.8.0-71-generic, locale nb_NO.UTF-8) [36ms]
    • Flutter version 3.32.8 on channel stable at /home/haaken/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision edada7c56e (3 weeks ago), 2025-07-25 14:08:03 +0000
    • Engine revision ef0cd00091
    • Dart version 3.8.1
    • DevTools version 2.45.1

[✗] Android toolchain - develop for Android devices [38ms]
    ✗ 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 [16ms]
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop [396ms]
    • 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: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2 (X11)
    • OpenGL core version: 4.6.0 NVIDIA 550.163.01 (X11)
    • OpenGL core shading language version: 4.60 NVIDIA (X11)
    • OpenGL ES renderer: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2 (X11)
    • OpenGL ES version: OpenGL ES 3.2 NVIDIA 550.163.01 (X11)
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20 (X11)
    • GL_EXT_framebuffer_blit: yes (X11)
    • GL_EXT_texture_format_BGRA8888: yes (X11)

[!] Android Studio (not installed) [13ms]
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).

[✓] VS Code (version unknown) [13ms]
    • VS Code at /usr/share/code
    • Flutter extension version 3.116.0
    ✗ Unable to determine VS Code version.

[✓] Connected device (2 available) [78ms]
    • Linux (desktop) • linux  • linux-x64      • Linux Mint 22.1 6.8.0-71-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 138.0.7204.183

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

! Doctor found issues in 2 categories.

=== System Info ===

Linux haken-computer 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
=== GPU Info ===
09:00.0 VGA compatible controller: NVIDIA Corporation GA104 [GeForce RTX 3070 Ti] (rev a1)
09:00.1 Audio device: NVIDIA Corporation GA104 High Definition Audio Controller (rev a1)
Fri Aug 15 11:29:04 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.163.01             Driver Version: 550.163.01     CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3070 Ti     Off |   00000000:09:00.0  On |                  N/A |
|  0%   53C    P0             38W /  310W |     489MiB /   8192MiB |      5%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      1706      G   /usr/lib/xorg/Xorg                            180MiB |
|    0   N/A  N/A      2311      G   cinnamon                                       40MiB |
|    0   N/A  N/A      2859      G   /usr/lib/firefox/firefox                      200MiB |
|    0   N/A  N/A     25166      G   /usr/share/code/code                           52MiB |
+-----------------------------------------------------------------------------------------+
=== OpenGL Info ===
name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
    GLX_ARB_context_flush_control, GLX_ARB_create_context, 
    GLX_ARB_create_context_no_error, GLX_ARB_create_context_profile, 
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_multisample, GLX_EXT_buffer_age, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 
    GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, GLX_EXT_libglvnd, 
    GLX_EXT_stereo_tree, GLX_EXT_swap_control, GLX_EXT_swap_control_tear, 
    GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, 
    GLX_NV_copy_image, GLX_NV_delay_before_swap, GLX_NV_float_buffer, 
    GLX_NV_multigpu_context, GLX_NV_robustness_video_memory_purge, 
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGI_swap_control, 
    GLX_SGI_video_sync
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
=== Environment ===
Desktop: X-Cinnamon
Session: x11

My repository:
https://gitlab.com/supermag-group/supermorse-app/-/tree/supermorse_flutter?ref_type=heads

Expected results

Expected it to run and show a working app window.

Actual results

The app displays a black screen. I have tried multiple different methods to fix this, with no luck.
That is why I suspect that it is a bug.

Code sample

CMakeLists.txt

Screenshots or Video

No response

Logs

flutter_output.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: desktopRunning on desktopc: crashStack traces logged to the consoleplatform-linuxBuilding on or for Linux specificallyteam-linuxOwned 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