news.volyx.in

Use your Nvidia GPU's VRAM as swap space on Linux (github.com)

472 points by tanelpoder · 40 days ago · 126 comments on HN

Article summary

The article discusses a Linux project called nbd-vram, which allows users to utilize their NVIDIA GPU's VRAM as swap space. This can be beneficial for laptops with soldered memory and no upgrade path, as it provides a fast and zero-wear tier of swap. The project uses a daemon to allocate VRAM and serve it as a block device, which can be used as a swap device. The author claims that this can improve system performance and reduce SSD wear.

Main themes

  • GPU VRAM as swap space
  • Linux kernel and driver interactions
  • Memory management and optimization
  • Laptop hardware limitations
  • Swap space and performance

What commenters say

  • Using VRAM as swap space can be beneficial for systems with limited RAM and idle GPU resources.
  • The project is not necessary for everyone, and some users may not see a need for it.
  • The use of VRAM as swap space can prevent the NVIDIA GPU from being power gated, potentially affecting battery life.
  • Some users see potential benefits in using VRAM as swap space, especially when the GPU is not being heavily utilized.
  • There are limitations to using VRAM as RAM due to hardware constraints, such as cache coherency and latency issues.
  • The project's usefulness depends on specific use cases, such as gaming or AI workloads, and may not be universally applicable.
  • Disabling the VRAM swap on battery power could be a viable solution to mitigate potential battery life impacts.
  • The concept of using VRAM as swap space is not new, but the implementation and benefits may vary depending on the specific hardware and use case.