Skip to content
Proyek

Tentang

Mengaktifkan vGPU SR-IOV untuk kartu GeForce konsumen dengan GPU Ampere, Ada, dan Blackwell.

Sistem dan infrastruktur

Cara angka ini diukur

289 bintang22 Fork +3 dalam 24 jam

Pertumbuhan bintang terukur

dalam 24 jam
+3
dalam 7 hari
+81
dalam 15 hari
+100
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

geforce-sriov

geforce-sriov lets virtual machines share an NVIDIA GeForce card through NVIDIA's vGPU software. Each VM gets its own SR-IOV virtual function (VF), so you can run a Windows gaming VM while the host uses the same card for CUDA, for example. NVIDIA does not officially support host CUDA or a host display on a vGPU card. A vGPU can approach native performance, depending on the workload. See the glossary for the terms used in these docs, such as VF and vGPU type.

flowchart LR
    subgraph BEFORE["Without geforce-sriov"]
        direction TB
        G["GeForce card"] -->|"PCIe passthrough"| ONE["One VM"]
        G -.->|"or used by"| HOST["The host"]
    end
    subgraph AFTER["With geforce-sriov"]
        direction TB
        PF["GeForce card<br/>(PF)"] --> VF1["VF"] --> VM1["VM"]
        PF --> VF2["VF"] --> VM2["VM"]
        PF --> VF3["VF"] --> VM3["VM"]
    end
    BEFORE ~~~ AFTER

[!IMPORTANT] geforce-sriov makes software-only changes. It does not flash the GPU or modify its firmware. uninstall removes every change it made on the host and prints what it keeps. NVIDIA vGPU software and licensing are not included: get them from NVIDIA. See What geforce-sriov installs and changes for every part, what it changes and how to remove it.

[!NOTE] Status: beta. See Supported cards for Ampere, Ada and Blackwell support. Please submit a compatibility report whether your hardware works or not. Run sudo geforce-sriov report and paste its output into the form.

Screenshots

Proxmox VE host with the desktop drawn by an RTX 5060 Ti, fastfetch, host CUDA running on two GPUs and nvidia-smi listing two vGPU processes Debian 12 guest with the XFCE desktop drawn by the vGPU, fastfetch and nvidia-smi showing an RTX Pro 6000 Blackwell DC-8Q vGPU with 8 GB Windows 11 guest with an RTX PRO 6000 Blackwell DC-8Q vGPU in Settings, GPU-Z and the NVIDIA Control Panel
Proxmox VE host: the RTX 5060 Ti draws the desktop, host CUDA runs on two GPUs, and nvidia-smi lists a vGPU process on each. NVIDIA does not officially support a host display or host CUDA on a vGPU card Debian 12 guest on a Blackwell card: the desktop is drawn by the vGPU Windows 11 guest on a Blackwell card: the vGPU in Settings, GPU-Z and the NVIDIA Control Panel

Contents

Performance

On one RTX 5060 Ti 16 GB, the same benchmarks ran on the host with the whole card and in a Debian 12 VM on an 8 GB vGPU of type RTX PRO 6000 Blackwell DC-8Q. In compute, AI, video encoding and heavy 3D, the VM matched the host. Higher is better, and each value is the median of 3 runs:

Test Host VM VM as % of host
Blender OptiX monster (samples per minute) 2095.5 2120.4 101 %
Blender OptiX junkshop 1208.6 1212.4 100 %
Blender OptiX classroom 1201.0 1202.3 100 %
Blender CUDA monster 1273.6 1274.0 100 %
Blender CUDA junkshop 636.1 638.9 100 %
Blender CUDA classroom 580.9 580.1 100 %
llama.cpp pp512 (tokens per second) 3744 3753 100 %
llama.cpp tg128 (tokens per second) 85.1 86.2 101 %
FFmpeg NVDEC to NVENC H.264 (FPS) 589 590 100 %
FFmpeg NVDEC to NVENC HEVC (FPS) 511 512 100 %
Superposition 1080p Extreme, frame-rate cap off (FPS) 60.4 60.0 99 %

See Performance for the full results, the method and where a VM falls behind the host.

Quick start

What you need

  • A supported card.
  • A Linux KVM host (x86_64, kernel 6.9 or later).
  • NVIDIA vGPU software for Linux KVM (NVIDIA-GRID-Linux-KVM-<host>-<Linux guest>-<Windows guest>.zip), which you download from NVIDIA yourself. It is the one NVIDIA input of setup. geforce-sriov includes no NVIDIA software.

If another version of geforce-sriov is installed, uninstall it first. See Another version installed for how. See Before you start for the full list of prerequisites.

geforce-sriov supports every driver build of NVIDIA's R580 branch (vGPU software 19.x). install and the guest tools find each place they patch by its code, and they refuse a build whose code differs before anything changes. These versions work on Ampere, Ada and Blackwell with 0.5.1:

Part Recommended version
vGPU host driver 580.159.01
Linux guest driver 580.159.03
Windows guest driver 582.53

Other versions are not guaranteed to work. See Supported versions for the supported builds of each part.

Steps

  1. Get geforce-sriov-<version>.tar.gz from the latest release and compare its SHA-256 with the release notes. Then unpack it and build the tools. make installs nothing:

    tar xzf geforce-sriov-<version>.tar.gz
    cd geforce-sriov-<version>
    make
    
  2. Run setup in the source folder. It finds NVIDIA's vGPU software download in the current folder, your home folder or its Downloads, or takes it with --vgpu-bundle PATH. It detects your GPUs, shows a plan and installs after you confirm it. If a prerequisite is missing, it stops and names the action to take.

    sudo ./geforce-sriov setup
    
  3. Reboot the machine when setup tells you to. The host display is off by default, as on NVIDIA's vGPU host. If the card drives your monitor, the monitor goes dark or stays on the startup text once geforce-sriov takes the card. The host keeps running: reach it over SSH or the Proxmox VE web interface. setup warns about this before you confirm. See Boot display GPU to keep the screen on.

  4. With the VM stopped, attach a VF to it. The command also inserts the guest tools disc into the VM's CD drive and ends with the next steps. See Create a VM for details.

    sudo geforce-sriov vm attach VM
    
  5. Start the VM.

  6. Run the guest tools from the CD drive: install.cmd in a Windows guest, sudo sh /mnt/linux/install.sh in a Linux guest. They install NVIDIA's guest driver from the disc and ask before each step. See Install the guest tools for details.

  7. License the guest with your own NVIDIA license. See License the guest.

  8. Check that it works: geforce-sriov check on the host reports every VF as ready, and the guest lists the vGPU. On later boots, the boot units restore the VFs. See Check that it works.

See Getting started for each step in detail. If the host stops responding or a card disappears from lspci, power the machine fully off and on. See The one rule for why.

How it works

flowchart TD
    PF["One GeForce card (PF)"]
    KM["geforce_sriov kernel module<br/>shows the kernel the card's SR-IOV capability and VF count"]
    CLI["geforce-sriov setup, install, activate<br/>and the boot units"]
    PD["NVIDIA's vGPU host driver<br/>rebuilt with geforce-sriov's patches, running on the host CPU"]
    IH["Identity hook in nvidia-vgpud<br/>shows the card as a professional card"]
    VF["VFs, 4 by default or fewer to fit the vGPU type,<br/>each typed when a VM is attached"]
    VM["Linux and Windows VMs"]
    GT["Guest tools disc<br/>sets up the NVIDIA guest driver"]
    PF --> KM --> CLI --> PD --> VF --> VM
    IH -.-> PD
    GT -.-> VM
Part What it does
geforce_sriov kernel module A livepatch that reveals the card's hidden SR-IOV capability or raises its VF count
setup, install, activate and the boot units Check the host, install the driver, create the VFs at each boot and give each VF that a VM uses its vGPU type
NVIDIA's vGPU host driver Your own copy of NVIDIA's module and vGPU plugin, patched by install
Identity hook Shows each selected card to NVIDIA's vGPU daemon as the professional card of its generation
VFs One VF per vGPU. A VF gets its vGPU type when a VM is attached to it, as in NVIDIA's own vGPU setup
Guest tools disc Installs NVIDIA's guest driver, writes the setting every guest needs and patches a few bytes in NVIDIA's guest files

See How it works for the details.

Supported cards

See Supported cards for the Ampere, Ada and Blackwell models, including laptop GPUs.

Documentation

Page What it covers
Getting started The normal path: before you start, setup, first boot, a VM, the guest driver and tools
What geforce-sriov installs and changes Every part on the host and in the VMs, what it changes, and how to remove it
FAQ, Glossary Common questions, and the terms used in the docs
VMs and guests Attaching a vGPU, guest drivers and guest tools
Host options The boot display GPU, the host desktop, host CUDA and kernel updates
Removing geforce-sriov Removing geforce-sriov, or another version before this one
Configuration and commands Config file keys, commands and exit codes, systemd units, module parameters
Supported cards, Ampere, Ada, Blackwell, Laptop support The device table and generation-specific behavior
Performance A VM compared with the host
Recovery Fixes for common problems, the one rule for a cold power cycle, and the activation lock
Technical reference, What install does to NVIDIA's files, Identity hook How each part works, including the kernel module and what changes per generation
Compatibility reports, Community reports How to report whether your hardware works, and the setups people reported
Changelog The release notes

Related projects

geforce-sriov uses SR-IOV virtual functions rather than mdev (mediated devices). Other projects take different routes:

Disclaimer

Use at your own risk. This project is provided as is, without warranty of any kind. It is under the MIT license, and the kernel module is under GPL-2.0-only OR MIT. See LICENSE. The authors are not responsible or liable for any damage, data loss, hardware failure, instability, downtime or voided warranty that results from using it.

License

  • MIT (LICENSE).
  • The kernel module and its shared device table (kernel/, include/gs_devices.h) are GPL-2.0-only OR MIT (LICENSES/).
  • See NOTICE for third-party notices.
  • NVIDIA and GeForce are trademarks of NVIDIA Corporation. This project is not affiliated with NVIDIA.

Jelajahi proyek terkait

Memuat…