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

NULL parenting a parent of a window container containing a QOpenGLWindow make Xorg leaks VRAM

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.8, 5.9.1, 5.9.6, 5.10.1, 5.11.1
    • GUI: OpenGL
    • None
    • Linux, nvidia graphic card and nvidia driver, any window manager with an enabled compositor, Xorg.
    • Linux/X11

    Description

      If a parent of a window container containing a QOpenGLWindow is null parented before deletion, Xorg will leaks on VRAM in certain situations.

       

      The situation in questions :

      Linux, any distribution, any window manager with a compositor*,* Xorg, nivida driver

      If compositor is deactivated, no leaks appears. with other driver the leak does not appears, Wayland was not tested

      How to reproduce :

      • Download attached example
      • Close all window except a single terminal
      • configure QOpenGLWindowBug with cmake
      • build it
      • run nvidia-smi
      • (run QOpenGLWindowBug, maximize window, close) * 8
      • run nvidia-smi, no leaks
      • (run QOpenGLWindowBug, maximize window, click on PushButton, close) * 8
      • run nvidia-smi, Xorg as leaked ~30Mb of VRAM

       

      Here are my results (second part only):

       

      $ nvidia-smi
      +-----------------------------------------------------------------------------+
      | NVIDIA-SMI 390.48                 Driver Version: 390.48                    |
      |-------------------------------+----------------------+----------------------+
      | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
      | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
      |===============================+======================+======================|
      |   0  GeForce GTX 105...  Off  | 00000000:01:00.0 Off |                  N/A |
      | N/A   46C    P8     4W /  N/A |     50MiB /  4040MiB |      0%      Default |
      +-------------------------------+----------------------+----------------------+
       
      +-----------------------------------------------------------------------------+
      | Processes:                                                       GPU Memory |
      |  GPU       PID   Type   Process name                             Usage      |
      |=============================================================================|
      |    0     29628      G   /usr/lib/xorg-server/Xorg                     47MiB |
      +-----------------------------------------------------------------------------+
      $ ./QOpenGLWindowBug ... *8
      $ nvidia-smi
      +-----------------------------------------------------------------------------+
      | NVIDIA-SMI 390.48                 Driver Version: 390.48                    |
      |-------------------------------+----------------------+----------------------+
      | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
      | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
      |===============================+======================+======================|
      |   0  GeForce GTX 105...  Off  | 00000000:01:00.0 Off |                  N/A |
      | N/A   46C    P8     4W /  N/A |    80MiB /  4040MiB |      0%      Default |
      +-------------------------------+----------------------+----------------------+
       
      +-----------------------------------------------------------------------------+
      | Processes:                                                       GPU Memory |
      |  GPU       PID   Type   Process name                             Usage      |
      |=============================================================================|
      |    0     29628      G   /usr/lib/xorg-server/Xorg                    77MiB |
      +-----------------------------------------------------------------------------+
      

       

      The VRAM never gets released unless Xorg is killed or closed. It will builds up until it reachs 96% of the VRAM and then starts to "evict" into RAM until RAM is full, and then OpenGL fails.

       

      Attachments

        1. QOpenGLWindowBug.tgz
          1 kB
          Mathieu Westphal
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            mwestphal Mathieu Westphal
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes