{"id":181858,"date":"2026-06-02T14:48:21","date_gmt":"2026-06-02T12:48:22","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/opublikovan-nbd-vram"},"modified":"2026-06-02T14:48:21","modified_gmt":"2026-06-02T12:48:22","slug":"opublikovan-nbd-vram","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/opublikovan-nbd-vram","title":{"rendered":"NBD-VRAM Released","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Published open project <strong>NBD-VRAM<\/strong>, allowing a portion of the NVIDIA GPU video memory to be used as swap space in Linux. The project is primarily aimed at laptops with soldered RAM, where the RAM cannot be expanded, but there is a discrete NVIDIA RTX\/GTX graphics card with unused VRAM in the system. The code is written in C and shell and is distributed under the license <strong>MIT<\/strong>.<\/p>\n<p>The idea of NBD-VRAM is simple: if the system is already beginning to use swap on SSD, an intermediate layer can be placed before SSD\u2014video memory. The author cites an example with a laptop on <strong>RTX 3070 Laptop<\/strong>: of 8 GB VRAM, 7 GB was allocated for swap, and together with RAM, zram, and SSD swap, the system received about 46 GB of addressable memory. The assumed overflow order is as follows: first RAM is used, then VRAM as fast swap, then zram, and only after that SSD.<\/p>\n<p>Technically, NBD-VRAM does not add a new kernel driver. A small daemon allocates graphics card memory via <strong>CUDA Driver API<\/strong>, and then provides it to the Linux kernel as a block device through <strong>NBD<\/strong> \u2014 Network Block Device \u2014 over a Unix socket. After connecting with the standard nbd-client, a \/dev\/nbdX appears in the system, which can be formatted as regular swap using mkswap and enabled with swapon.<\/p>\n<p>The author particularly emphasizes that this approach was chosen due to the limitations of consumer NVIDIA graphics cards. A more direct path through the NVIDIA P2P API on GeForce, according to him, runs into EINVAL, since the corresponding capabilities are essentially available only for professional and server models. The option of directly accessing BAR1 also didn't work: only a small mapped area is accessible, and reading from the rest returns zeros. The NBD approach circumvents this limitation as it utilizes regular CUDA copying cuMemcpyHtoD and cuMemcpyDtoH.<\/p>\n<h2>Capabilities<\/h2>\n<ul>\n<li>\n<p><strong>Using VRAM as regular Linux swap.<\/strong> After launch, the daemon provides the video memory as \/dev\/nbd0 or another NBD device, which appears to the kernel as a standard block device.<\/p>\n<\/li>\n<li>\n<p><strong>Operation without its own kernel module.<\/strong> The project does not require writing, compiling, and maintaining a separate kernel module, does not use internal symbols of the NVIDIA driver, and should survive kernel and driver updates without recompilation.<\/p>\n<\/li>\n<li>\n<p><strong>Focus on consumer NVIDIA GPUs.<\/strong> The requirements specify NVIDIA GPUs with CUDA support, including consumer RTX\/GTX cards, the official NVIDIA driver with libcuda.so.1, the nbd module in the Linux kernel, nbd-client, gcc, and make. The CUDA Toolkit is not needed.<\/p>\n<\/li>\n<li>\n<p><strong>systemd integration.<\/strong> Installation via install.sh adds the vram-swap-nbd service, which can be started via systemctl; after installation, the service is enabled for automatic startup on boot.<\/p>\n<\/li>\n<li>\n<p><strong>Configuration of swap size and priority.<\/strong> In the systemd unit, VRAM_SETUP_SIZE_MB can be set, which is the upper limit of allocated VRAM, and VRAM_SWAP_PRIORITY, which is the priority of the swap device. The higher the priority, the sooner Linux will use this swap layer.<\/p>\n<\/li>\n<li>\n<p><strong>Automatic reduction of the requested size.<\/strong> If the required amount of VRAM is unavailable, the daemon attempts to reduce the size in blocks of 512 MiB to still allocate available space, for instance, if part of the memory is already occupied by the compositor or graphics session.<\/p>\n<\/li>\n<li>\n<p><strong>Test scripts.<\/strong> The repository contains test-nbd.sh for a smoke test with 1 MiB write\/read and test-fill.sh for stress-testing the entire VRAM partition.<\/p>\n<\/li>\n<li>\n<p><strong>The claimed performance is about 1.3 GB\/s.<\/strong> On the RTX 3070 Laptop, the author measured sequential writes of 7 GB in 4 MB blocks at approximately 1.3 GB\/s.<\/p>\n<\/li>\n<\/ul>\n<h2>Use cases<\/h2>\n<p><strong>Laptops with soldered RAM.<\/strong> The main scenario is modern laptops where 16 or 32 GB of RAM is no longer sufficient, but upgrading is not possible. If such a machine has a discrete RTX card, some VRAM can be used as an additional swap layer. This does not convert VRAM into full RAM, but can save the system from abruptly switching to a slow SSD swap or from OOM-killer under peak loads.<\/p>\n<p><strong>Heavy developer working environments.<\/strong> IDEs, browsers with dozens of tabs, Docker containers, local databases, large project builds, and test environments easily create temporary spikes in memory consumption. In such a scenario, NBD-VRAM can act as a buffer: it does not accelerate normal operations but softens the moment when RAM runs out.<\/p>\n<p><strong>Reducing the load on SSD swap.<\/strong> If swap on SSD is used frequently, it not only slows down the system, but also creates unnecessary writes to the storage. VRAM swap can be set with a higher priority so that when RAM is full, the system first evicts pages to video memory before accessing the SSD. This is particularly relevant for laptops, where SSDs are often non-removable or expensive to replace.<\/p>\n<p><strong>Combination with zram.<\/strong> The author explicitly describes a scheme where VRAM swap receives a higher priority and takes the first 'spill' of memory, zram is used as the next layer, and SSD remains the last line of defense. This scheme can be useful for workstations and laptops, where maintaining system responsiveness during low memory conditions is more important than achieving maximum predictability of latency.<\/p>\n<p><strong>Local AI\/LLM tasks around GPU, but not instead of VRAM for the model.<\/strong> NBD-VRAM does not increase the video memory available to CUDA applications as VRAM for the model. It is the reverse scenario: VRAM is used as swap for standard Linux memory, rather than RAM being used as VRAM. Therefore, the project will not allow uploading a larger model to the GPU directly. However, it can be beneficial on machines where a browser, IDE, indexers, Python environments, and containers are running alongside LLM inference, and system RAM begins to run out.<\/p>\n<p><strong>Home and experimental workstations.<\/strong> The project is intriguing for users whose graphics card often remains idle outside of gaming, rendering, or ML tasks. For example, 8\u201312 GB of VRAM on a desktop GeForce can be temporarily converted into an additional layer of swap for heavy tasks like compilation, data processing, or execution. <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/en\/vps\/\" title=\"of virtual machines\" data-wpil-keyword-link=\"linked\">of virtual machines<\/a>.<\/p>\n<h2>Restrictions<\/h2>\n<p>NBD-VRAM is not a replacement for RAM. Access to such swap follows the chain kernel swap \u2192 \/dev\/nbdX \u2192 nbd driver \u2192 Unix socket \u2192 daemon \u2192 CUDA copy \u2192 VRAM, so the latencies and behavior will differ from actual RAM. It is more of an emergency or intermediate layer between RAM and SSD than a way to 'add memory' without consequences.<\/p>\n<p>The project is also tied to the official NVIDIA stack with CUDA. Nouveau\/Nova are unsuitable for this as libcuda.so.1 is required. Phoronix <a rel=\"nofollow\" href=\"https:\/\/www.phoronix.com\/news\/NVIDIA-NBD-VRAM\">also notes<\/a>, that NBD-VRAM is specifically designed for consumer NVIDIA GPUs, where alternative approaches via the NVIDIA P2P API do not work.<\/p>\n<p>In summary, NBD-VRAM is a small yet intriguing system hack for Linux: it doesn't perform miracles or replace a RAM upgrade, but it allows the use of idle video memory as an additional layer of swap before the SSD. For laptops with soldered memory and a discrete RTX card, this can be a practical way to cope with peak loads without immediate application crashes or a painful descent into slow storage.<\/p>\n<p>Source: <a rel=\"nofollow\" href=\"https:\/\/www.linux.org.ru\/news\/hardware\/18308769\">linux.org.ru<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 NBD-VRAM, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438 NVIDIA GPU \u043a\u0430\u043a swap-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432 Linux. \u041f\u0440\u043e\u0435\u043a\u0442 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0438 \u0441 \u0440\u0430\u0441\u043f\u0430\u044f\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0433\u0434\u0435 RAM \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0441\u0442\u044c \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 NVIDIA RTX\/GTX \u0441 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 VRAM. \u041a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 C \u0438 shell, \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 MIT. \u0418\u0434\u0435\u044f NBD-VRAM \u043f\u0440\u043e\u0441\u0442\u0430: \u0435\u0441\u043b\u0438 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-181858","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 NBD-VRAM, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438 NVIDIA GPU \u043a\u0430\u043a swap-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432 Linux.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Erik Peterson\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/opublikovan-nbd-vram\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d NBD-VRAM | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 NBD-VRAM, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438 NVIDIA GPU \u043a\u0430\u043a swap-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432 Linux.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/opublikovan-nbd-vram\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-02T12:48:22+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-02T12:48:22+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47NBD-VRAM Released | ProHoster","description":"An open project, NBD-VRAM, has been released, enabling the use of a portion of NVIDIA GPU video memory as swap space in Linux.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/opublikovan-nbd-vram","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d NBD-VRAM | ProHoster","og:description":"\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 NBD-VRAM, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438 NVIDIA GPU \u043a\u0430\u043a swap-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432 Linux.","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/opublikovan-nbd-vram","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2026-06-02T12:48:22+00:00","article:modified_time":"2026-06-02T12:48:22+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":[],"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/181858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=181858"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/181858\/revisions"}],"predecessor-version":[{"id":182088,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/181858\/revisions\/182088"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=181858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=181858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=181858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}