Comment by nickjj

1 day ago

This post focuses on performance, but what about crashing due to apps seeing no RAM available to allocate once VRAM is filled up?

I remember having this problem when I used an NVIDIA 750 Ti with 2 GB of memory. Just opening a few Firefox or Ghostty terminals (both are GPU accelerated) would result in those apps crashing or not being able to render their contents. Sometimes the compositor would crash or become unstable too (kwin, niri, etc.). I had to reboot every few hours. Complete system instability.

This problem only happened with Wayland, when I switched to X windows these problems went away.

Since then I switched to an AMD RX 480 (8 GB) GPU and never had an issue here with Wayland, if GPU memory gets full, system memory gets seamlessly used instead. It felt like with the NVIDIA card, it never allocated back to system memory if no VRAM was available. This was only a problem on Linux since that same NVIDIA card was fine in Windows for 10+ years with zero issues related to instability around VRAM allocation.

Tons of people reported the same issue on Linux on NVIDIA's forums for years.

I wrote a lot more details and recorded demo videos around 9 months ago here https://nickjanetakis.com/blog/gpu-memory-allocation-bugs-wi..., but since then a lot of these things have been resolved from switching over to AMD.

Your last sentence sums it all: AMD is the only serious option on Linux. Not perfect, but far better than Nvidia, thanks to their open drivers that anyone (and especially Valve) can improve.

  • This seems like a big problem for AI as long as Nvidia is so deeply financially involved the way they are.

It's got to be an edge case for Wayland to be used with a 2GB VRAM card? Targeting recent cards and letting people using older hardware install x-windows, or whatever, seems sensible.

You say (in your blog post) "Linux" didn't work well so you reverted to "Windows", but as is so often the case you buried the distro/version info. You don't seem to have been using Win11 (later you mention Win7 & Win10Pro) ... So it's cutting edge software didn't work on my 2014 system, but older software did. The Linux/Windows aspects aren't particularly relevant AFAICT.

Nvidia refused for many years to properly support Linux, whilst AMD have supported it. So no surprise if a Nvidia card didn't work well/stably but an AMD one did.

  • > You say (in your blog post) "Linux" didn't work well so you reverted to "Windows", but as is so often the case you buried the distro/version info.

    Not sure what you mean. The post directly mentions I'm using Arch and was using the official drivers from NVIDIA (the latest at the time). I also didn't switch back to Windows. Although now the experience is much better with an AMD card. Totally worth the switch.

    As for 2 GB on Wayland, I think it affects other cards too, but a low GB card feels it more. If you have 8-16 GB of VRAM you might not ever notice it's a problem since you have enough of a buffer to open up many more things.

  • > It's got to be an edge case for Wayland to be used with a 2GB VRAM card?

    I had thought that one of the biggest "selling" points of Linux is the ability to extend the useful lifetime of older hardware. And if the distros are going to turn away from X11, well.

    • Yes, it has been a selling point that Linux can revive old hardware. It still is. But when a whole new desktop rendering system is implemented, just hitting the mainstream in the last year or so (for me on [K]Ubuntu) then I think you should expect backwards support of a 12 year old system to be limited. That's kinda my bugbear, they say (paraphrasing) 'linux didn't work' but they're comparing older Windows systems with newer Linux systems. Yes, ultimately the story was positive for Linux, but there's an inherent bias IMO where Linux is put down if it doesn't do everything better than every version of Windows for every piece of hardware. If you're using the very latest hardware, or older hardware, you're going to have to get your hand dirty choosing a distro or configuring an install (or possibly compiling drivers).

      Win11 wouldn't work on 2 year old hardware (no compatible TPM was the complaint, but I worked around it with hacks that MS didn't publicise). I should probably have used that as a chance to move that family member to a friendly Linux distro ...

I have this problem with an 8gib 2080. Nvidia drivers have bugs with Wayland or Vulkan which is at least partially a memory leak.

Here’s one for example: https://forums.developer.nvidia.com/t/kwin-6-7-x-causes-mass...

Just search KWin Nvidia memory leak or Wayland Nvidia memory leak or kwin wayland Nvidia memory leak. It’s constantly issues and I remain convinced some intermixing of the two + monitors is at fault.

I gave myself 32GB of swap since SSDs are quite fast and the pages sent to disk seem to intelligently be rarely referenced ones. Feels amazing to run 4 VMs and 12 Claude Code instances on my mid tier hardware

  • Swap doesn't help in this case.

    It's GPU drivers freaking out when they run out of VRAM, but it might only be specific to NVIDIA cards since AMD seems to handle this better.

    But, if it's driver specific that means it could be fixed at the kernel level I suppose, especially since Windows handles it seamlessly?

    • Can you explain a little more please. I thought that graphics processing would revert to CPU if the GPU is maxed out and so swap might ultimately help? Is there no general GPU-swap mechanism? If CPU threads are competing for GPU resource does the GPU getting paged-out?

      I suppose this could be an historic thing, GPUs can have a type of DMA now, and disk access is much faster too, so paging perhaps makes sense when it didn't before?

      3 replies →