How to diagnose a vRAM leak in plasmashell?

Hi everyone, I’m currently using KDE Plasma 6.5.4 on Archlinux, using the AMDGPU open-source driver (graphics card is Radeon 680M).

I’m almost certain I’m experiencing a video memory leak. Today is the fifth day since my OS booted, and nvtop shows plasmashell’s video memory usage is 2119MB, which doesn’t seem normal. Since I’m using shared memory (4GB total), if plasmashell’s memory usage continues to increase, based on my experience, I’ll encounter frame drops or even crashes in 3D games within two days.

Because this isn’t the first time I’ve encountered this problem, I started recording plasmashell’s daily memory usage five days ago: 290MB on the first day, followed by 519MB, 1684MB, 2021MB, and currently at 2119MB.

I’ve tried to diagnose the problem myself, but unfortunately, there seems to be a lack of diagnostic tools for video memory leaks (or perhaps I missed something). Therefore, I’m seeking help here. If you have any insights, please let me know. Thank you!

2 Likes

I’m sorry I don’t have a solution, but I wanted to comment that I experience the same. Every day seems to increase the VRAM use (and RAM use) until by around day 4 or 5, things are noticeably slower, until I do a reboot. Can’t figure out why, and I also don’t know how to debug this. It’s specifically plasmashell that’s getting higher.

Same issue here with 6.5.4 on Fedora 43.
Workaround is to restart plasmashell:
systemctl --user daemon-reload && systemctl restart --user plasma-plasmashell.service

I’m having the same problem with a Radeon RX 7600.

For diagnosis,
AMD Radeon™ GPU Profiler - AMD GPUOpen might be the best option for AMD gpu.

There is Nsight for nvidia.

Not sure it would be simple to diagnose this using those.

I am not sure if VRAM is used as regular RAM: in Linux system memory is used as much as possible at any time, but a large part of it is available, only used temporarily opportunistically, so that any application can reuse that memory part as soon as it needs it, but if the data in available memory is accessed again this is instantaneous instead of accessing the disk, improving performance. (https://www.linuxatemyram.com/)

I just moved to 6.5.4 last few weeks from 6.4.5, and I’ve had a lot of weirdness, including this creeping vram issue. It usually starts at a couple hundred meg for both, but quickly grow to linger around this after a few weeks.

This laptop has a 3080rtx with 16gb vram so it’s not killing me, but kwin_wayland and plasmashell both have been using significantly more ram/vram lately in 6.5.

What is this TUI you use to make measurements ?

It is important to specify this kind of details.

It looks like nvtop.

1 Like

Well one thing I can say for certain: not all hardware are concerned.

I don’t observe this on my intel laptop with itengrated graphics:

$ kinfo
Operating System: Arch Linux 
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.18.2-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × 13th Gen Intel® Core™ i7-1365U

So far the issue has been raised for an Nvidia 3080 Ti and a Radeon 680M, with slightly different symptoms.
Both of those don’t have the best drivers unfortunately, one is proprietary, the other one hasn’t the best stability track record.
This could be driver bugs or some incompatibility with KWin.

It would be interesting to know if there are only those or other GPU/API concerned.

And if this affects other DE that would at least partly tell us whether the issue is in Plasma or in the driver.

Yes, just nvtop here. I usually keep htop/nvtop/btop going to watch my system.

Operating System: Arch Linux
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.18.2-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × 11th Gen Intel® Core™ i7-11800H @ 2.30GHz
Memory: 128 GiB of RAM (125.6 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 3080 Laptop GPU
Manufacturer: LENOVO
Product Name: 20YS001SUS
System Version: ThinkPad T15g Gen 2i

My desktop is usually 3x 4k, so 11520x2160 framebuffer, so I expect mine is probably heavier than most others, and has always managed to be a bit wonky around ram/vram use, but it’s definitely higher than I’ve seen it when on 6.4 prior and each 6.x before that. I’ve been watching mine since a last restart a few weeks ago, and it’ll start usually ~500mb, usually hang out around 1.5-2g ram (vram is usually much lower), but this has been steadily climbing.

Of course this could always be nvidia, their driver quality differs greatly and usually playing russian roulette with driver upgrades already with them.

Here’s just a few days after the original, hitting over 5gb of ram and 2.7gb vram. This is about the highest I’ve seen it since upgrading arch last.