xwayland has a VRAM leak on nvidia system when resizing Emacs window
Description:
When using Emacs (which doesn't support wayland) under Xwayland, resizing the window up and down will cause the VRAM usage (as noted by nvidia-smi) to go up to 2.4gb.
Additional info:
- package version(s): 23.2.3-1
- config and/or log files:
kernel version: 6.6.8
mesa version: 1:23.3.1-1
nvidia-dkms: 545.29.06-1
emacs-nativecomp: 29.1-4
- link to upstream bug report, if any: it sounds similar to this, but was fixed 2 years ago: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5645
Steps to reproduce:
- Start a Plasma (wayland) session or hyprland
- Install emacs-nativecomp (I have 29.1-4)
- Open emacs --no-init-file
- In a terminal, run watch -n1 nvidia-smi
- Resize the window a few times
- Close emacs
- Notice the nvidia-smi output is really high:
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.06 Driver Version: 545.29.06 CUDA Version: 12.3 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 4090 Off | 00000000:06:00.0 On | Off |
| 0% 34C P5 41W / 450W | 3435MiB / 24564MiB | 2% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 5104 G Hyprland 473MiB |
| 0 N/A N/A 5175 G /usr/lib/firefox/firefox 403MiB |
| 0 N/A N/A 11026 G Xwayland 2465MiB |
+---------------------------------------------------------------------------------------+
Let me know how else I can debug this. As far as I can tell, I don't see anything related to Xwayland in the compositor logs (which I think is in journalctl -b 0
, also checked journalctl --user -b 0
, nor is there anything interesting in the kernel logs.
And this only happens for emacs, it doesn't appear to happen for apps like xterm.