aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhecate cantus <cass@fox.mom>2025-07-15 23:06:07 -0700
committerGitHub <noreply@github.com>2025-07-16 06:06:07 +0000
commit60fbcd23299364667865856155978c8c6b888667 (patch)
treea819350cc8d94c50d8279647ae9257d5d9203160
parent5ac440a7604ce6765ce802cb1fd53c906d8d18ec (diff)
downloadniri-60fbcd23299364667865856155978c8c6b888667.tar.gz
niri-60fbcd23299364667865856155978c8c6b888667.tar.bz2
niri-60fbcd23299364667865856155978c8c6b888667.zip
Add Nvidia.md leaf file, add links in sidebar & getting started (#2029)
* Add Nvidia.md leaf file, add links in sidebar & getting started * squash review-commits from gh to one commit * heap reuse ratio from 1 => 0 to match currently shipped solution * Update wiki/Nvidia.md --------- Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
-rw-r--r--wiki/Getting-Started.md3
-rw-r--r--wiki/Nvidia.md41
-rw-r--r--wiki/_Sidebar.md1
3 files changed, 45 insertions, 0 deletions
diff --git a/wiki/Getting-Started.md b/wiki/Getting-Started.md
index 072a14ba..6a20969d 100644
--- a/wiki/Getting-Started.md
+++ b/wiki/Getting-Started.md
@@ -23,6 +23,9 @@ Finally, the [Xwayland](./Xwayland.md) page explains how to run X11 applications
### NVIDIA
+The NVIDIA drivers currently have an issue with high VRAM usage due to a heap reuse quirk.
+You're recommended to apply a manual fix documented [here](./Nvidia.md) if you run niri on an NVIDIA GPU.
+
NVIDIA GPUs can have problems running niri (for example, the screen remains black upon starting from a TTY).
Sometimes, the problems can be fixed.
You can try the following:
diff --git a/wiki/Nvidia.md b/wiki/Nvidia.md
new file mode 100644
index 00000000..86c16319
--- /dev/null
+++ b/wiki/Nvidia.md
@@ -0,0 +1,41 @@
+### High VRAM usage fix
+
+Presently, there is a quirk in the NVIDIA drivers that affects niri's VRAM usage (the driver does not properly release VRAM back into the pool). Niri *should* use on the order of 100 MiB of VRAM (as checked in [nvtop](https://github.com/Syllo/nvtop)); if you see anywhere close to 1 GiB of VRAM in use, you are likely hitting this issue (heap not returning freed buffers to the driver).
+
+Luckily, you can mitigate this by configuring the NVIDIA drivers with a per-process application profile as follows:
+
+* `sudo mkdir -p /etc/nvidia/nvidia-application-profiles-rc.d` to make the config dir if it does not exist (it most likely does not if you are reading this)
+* write the following JSON blob to set the `GLVidHeapReuseRatio` config value for the `niri` process into the file `/etc/nvidia/nvidia-application-profiles-rc.d/50-limit-free-buffer-pool-in-wayland-compositors.json`:
+
+ ```json
+ {
+ "rules": [
+ {
+ "pattern": {
+ "feature": "procname",
+ "matches": "niri"
+ },
+ "profile": "Limit Free Buffer Pool On Wayland Compositors"
+ }
+ ],
+ "profiles": [
+ {
+ "name": "Limit Free Buffer Pool On Wayland Compositors",
+ "settings": [
+ {
+ "key": "GLVidHeapReuseRatio",
+ "value": 0
+ }
+ ]
+ }
+ ]
+ }
+ ```
+
+ (The file in `/etc/nvidia/nvidia-application-profiles-rc.d/` can be named anything, and does not actually need an extension).
+
+Restart niri after writing the config file to apply the change.
+
+The upstream issue that this solution was pulled from is [here](https://github.com/NVIDIA/egl-wayland/issues/126#issuecomment-2379945259). There is a (slim) chance that NVIDIA updates their built-in application profiles to apply this to niri automatically; it is unlikely that the underlying heuristic will see a proper fix.
+
+The fix shipped in the driver at the time of writing uses a value of 0, while the initial config posted by an Nvidia engineer approximately a year prior used a value of 1.
diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md
index 2a35714f..89302764 100644
--- a/wiki/_Sidebar.md
+++ b/wiki/_Sidebar.md
@@ -10,6 +10,7 @@
* [Layer‐Shell Components](./Layer%E2%80%90Shell-Components.md)
* [IPC, `niri msg`](./IPC.md)
* [Application-Specific Issues](./Application-Issues.md)
+* [Nvidia](./Nvidia.md)
* [Xwayland](./Xwayland.md)
* [Gestures](./Gestures.md)
* [Packaging niri](./Packaging-niri.md)