Skip to content

App freezes when GPU is disabled while the app is running #124194

Open

Description

@temirlanzhangazy

While running Flutter app on a desktop, if you disable GPU, (even if enable it again) flutter app will freeze.

Expected results:
Flutter Desktop App would switch GPU or turn on software rendering.

Actual results:
Rendering has stopped. The application is frozen.

Example:
Windows app built with Flutter is set to launch on startup, but some users are experiencing issues where their GPU is not fully enabled yet, causing the app to freeze or crash. To address this, a third-party app was developed that delays the launch of the Flutter app until the GPU is fully enabled. Also when some GPU functionalities like Nvidia G-Sync were turned on AFTER the flutter app was launched, app freezes too.

flutter doctor -v
[√] Flutter (Channel master, 3.9.0-13.0.pre.4, on Microsoft Windows [Version 10.0.19045.2728], locale
    en-GB)
    • Flutter version 3.9.0-13.0.pre.4 on channel master at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8de2433a4c (2 weeks ago), 2023-03-21 06:58:24 -0400
    • Engine revision e07fb9b5dd
    • Dart version 3.0.0 (build 3.0.0-348.0.dev)
    • DevTools version 2.22.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\zhang\AppData\Local\Android\sdk
    • Platform android-33-ext5, build-tools 33.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at
    .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.5.33516.290
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)

[√] VS Code (version 1.76.2)
    • VS Code at C:\Users\zhang\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.62.0

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.2728]
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 111.0.1661.62

[√] Network resources
    • All expected network resources are available.

Activity

  1. added
    in triage
    on Apr 5, 2023
  2. exaby73 commented on Apr 5, 2023

    @exaby73
    Member

    Hello @temirlanzhangazy. Are you able to reproduce this issue in debug mode? Are there any stack traces you can provide?

  3. added
    waiting for response
    on Apr 5, 2023
  4. temirlanzhangazy commented on Apr 6, 2023

    @temirlanzhangazy
    Author

    Hello. I tried the same thing in debug mode: same result.
    What is interesting:
    The app seems to be fully working, all print messages are being created, and Windows cursor is reacting to hover events (pointer cursor on button).

  5. removed
    waiting for response
    on Apr 6, 2023
  6. danagbemava-nc commented on Apr 6, 2023

    @danagbemava-nc
    Member

    Hi @temirlanzhangazy, does this occur with the sample app as well or only with your app?

  7. added
    waiting for response
    on Apr 6, 2023
  8. temirlanzhangazy commented on Apr 6, 2023

    @temirlanzhangazy
    Author

    Yes, this occurs with the sample app too.

  9. removed
    waiting for response
    on Apr 6, 2023
  10. temirlanzhangazy commented on Apr 6, 2023

    @temirlanzhangazy
    Author
    Flashback.-.Apr.6.2023.13_44_20.mp4

    Here is the sample app.
    When I disable the GPU driver, all apps will switch GPU or turn on software rendering. But flutter app's rendering is freezed.

  11. danagbemava-nc commented on Apr 6, 2023

    @danagbemava-nc
    Member

    Hi @temirlanzhangazy, if you run the app with the --enable-software-rendering flag, do you still have this issue? Can you also check on the latest version of the master channel to see if the issue is still there?

  12. added
    waiting for response
    on Apr 6, 2023
  13. temirlanzhangazy commented on Apr 6, 2023

    @temirlanzhangazy
    Author

    Yes, issue is the same with --enable-software-rendering flag.
    I have the latest version of the master channel.

    I noticed these errors after disabling GPU.
    2 ERR: SwapChain11.cpp:947 (present): Present failed: the D3D11 device was removed, HRESULT: 0x887A0005
    2142 [ERROR:flutter/shell/gpu/gpu_surface_gl_skia.cc(217)] Could not make the context current to acquire the frame.

  14. removed
    waiting for response
    on Apr 6, 2023
  15. temirlanzhangazy commented on Apr 6, 2023

    @temirlanzhangazy
    Author

    How can I catch these errors so I can exit my application?

  16. 51 remaining items

  17. KuuBee commented on Oct 20, 2025

    @KuuBee

    Our team’s Flutter-based Windows app sometimes shows a white screen on certain machines under special circumstances. After digging into it, we found that in some cases the GPU driver gets uninstalled or disabled at specific times. To handle this, we designed a workaround. Our situation may not be exactly the same as your issue, but it seems related, so we’d like to share our approach in case it helps.

    By default, Flutter’s Windows engine renders via D3D11 (GPU). Since we cannot predict when a user’s machine might lose its GPU driver, we decided to force the app to use CPU rendering instead.

    Google maintains a project that provides a CPU-based D3D9 implementation: SwiftShader. See: https://swiftshader.googlesource.com/SwiftShader/

    Our method is to hook the LoadLibraryW function. When we detect an attempt to load d3d11.dll, we return NULL to make the load fail. In that case, the Flutter engine falls back to D3D9. Make sure you place SwiftShader’s d3d9.dll in the same directory as your application executable so the fallback can succeed.

    If everything works as expected, the Flutter engine will successfully load d3d9.dll and render via CPU-based D3D9. This does have downsides: we observe higher CPU usage on lower-end machines when using CPU rendering. Whether this is acceptable depends on your scenario.

    The relevant code is included in the attached archive; you can download and review it.

    cpu_render_code.zip

  18. letrungdo commented on Oct 21, 2025

    @letrungdo
    Contributor

    @KuuBee Thanks for your great solution. Can you tell me where to get the d3d9.dll file?

  19. KuuBee commented on Oct 22, 2025

    @KuuBee

    @KuuBee Thanks for your great solution. Can you tell me where to get the d3d9.dll file?

    @letrungdo You can directly use the dll in the compressed package I uploaded or compile it locally by yourself through this link

    https://swiftshader.googlesource.com/SwiftShader/+/refs/heads/legacy-d3d9

  20. letrungdo commented on Nov 17, 2025

    @letrungdo
    Contributor

    @KuuBee Your way everything is fine but unfortunately webview2 can't be used

  21. KuuBee commented on Nov 19, 2025

    @KuuBee

    @KuuBee Your way everything is fine but unfortunately webview2 can't be used

    @letrungdo You can try this pub: https://pub.dev/packages/webview_cef. If that doesn't meet your needs either, then there might not be a good solution, and you'll have to choose one of the two...

  22. letrungdo commented on Nov 20, 2025

    @letrungdo
    Contributor

    @KuuBee Thanks for your suggestion, I tried it but it still doesn't work.
    The solution is to use https://pub.dev/packages/webview_win_floating worked for me

  23. itschrono commented on Jan 14, 2026

    @itschrono

    I also had the occurrence but installing a new Intel graphics. All applications freeze a few secondes but recover, all except the flutter application. I think if a EGL context error or similar is encountered multiple time in a row the flutter engine should try to reinitialize the graphic context from the beginning.
    Flutter (Channel stable, 3.38.5, on Microsoft Windows [version 10.0.26200.7462], locale fr-FR)
    Windows Version (11 Professionnel 64-bit, 25H2, 2009)

  24. zxcv1884 commented on Mar 5, 2026

    @zxcv1884

    I am also encountering this issue in my project.

    Is there any update on this or a planned fix?

  25. reduxdj commented on Apr 1, 2026

    @reduxdj

    This is happening with intel graphics driver updates, which happened yesterday.

    Image

    Dear flutter team, can you at least add some AI bot to make us feel like you are reviewing these issues? This is so frustrating that this gets ingored. I have a workaround, if anybody wants to know how we solve it am happy to share code

  26. DitriXNew commented on Apr 2, 2026

    @DitriXNew

    I do this simple solution, and it works for me, so, mb it will helps you too.
    https://github.com/DitriXNew/windows_gpu_recovery

  27. mateusfontanaa commented on Jun 15, 2026

    @mateusfontanaa

    We are experiencing this same behavior on two Windows 11 machines with Intel Integrated Graphics. Given that this issue has been open since 2023, is there any update or perspective for a potential fix? Let us know if further logs are needed to help move this forward.

  28. mainjzb commented on Oct 15, 2026

    @mainjzb

    flutter windows 3.47 start use impeller, maybe we need add software rendering in impeller.

    relation issue: #187763

  29. denissilantev64 commented on Nov 8, 2026

    @denissilantev64

    I am experiencing the same issue on Windows with Flutter 3.47. The app completely freezes when the GPU is disabled or after a video driver reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2a: desktopc: crashenginefound in release: 3.7found in release: 3.9has reproducible stepsplatform-windowsteam-windowstriaged-windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions