-1

I am working on a rather big Qt5/OpenGL application. Each time the application run and exit on a linux with nvidia driver, with a compositor active, nvidia-smi shows an increase of 4Mb of VRAM usage for Xorg process.

My suposition would be that even if my application leaks, everything should be released when it is destroyed, but it does not seems to be the case.

On this thread OpenGL GPU Memory cleanup, required?, Someone mentionned that it would not be the case if "Display list" are shared.

I do not know much about OpenGL, and could not find coherent informations about this issue on the web.

My objective is to understand how this could happen, where it may come from in my code and how to fix it.

Note :

The leaks are present in Xorg after my Aplication is stopped and no other process then Xorg and Desktop Environnement related are shown in nvidia-smi

The DE I use does not matter (tested : KDE, Lxde, OpenBox, Gnome, Unity).

The Linux Distribution I use (almost) does not matter (tested: Ubuntu 16.04, Ubuntu 18.04, fedora 26) (not reproduced on ArchLinux yet, we are still investigating this)

The nvidia driver version does not matter, tested 340, 384, 390.

Mathieu Westphal
  • 2,544
  • 1
  • 19
  • 33

1 Answers1

0

The issue was resolved thanks to an intense debugging session.

The leak was caused by NULL parenting the parent of the windowContainer containing the QVTKOpenGLWindow just before deletion.

This code was here before when we used a QOpenGLWidget and it caused no issue. In any case, NULL parenting a widget before deletion is useless so removing the line resolve the issue.

This leak shouldn't happen though, even in this situation, so I have opened a Qt issue to report it.

Mathieu Westphal
  • 2,544
  • 1
  • 19
  • 33