The NVIDIA Linux driver doesn’t handle the VRAM sharing with the system RAM.
What I’m exactly referring to is this: Windows 10 Task Manager in GPU section
As can be seen, there is the “Dedicated GPU memory” and the “Shared GPU memory” that is actual system RAM but shared with the GPU, so in case the GPU runs out of VRAM, the system or game doesn’t simply crash or have a drop in FPS.
So what is the problem then?
The problem is that the “Shared GPU memory” doesn’t exist on the NVIDIA Linux driver, leading big issues when the GPU VRAM fills out.
Issues like (If the VRAM is full):
- The browser (Chromium based and Firefox) cannot be opened
- Low FPS in games and the GPU at 100% utilization
- The desktop environment that the user uses could crash (Like in my case, when the VRAM fills out, my whole KDE Plasma desktop just crashes and restarts itself)
- Cannot use OBS, complaining with an error like this: Failed to open NVENC: Out of memory
- Can’t open even light programs like Cantata (Music Player) and GPU accelerated terminals like Kitty
- Other issues that i don’t remember
So, in my case (and probably everyone that uses an NVIDIA card under Linux) the available VRAM is just the Dedicated video memory and nothing else, there is no backup.
For checking the “Total available memory” it is necessary to use
glxinfo -B, in my case is:
... Memory info (GL_NVX_gpu_memory_info): Dedicated video memory: 3072 MB Total available memory: 3072 MB Currently available dedicated video memory: 1855 MB OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2 OpenGL core profile version string: 4.6.0 NVIDIA 535.86.05 OpenGL core profile shading language version string: 4.60 NVIDIA ...
And to make the difference, this is the output of an AMD card:
... Memory info (GL_NVX_gpu_memory_info): Dedicated video memory: 16384 MB Total available memory: 32000 MB Currently available dedicated video memory: 15268 MB ...
The AMD drivers can successfully use a portion of the system RAM to prevent the issues that i mentioned before (Total available memory: 32000 MB).
And also, to provide more information about this issue.
vulkaninfo can be used to see the
memoryHeaps which provides information about the system RAM that could be shared with the GPU and the dedicated RAM of the GPU:
memoryHeaps: count = 3 memoryHeaps: size = 3221225472 (0xc0000000) (3.00 GiB) budget = 1912930304 (0x72050000) (1.78 GiB) usage = 0 (0x00000000) (0.00 B) flags: count = 1 MEMORY_HEAP_DEVICE_LOCAL_BIT memoryHeaps: size = 12521017344 (0x2ea4f9000) (11.66 GiB) budget = 12521017344 (0x2ea4f9000) (11.66 GiB) usage = 0 (0x00000000) (0.00 B) flags: None memoryHeaps: size = 257949696 (0x0f600000) (246.00 MiB) budget = 236322816 (0x0e160000) (225.38 MiB) usage = 21626880 (0x014a0000) (20.62 MiB) flags: count = 1 MEMORY_HEAP_DEVICE_LOCAL_BIT
memoryHeaps: GPU VRAM
memoryHeaps: System RAM that could be used as shared RAM but the current NVIDIA Linux driver doesn’t use.
Is there any plans on fixing this? This should be on every driver of every operating system, is not an optional feature. If i need to provide a nvidia-bug-report file, just ask for it. I have an 1060 3GB and a 3070 Max-Q 8GB.
This thread is a highly related with this one: VRAM Allocation Issues