Summary: | NVIDIA GPU memory leak | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | forestofrain |
Component: | generic-performance | Assignee: | Plasma Bugs List <plasma-bugs-null> |
Status: | RESOLVED UPSTREAM | ||
Severity: | major | CC: | aleixpol, arisu+kdebugs, nate, niccolo.venerandi, notmart, rickard, traceydick, voidpointertonull+bugskdeorg |
Priority: | NOR | ||
Version First Reported In: | 5.27.4 | ||
Target Milestone: | 1.0 | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
forestofrain
2023-04-28 09:41:13 UTC
Here is a case showing the difference with the default wallpaper image and plain color applying the same change the scale and revert quick test. I removed all the small 3Mib processes and only left the relevant ones below. Hope that helps to narrow the issue. Feels like the wallpaper image or plain color gpu memory is not released. Default wallpaper image nvidia-smi 13:12:24 Sat Apr 29 13:12:35 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 530.41.03 Driver Version: 530.41.03 CUDA Version: 12.1 | |-----------------------------------------+----------------------+----------------------+ | 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 3080 Off| 00000000:01:00.0 On | N/A | | 30% 41C P0 83W / 320W| 3071MiB / 10240MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 1244 G /usr/bin/kwin_wayland 1130MiB | | 0 N/A N/A 1630 G /usr/bin/Xwayland 20MiB | | 0 N/A N/A 1721 G /usr/bin/plasmashell 878MiB | +---------------------------------------------------------------------------------------+ ❯ nvidia-smi 13:13:07 Sat Apr 29 13:13:33 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 530.41.03 Driver Version: 530.41.03 CUDA Version: 12.1 | |-----------------------------------------+----------------------+----------------------+ | 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 3080 Off| 00000000:01:00.0 On | N/A | | 30% 41C P0 84W / 320W| 7924MiB / 10240MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 1244 G /usr/bin/kwin_wayland 1126MiB | | 0 N/A N/A 1630 G /usr/bin/Xwayland 20MiB | | 0 N/A N/A 1721 G /usr/bin/plasmashell 5378MiB | +---------------------------------------------------------------------------------------+ Plain color wallpaper The plain color shifts after revert leaving black screen instead of the selected color. ❯ nvidia-smi 13:16:21 Sat Apr 29 13:16:23 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 530.41.03 Driver Version: 530.41.03 CUDA Version: 12.1 | |-----------------------------------------+----------------------+----------------------+ | 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 3080 Off| 00000000:01:00.0 On | N/A | | 30% 41C P0 114W / 320W| 1365MiB / 10240MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 1208 G /usr/bin/kwin_wayland 577MiB | | 0 N/A N/A 1246 G /usr/bin/Xwayland 4MiB | | 0 N/A N/A 1662 G /usr/bin/plasmashell 749MiB | +---------------------------------------------------------------------------------------+ ❯ nvidia-smi 13:17:15 Sat Apr 29 13:17:24 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 530.41.03 Driver Version: 530.41.03 CUDA Version: 12.1 | |-----------------------------------------+----------------------+----------------------+ | 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 3080 Off| 00000000:01:00.0 On | N/A | | 30% 41C P0 83W / 320W| 1826MiB / 10240MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 1208 G /usr/bin/kwin_wayland 607MiB | | 0 N/A N/A 1246 G /usr/bin/Xwayland 4MiB | | 0 N/A N/A 1662 G /usr/bin/plasmashell 749MiB | +---------------------------------------------------------------------------------------+ Enabling the default wallpaper image ❯ nvidia-smi 13:17:24 Sat Apr 29 13:19:39 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 530.41.03 Driver Version: 530.41.03 CUDA Version: 12.1 | |-----------------------------------------+----------------------+----------------------+ | 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 3080 Off| 00000000:01:00.0 On | N/A | | 30% 41C P0 83W / 320W| 2358MiB / 10240MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 1208 G /usr/bin/kwin_wayland 628MiB | | 0 N/A N/A 1246 G /usr/bin/Xwayland 4MiB | | 0 N/A N/A 1662 G /usr/bin/plasmashell 1339MiB | +---------------------------------------------------------------------------------------+ ❯ nvidia-smi 13:19:39 Sat Apr 29 13:20:25 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 530.41.03 Driver Version: 530.41.03 CUDA Version: 12.1 | |-----------------------------------------+----------------------+----------------------+ | 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 3080 Off| 00000000:01:00.0 On | N/A | | 30% 41C P0 84W / 320W| 7790MiB / 10240MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 1208 G /usr/bin/kwin_wayland 628MiB | | 0 N/A N/A 1246 G /usr/bin/Xwayland 4MiB | | 0 N/A N/A 1662 G /usr/bin/plasmashell 6771MiB | +---------------------------------------------------------------------------------------+ Wondering if this issue is Nvidia related. There are still good reasons why they are being mocked as Novideo, and it generally doesn't seem like they care too much about Linux desktop. That's exactly why I went with an AMD GPU this time, leaving Nvidia struggles behind, improving my experience significantly. Currently I'm at 16 days uptime with plasmashell GPU memory usage being less than 1 GiB with what looks like a wasteland of abandoned windows I really need to reap and/or catch up with. Not seeing kwin in nvtop, but with most memory usage being associated with Firefox, Thunderbird, and other known GPU hogs, I don't feel like KDE is bloated for me. Did the monitor scale dance, total GPU memory consumption was almost 5.4 GiB, 100%->125%->100% dropped it down to almost 5.1 GiB, and then closing the settings window got it below 5 GiB. So quite amusingly your memory leak reproducer actually freed up memory for me. I'm not sure if I ever ran out of GPU memory, but I definitely don't measure the frequency of my issues on the scale of hours, instead when I get too abusive with littering windows, plasmashell crashes maybe roughly weekly, but with a light load it's way less common, so I'm quite happy with KDE lately. Operating System: Kubuntu 23.10 KDE Plasma Version: 5.27.8 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.10 Kernel Version: 6.5.0-14-generic (64-bit) Graphics Platform: Wayland Graphics Processor: AMD Radeon RX 6800 XT I've seen this too, seems like plasmashell leaks GPU memory, at least under wayland. Operating System: CachyOS Linux KDE Plasma Version: 6.0.5 KDE Frameworks Version: 6.2.0 Qt Version: 6.7.1 Kernel Version: 6.9.2-1-cachyos-lto (64-bit) Graphics Platform: Wayland Graphics Processor: NVIDIA GeForce RTX 4070/PCIe/SSE2 Driver: Nvidia 555.42.02 GPU memory usage: /usr/bin/plasmashell 356MiB It was roughly 260MiB 30 minutes ago, then it suddenly went up +100MB. Thank you for the bug report! I'm sorry we weren't able to get to it yet. If this is still happening for you with a more recent Plasma version, like 6.3.5 or later, can you tell me whether you have any GIF or other kind of animated wallpapers? It would also be good to know if it goes away if you use a boring plain color wallpaper on all of your screens. Hi Nate! TLDR; It's an Nvidia driver issue. This was partly fixed by Nvidia in their driver, it's not as severe as it used. For reference, here's the (very long) issue thread. And to summarize, it basically affects all apps running on wayland (and Xwayland). https://github.com/NVIDIA/egl-wayland/issues/126 I have an AMD GPU now and I don't really see it go up the same way it did with the Nvidia GPU, even if I try to "force it". It often is. Thanks for reporting back about it! |