Xorg VRAM leak because of Qt/OpenGL Application

Mathieu Westphal mathieu.westphal at kitware.com
Tue Jul 3 06:14:36 UTC 2018


Hi Dennis, Aaron,

Firstly, Dennis, you may have missed that it is *Xorg *leaking in the *VRAM
*and not releasing it even* after my application is exited*/killed
completely.
I have been monitoring the RAM as well, it is fine and my application is
not leaking but somehow forces Xorg to allocate graphical memory that never
gets released.


>
> > I think you are looking at output from an nvidia tool and not memory
> > for the system and processes as a whole.
>
I'm using nvidia-smi as it is available on all system with the nvidia driver
I actually see the same behavior monitoring NVX_gpu_memory_info
<https://www.khronos.org/registry/OpenGL/extensions/NVX/NVX_gpu_memory_info.txt>
 manually


>
> Based on Mathieu's email subject, it sounds like he's interested in how
> much GPU memory Xorg is using. The process data in /proc does not
> include GPU memory.
>
Indeed


>
> Mathieu, when you say memory is leaked, do you mean that the memory
> usage increases each time you run myOpenGLQtBasedApp, or does it
> increase from 50 MB to 110 MB and then stay there even if you run the
> app again?
>
Each time I run and open/close QOpenGLWindow based widget, the graphical
memory usage
increase by 4Mb until it reaches 96% of the availlable VRAM.
It then actually starts to leak on RAM by a mechanism I just learned about
(eviction)
And then, once the RAM is full, OpenGL fails completelly.


> You can diagnose which clients are causing the server to allocate
> resources by running tools such as xrestop, xwininfo -tree -root, and
> xlsclients before and after running your app each time.
>
Here are my results on a test run using Xfce with compositor enabled.
nvidia-smi shows a 61Mb leak

xlsclient -l and xwininfo -tree -root outputs are strictly identical before
and after.
xrestop -b shows a slight increase of lees than a Mb all process
additionned.
(see attached)

Note : Even after multiples runs and hundreds Mb of memory leaked reported
by nvidia-smi,
xrestop total memory usage does not increase.


>
> If you're still having trouble, you can email linux-bugs at nvidia.com and
> we can try to help you out there.
>
I definitely will if we can't figure out what is going on.

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg/attachments/20180703/b8c56835/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xrestop1.out
Type: application/octet-stream
Size: 4096 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg/attachments/20180703/b8c56835/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xrestop0.out
Type: application/octet-stream
Size: 4096 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg/attachments/20180703/b8c56835/attachment-0001.obj>


More information about the xorg mailing list