Skip to content
项目

关于

一种 virtio 设备,可让多个虚拟机以裸机速度共享一块 NVIDIA GPU。

系统与基础设施

这些数字如何统计

实测星标增长

24小时
0
7天
+3
15天
+6
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

virtio-nvgpu

Share one NVIDIA GPU across several VMs, at bare-metal speed.

Run NVIDIA's own unmodified drivers (Vulkan, NVENC, and CUDA) inside multiple microVMs, while the host keeps the card. No vGPU licenses or VFIO passthrough needed.

Why

  1. Passthrough locks the whole GPU to one VM.
  2. vGPU costs real money and only works on datacenter cards.
  3. API forwarding (Venus, virgl) is hella slow, and doesn't support NVENC or CUDA.

virtio-nvgpu forwards the NVIDIA driver instead of the graphics API. The guest builds its own GPU commands and writes them straight to GPU memory, so a frame being drawn doesn't cross the VM boundary. Nothing gets serialized and replayed on the host the way Venus and virgl do it.

How fast

On an RTX 3060:

  • Within 2% of bare metal for any real game frame (>2 ms)
  • Same CPU cost as running on the host
  • 12 VMs on one card, splitting it evenly, each encoding 720p60 H.264 with no dropped frames

[!NOTE] 12 is what we tested, not a hard cap. Like containers, you're limited by:

  1. VRAM. A game needs gigabytes, so this usually runs out first. Cap each guest with --vram-limit-mib.
  2. Host CPU and RAM for each guest.
  3. NVENC's 12-session cap on GeForce cards. Our Nestri capture layer encodes with Vulkan Video, which doesn't count against it (16 at once worked fine).

Numbers and method →

Who it's for

People who stream games or GPU apps from headless VMs (cloud gaming, remote desktops, CI with a real GPU, selfhosted "serverless" AI) on consumer NVIDIA cards.

Before you use it

  • It isn't hardware isolation. The host NVIDIA driver is the trust boundary. If your tenants don't trust each other, use passthrough or vGPU. (It's roughly the same trust boundary Docker containers have.) Details →
  • Linux guests and hosts only. Supports driver 535.129.03 and newer.
  • This is an early version, tested on only two cards. CUDA works but hasn't been benchmarked.

Learn more

Inspired by gVisor's nvproxy, and kayfabe by Reindert Pelsma.

探索相关项目

加载中…