Multiple wayland compositors not freeing VRAM after resizing windows

I’ve tested this with (on arch linux, kernel 6.10)

nvidia versions:

  • 560.35.03
  • 555.58.02
  • 550.78

compositors:

  • kwin_wayland
  • sway
  • weston
  • (reports that this happens on gnome-shell as well, but I haven’t tested myself)

egl-wayland versions:

  • 1.1.9
  • 1.1.13
  • 1.1.2
  • 1.1.16

All with the same behaviour, on my 24GB 4090, if I resize a window, nvidia-smi reports that the compositor increases in memory usage, and it won’t free it up until it uses approximately 10% of the total VRAM, around 2.4 to 2.5GB.

Even after closing the windows, the VRAM does not get freed. This does not happen on my AMD GPU.

1 Like

Related discussions across the web (most people notice this on xwayland):

and some in the 560 feedback thread.

1 Like

Since you have an AMD GPU too, does it even increase the VRAM usage while resizing?

Yes, resizing a konsole adds about 100MB to kwin_wayland, but it gets freed within seconds (according to nvtop)

1 Like

Ok, yeah, 100MB isn’t much either, compared to Nvidia allocating over 1GB.
Anyway, they aknowledged this, at least the Xwayland “leak”, hopefully we will get a fix in the next driver release.

It’s been awfully quiet from Nvidia on the forum recently, hopefully they are busy crunching.

I think it’s an issue with the EGL implementation, using zink or any wlroots based window manager with WLR_RENDERER=vulkan may workaround the issue.

Setting WLR_RENDERER=vulkanin /etc/environment doesn’t reduce VRAM usage a bit, on my workstation.

What is the origin of this advice, please?

Mhh… but kwin_wayland uses libGL as well so… I don’t know if it’s specific to EGL.
It could be a libGL issue too, since Xwayland doesn’t have EGL linked in at all, and it doesn’t free memory for Xwayland either.

But what do I know, all we know it’s in the driver somewhere.

It will only reduce VRAM usage of the window manager and it need to be wlroots based such as sway, Hyprland, …

Xwayland doesn’t have EGL linked

EGL isn’t hopefully directly linked to Xwayland because each vendor has it own implementation. EGL and even GLX are loaded with libglvnd.

So something is really strange – as suggested by @shelter , I was playing around with window minimizing in kwin_wayland, and found that if you just use the alt-tab switcher, the VRAM usage of kwin_wayland gets freed after resizing. Maybe it has to do with a call that’s being made to generate the live window thumbnails for the switcher?

The solution is here, I’ve tested it on kwin and it works now!

1 Like

Multiple replies to the 560 thread by me and no one from Nvidia responded but they could there? Really?

It’s not even a solution. The issue is with XWayland, not Gnome. Some code somewhere is reserving around 10% of VRAM when it shouldn’t be.

If you read the github solution fully, there are two issues, the Xwayland issue and this. They figured out the solution for this issue, not the Xwayland one since they can’t reproduce it.

You can use the app profile workaround for Xwayland too until it’s fixed.

Also to be fair, he shared the workaround in the 560 thread

Supposedly it’s Wayland only.