Created attachment 173947 [details] nvtop screenshot I observe kwin with wayland using 5GB of VRAM while running a Plasma shell with an Emacs and 3 Konsoles. Which looks a bit too excessive for me. My research involves training lots of relatively small PyTorch models on a single GPU in parallel. VRAM is a limiting resource for me, and getting more of it is most expensive and non-trivial. That's why I keep an eye on VRAM usage. OBSERVED RESULT kwin with wayland use 5GB of VRAM (21% of 24GB) just to display a Plasma shell with an Emacs and 3 Konsoles. EXPECTED RESULT kwin with wayland use well under 1GB VRAM for this use case. SOFTWARE/OS VERSIONS Operating System: KDE neon 6.0 KDE Plasma Version: 6.1.5 KDE Frameworks Version: 6.5.0 Qt Version: 6.7.2 Kernel Version: 6.8.0-45-lowlatency (64-bit) Graphics Platform: Wayland Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor Memory: 125.7 GiB of RAM Graphics Processor: NVIDIA GeForce RTX 4090/PCIe/SSE2 nvidia-driver-555 ADDITIONAL INFORMATION nvidia-smi -q output (sometime earlier than nvtop screenshot): ... Processes Process ID : 2302 Type : G Name : /usr/lib/xorg/Xorg Used GPU Memory : 30 MiB Process ID : 6113 Type : G Name : /usr/bin/kwin_wayland Used GPU Memory : 2326 MiB Process ID : 6182 Type : G Name : /usr/bin/Xwayland Used GPU Memory : 2478 MiB Process ID : 6217 Type : G Name : /usr/bin/ksmserver Used GPU Memory : 6 MiB Process ID : 6233 Type : G Name : /usr/bin/plasmashell Used GPU Memory : 122 MiB ...
Process ID : 6182 Type : G Name : /usr/bin/Xwayland Used GPU Memory : 2478 MiB what's the VRAM usage of Xwayland without open windows? also please post output of `qdbus org.kde.KWin /KWin supportInformation`
https://invent.kde.org/-/snippets/3238 I have similar GPU usage under nvidia (different kernel/driver version though), I've attached the support information as well as my kwin output (I try to avoid using Xwayland so I don't have the xwayland problem, but 2.7GB vram usage seems excessive for kwin_wayland
I meant my VRAM usage output (from nvidia-smi) and kwin support information. I have explicit sync turned on for nvidia/mesa/egl-wayland
Turning off auto-start, on a clean start of kwin_wayland, it only uses 116MB (with Plasma) As soon as I start something like Firefox and close it, it jumps to 2.4GB.
(In reply to Vlad Zahorodnii from comment #1) > Process ID : 6182 > Type : G > Name : /usr/bin/Xwayland > Used GPU Memory : 2478 MiB > > what's the VRAM usage of Xwayland without open windows? also please post > output of `qdbus org.kde.KWin /KWin supportInformation` I rebooted after package upgrades and these processes use under 200MB VRAM each after reboot. Few hours later VRAM usage crept up 1.5×. Will keep an eye on it.
It turns out in my case it was the 3rd party "force blur" plugin. I've also disabled "blur" to get more vram savings.
Created attachment 173999 [details] `qdbus org.kde.KWin /KWin supportInformation` output Output of `qdbus org.kde.KWin /KWin supportInformation`.
(In reply to Kelvie Wong from comment #6) > It turns out in my case it was the 3rd party "force blur" plugin. I've also disabled "blur" to get more vram savings. None of these is enabled on my system.
(In reply to Vlad Zahorodnii from comment #1) > Process ID : 6182 > Type : G > Name : /usr/bin/Xwayland > Used GPU Memory : 2478 MiB > > what's the VRAM usage of Xwayland without open windows? I'll report what happens when all X applications are closed later on. VRAM usage of kwin_wayland and Xwayland processes grows with time: Timestamp : Mon Sep 23 00:28:21 2024 Processes Process ID : 2248 Type : G Name : /usr/lib/xorg/Xorg Used GPU Memory : 30 MiB Process ID : 6080 Type : G Name : /usr/bin/kwin_wayland Used GPU Memory : 101 MiB Process ID : 6149 Type : G Name : /usr/bin/Xwayland Used GPU Memory : 22 MiB Timestamp : Mon Sep 23 23:22:21 2024 Processes Process ID : 2248 Type : G Name : /usr/lib/xorg/Xorg Used GPU Memory : 30 MiB Process ID : 6080 Type : G Name : /usr/bin/kwin_wayland Used GPU Memory : 522 MiB Process ID : 6149 Type : G Name : /usr/bin/Xwayland Used GPU Memory : 534 MiB The journal contains many messages like the following. Not sure if they are related to the issue: Sep 23 23:14:31 kwin_wayland_wrapper[886215]: warning: queue 0x5c08738700f0 destroyed while proxies still attached: Sep 23 23:14:31 kwin_wayland_wrapper[886215]: zwp_linux_dmabuf_v1@37 still attached Sep 23 23:17:27 kwin_wayland_wrapper[930799]: warning: queue 0x61f6821e2e00 destroyed while proxies still attached: Sep 23 23:17:27 kwin_wayland_wrapper[930799]: wl_registry@34 still attached
https://old.reddit.com/r/kde/comments/1ew4wcb/huge_vram_memory_leak_when_resizing_windows/ perhaps it is this problem, I think I narrowed it down to this. Seems to be an nvidia problem, it will use up to 10% of your VRAM due to some vram leak.
(In reply to Kelvie Wong from comment #10) > https://old.reddit.com/r/kde/comments/1ew4wcb/ > huge_vram_memory_leak_when_resizing_windows/ perhaps it is this problem, I > think I narrowed it down to this. Seems to be an nvidia problem, it will use > up to 10% of your VRAM due to some vram leak. I haven't been able to reproduce the issue by resizing Konsole or other windows.
>Sep 23 23:14:31 kwin_wayland_wrapper[886215]: warning: queue 0x5c08738700f0 destroyed while proxies still attached: Sep 23 23:14:31 kwin_wayland_wrapper[886215]: zwp_linux_dmabuf_v1@37 still attached These are probably from xwayland, as it mentions a client. Can you run 'killall Xwayland' and confirm that kwin's usage goes down? If so we need to file a bug report in XWayland.
(In reply to Maxim Egorushkin from comment #11) > (In reply to Kelvie Wong from comment #10) > > https://old.reddit.com/r/kde/comments/1ew4wcb/ > > huge_vram_memory_leak_when_resizing_windows/ perhaps it is this problem, I > > think I narrowed it down to this. Seems to be an nvidia problem, it will use > > up to 10% of your VRAM due to some vram leak. > > I haven't been able to reproduce the issue by resizing Konsole or other > windows. That statement of mine is incorrect. Resizing Konsole does increase kwin_wayland VRAM usage significantly. Resizing emacs (gtk3 X11) doesn't.
(In reply to David Edmundson from comment #12) > >Sep 23 23:14:31 kwin_wayland_wrapper[886215]: warning: queue 0x5c08738700f0 destroyed while proxies still attached: > Sep 23 23:14:31 kwin_wayland_wrapper[886215]: zwp_linux_dmabuf_v1@37 still > attached > > These are probably from xwayland, as it mentions a client. > > Can you run 'killall Xwayland' and confirm that kwin's usage goes down? If > so we need to file a bug report in XWayland. Killing Xwayland doesn't reduce kwin_wayland VRAM usage.
(In reply to Kelvie Wong from comment #10) > https://old.reddit.com/r/kde/comments/1ew4wcb/ > huge_vram_memory_leak_when_resizing_windows/ perhaps it is this problem, I > think I narrowed it down to this. Seems to be an nvidia problem, it will use > up to 10% of your VRAM due to some vram leak. Having rebooted into a fresh Plasma Wayland session, running nvtop in one Konsole window, I opened another Konsole window and tried moving and resizing it. The new Konsole window opened tiled to the right half of the screen (I rebooted from a Konsole tiled exactly there). Moving it around the screen didn't affect kwin_wayland VRAM usage. Resizing it, though, made kwin_wayland quickly reach 10% of VRAM usage (2.4GB on RTX 4090), and stay pegged at that level regardless of any further window shape or position changes. I thought, oh well, resizing Konsole does make kwin_wayland hog VRAM, as reported by Kelvie Wong above, and was about to reboot. I invoked the keyboard shortcut to tile that Konsole window back to the right half of the screen where it opened, and that made kwin_wayland release all that VRAM back to under 1% level, to my great surprise. It appears, that restoring Konsole window size and position back to their initial states makes kwin_wayland release that 10% VRAM it allocated during moving around and resizing that window. Let me know what other information I could collect to narrow down the root cause of the issue.
There is a workaround that fixes the issue for me https://github.com/NVIDIA/egl-wayland/issues/126#issuecomment-2379945259
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone!
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.