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

QOpenglWidget performance drop with external GPU

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.2, 6.2.3
    • GUI: OpenGL
    • None
    • Macbook with Intel GPU and external GPU
    • macOS

    Description

      Hi, 
       
      Recently I have upgraded from Qt-5.4.1 to Qt-5.15.2.
      The following is my system configuration:

      • Macbook with Intel GPU, MacOS Monterey 12.1
      • External display connected to External GPU (Apple's eGPU), and made as the primary screen, connected to a macbook
         
        In my test application attached here, I have 4 QOpenGLWidgets which just simply draws triangles in each QOpenGLWidgets, which changes color every 16ms.
         
        The rendering performance in my app used to be 60fps as it was rendering on the external GPU. However, after Qt-5.15 upgrade, I noticed the performance has dropped. In this particular testApp, the drop is not so much but it proves the point. And there are load in my macbook's Intel GPU. Previously, there won't be any load in macbook's Intel GPU.
         
        Upon investigating, I found out that its due to QOffscreenSurface's change to be not window-backed anymore. Since QOpenGLWidget internally uses QOffscreenSurface, I believe this is causing the rendering to not happen on the screen's GPU. When I hack the code to make the QOffscreenSurface to window-backed, I'm able to get the same performance as before. Although its hard to see the performance difference with bare eye, we can see the fps rendered and the GPU history window to show the load. I have attached screenshots for this too.
         
        Is there any clean or better way to achieve the same performance I used to achieve before? If not, are there any effects if I force QOffscreenSurface to be window backed for MacOS?

      Attachments

        1. QOpenGLWidgetPerformanceDrop.zip
          4 kB
          sivan nanthiran
        2. qtOpenGLWidgetPerformance.diff
          2 kB
          sivan nanthiran
        3. UsingNonWindowBackedOffscreenSurface.png
          17.73 MB
          sivan nanthiran
        4. UsingWindowBackedOffscreenSurface.png
          16.92 MB
          sivan nanthiran
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            nanthiran2005 sivan nanthiran
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes