Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120761

WebEngine does not handle inability to create context gracefully.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.6, 6.7
    • WebEngine
    • None
    • Linux/Wayland

    Description

      When running on Wayland, things that use the Qt WebEngine fail in a pretty unfriendly manner on my Debian Sid system with an nVidia GPU.

      While it might be nice to fix the root cause, a much higher level problem is that when the embedded Chromium fails to create a GL context, WebEngine doesn't reliably fail back to software rendering.

      How exactly this presents varies, but the error string pattern looks something like:
       

      [372807:372826:1125/120136.786643:ERROR:gl_context_egl.cc(355)] eglCreateContext failed with error EGL_BAD_CONTEXT
      [372807:372826:1125/120136.786662:ERROR:gpu_channel_manager.cc(835)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
      [372807:372826:1125/120136.786668:ERROR:shared_image_stub.cc(537)] SharedImageStub: unable to create context
      [372807:372826:1125/120136.786675:ERROR:gpu_channel.cc(572)] GpuChannel: Failed to create SharedImageStub

      In the best case, this happens twice, and then something falls back and we get a usable application.

      In the next best case, things fail here and we don't get a usable application, no rendering of the WebEngine happens.

      In the worst case, such as plasmashell 5.27.9.1 as is currently shipped in Debian Sid, with a QML widget that uses QtWebEngine, adding the widget goes down the first path, but when plasmashell next restarts, we go into an infinite loop somewhere (not blocking the main renderer thread) trying to create the context over and over again, generating a huge amount of spam in the logs in the process.

      In that worst case, getting hundreds of thousands of lines of logs in a short while is perfectly possible.

      Ideally, we should be doing something similar to what Chromium does when, for whatever reason, it can not successfully utilize hardware acceleration, and fall back to a software rendering path.

      This is happening for both Qt 5.15.15 and 6.4.2, both as they are shipped currently in Debian Sid.

      (The specific underlying bug breaking things above appears to be related to how chromium is attempting to build and use shared EGL contexts, but that appears to be an upstream issue.)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pvarga Peter Varga
            lizzykitty Liz Loss-Cutler-Hull
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes