-
|
Edit: This affects AMD GPUs too, not just NVIDIA, see #3146 (comment). I have a GeForce 750 Ti which only has 2 GB of memory and I noticed a lot of instability opening Firefox and Ghostty, especially when recording videos with OBS. Windows would lock up and become unresponsive in semi-random ways. All of those things use the GPU.
But now after opening and closing a few windows, recording a few videos with OBS, etc.. the GPU usage of niri is at 310 MB and it seems to be climbing even if nothing is open except 1 Firefox window (which uses its own GPU memory). I'm basically in a fresh boot scenario except I have opened and closed stuff during this session so it feels like something isn't getting cleared at the niri level. The wiki mentions niri shouldn't use much more than 100 MB. If I spam open a few windows that don't use the GPU like Thunar, niri's GPU allocation goes up. This makes sense since they are occupying resources. Opening 8 or so Thunar windows raises the memory by about 100 MB total. However after I close them, this memory goes back down, however it won't drop below about ~300 MB since "something" raised the baseline. For reference I have 2 displays both at scale 1.0 but when recording videos I do change the scale to 2.0 for only the display being recorded. Edit: I don't have hard evidence but I just rebooted and if I resize windows (height and / or width) then niri will continue to use more and more GPU memory. Even if you close the window / process that was resized, the memory does not get reclaimed. Is there a leak somewhere? Is there anything that I can do to clear this memory in a safe way without disrupting niri / open applications without logging out or rebooting? I launch niri through uwsm in my zprofile like this Before I understood what the problem was, I defined these 3 env vars in uwsm's env file. Figured I'd include this in any case they have an impact: # Attempt to stabilize NVIDIA drivers on Wayland.
export GBM_BACKEND=nvidia-drm # Force GBM to use NVIDIA DRM for buffer allocations
export __GLX_VENDOR_LIBRARY_NAME=nvidia # Ensures OpenGL / EGL apps use NVIDIA driver
export WLR_NO_HARDWARE_CURSORS=1 # Disables wlroots hardware cursor (compositor only)I really don't know what they are doing or if they have a positive or negative outcome. It was just rummaging through many pages of Google results and Chat GPT to identify why my system was not stable. Should I even be setting these? Edit: Here's the $ nvidia-smi
Tue Dec 30 09:36:58 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.119.02 Driver Version: 580.119.02 CUDA Version: 13.0 |
+-----------------------------------------+------------------------+----------------------+
| 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 GTX 750 Ti Off | 00000000:01:00.0 On | N/A |
| 42% 48C P0 2W / 38W | 1139MiB / 2048MiB | 3% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 869 G niri 294MiB |
| 0 N/A N/A 941 C+G walker 129MiB |
| 0 N/A N/A 1043 C+G .../lib/xdg-desktop-portal-gnome 2MiB |
| 0 N/A N/A 3791 G Xwayland 2MiB |
| 0 N/A N/A 36422 G /usr/lib/firefox/firefox 414MiB |
| 0 N/A N/A 52853 G ghostty 154MiB |
+-----------------------------------------------------------------------------------------+What's interesting is only xdg portal and Xwayland popped up after I used OBS. OBS is not included here because I closed it. Is it normal for them to continue running in the background? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
|
I managed to not crash for a little over 1 day and niri is using almost 600 MB of memory just using my computer normally. niri is climbing with no limit, something is leaking somewhere but I don't know where or what is causing it. |
Beta Was this translation helpful? Give feedback.
-
|
@YaLTeR I am able to reproduce this leak using a brand new system with an AMD GPU. I reported it on Smithay in the same thread that has been open for over a year. The same exact reproducible steps causing the leak on my desktop with NVIDIA happen with AMD too. I am using the same distro and all of the same system / user configs (minus hardware differences). I am quite confident you'll be able to reproduce this too. You just need to boot up, look at your GPU memory usage for niri, use your system normally for a few days, close everything and look at your GPU memory for niri. It will be quite a lot higher. You can always open and close mpv images or videos to fast track this leak which also aligns perfectly with Smithay/smithay#1562 which mentions memory doesn't get released when closing windows. |
Beta Was this translation helpful? Give feedback.
-
|
The same issue, and I did as the niri wiki said, add |
Beta Was this translation helpful? Give feedback.
-
|
This PR #3404 appears to have resolved this, there was a leak. At the time of this comment, it's not in the latest stable release (v25.11) but you can get it from the AUR with the |
Beta Was this translation helpful? Give feedback.

This PR #3404 appears to have resolved this, there was a leak. At the time of this comment, it's not in the latest stable release (v25.11) but you can get it from the AUR with the
niri-gitpackage until the next release is available.