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

QOpenGLWindow Crashes on GPU-less Windows VM

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.5.3
    • GUI: OpenGL
    • None
    • Windows

    Description

      After migrating from QOpenGLWidget to QOpenGLWindow, as per the Qt documentation, we have encountered a critical issue. Our application crashes when using QOpenGLWindow on a Windows virtual machine with the GPU disabled. The crash seems to be caused by a nullptr exception when calling the glBindFramebuffer API, as the BindFramebuffer is not being set for the window's OpenGL functions as it only loaded opengl32.dll.

      Impact:

      This issue has posed a significant problem for our users and we are seeking urgent assistance to resolve it. While GPU is generally required for the best user experience, we still need this support for testing certain workflows and for legacy reasons. We are curious to know if there are alternatives for this approach when GPU is not available.

      Steps to Reproduce:

      • Disable GPU on a Windows virtual machine.
      • Run the following code that uses QOpenGLWindow.

      #include <QApplication>
      #include <QOpenGLWindow>
      #include <QOpenGLFunctions>

      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);

          QOpenGLWindow window;

          QSurfaceFormat format;
          format.setVersion(3, 3);
          format.setRenderableType(QSurfaceFormat::OpenGL);
          format.setProfile(QSurfaceFormat::CoreProfile);
          window.setFormat(format);

          window.show();

          return app.exec();
      }

      * Observe the crash when glBindFramebuffer API is called during paint.

      Expected Result:

      The application runs smoothly with QOpenGLWindow whether the GPU is enabled or disabled.

      Actual Result:

      Application crashes when the GPU is disabled, due to a nullptr exception when calling glBindFramebuffer API. 

      Note:

      • Upon debugging, it appears that the BindFramebuffer is implemented by the Nvidia driver via nvoglv64.dll when the GPU is enabled. However, when the GPU is disabled, this does not occur, leading to the crash.
      • As per dynamically-loading-opengl, I tried configuring the local build with -opengl dynamic and set the Qt::AA_UseSoftwareOpenGL attribute before the app launch, it should allow Qt to pick the software renderer lib with the specialized name called opengl32sw.dll. However, this didn't work. This file is nowhere to be found in the local Qt build directory. I attempted to build the standalone app with the libs I obtained from mesa3d installation sources, it appears to let the standalone build work as expected. It would be great if one of the experts could confirm the best course of action.
      • I am also attaching the call stack for reference.

      Attachments

        For Gerrit Dashboard: QTBUG-124302
        # Subject Branch Project Status CR V

        Activity

          People

            lagocs Laszlo Agocs
            kandass1 Senthil Kannan Kandaswamy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews