# nvdriver

> A clean-room Rust Linux kernel driver that aims to replace NVIDIA's proprietary driver under unmodified CUDA software

- Category: Models & Inference / GPU Kernels & Compilers
- Language: Rust
- Repository: https://github.com/QuixiAI/nvdriver
- Canonical page: https://ai-tldr.dev/tools/nvdriver/
- Updated: 2026-11-30

## In short

nvdriver (module name nvidia_rs.ko) is a Linux kernel driver for NVIDIA GPUs written in Rust. The project describes it as clean-room and open source, and as a drop-in replacement for NVIDIA's proprietary kernel driver. It sits in the GPU Kernels & Compilers category of the Models & Inference tools and is open-source, written in Rust.

## Overview

nvdriver (module name nvidia_rs.ko) is a Linux kernel driver for NVIDIA GPUs written in Rust. The project describes it as clean-room and open source, and as a drop-in replacement for NVIDIA's proprietary kernel driver. The core is a no_std Rust library statically linked into a minimal C shim that loads as a normal kernel module.

The README says it works with unmodified NVIDIA userspace: CUDA, PyTorch, cuDNN, NCCL, llama.cpp and nvidia-smi, next to the stock companion modules. It also lists restrictions it removes, such as PCIe/BAR1 peer-to-peer limits, capped NVENC sessions and vGPU licensing checks. These are the project's own claims.

Hardware status is stated openly. Physical testing was done on eight Tesla V100-SXM2-32GB cards against the stock 580.178.04 driver, with 77 of 77 checks in its CUDA parity suite passing. Maxwell, Pascal and Turing through Rubin support is verified only offline, awaiting real silicon, and Tegra parts such as Jetson Orin and Thor are not supported. No license for the project itself is named in the README.

## What it does

- Rust no_std driver core linked into a small C shim, built as the kernel module nvidia_rs.ko
- Meant to run unmodified NVIDIA userspace: CUDA, PyTorch, cuDNN, NCCL, llama.cpp and nvidia-smi
- Physically verified on Volta (Tesla V100 PCIe/SXM2, Quadro GV100, Titan V, CMP 100-210); other generations from Maxwell to Rubin are verified offline only
- Reported V100 results against the stock driver: PyTorch STREAM Triad 821.85 to 1,041.72 GB/s, FP16 Tensor Core GEMM 97.69 to 107.17 TFLOPS, llama.cpp pp512 31,067 to 34,884 tok/s
- Module options set in /etc/modprobe.d/nvidia_rs.conf, for example pci_target=* and runtime_engines=1
- install.sh with Secure Boot MOK signing support, and a VFIO guest runner for testing inside a VM
- x86_64 and arm64 builds (ARCH=arm64 make modules for ARM64 and SBC boards)

## Getting started

You need Linux on x86_64 or arm64 with kernel headers, a Rust toolchain with the matching *-unknown-none target, and the existing NVIDIA userspace libraries. This is a replacement kernel driver, so test it in a VFIO VM before putting it on a machine you rely on.

1. Clone and run the validation gate

   The repository ships a script that builds the module and runs its checks.

```bash
git clone https://github.com/QuixiAI/nvdriver.git
cd nvdriver
sh tools/validate_all.sh
```

2. Try it safely in a VFIO guest

   The README documents a VM runner that passes one GPU, identified by its PCI address, through to a guest running the Rust driver.

```bash
sudo python3 tools/vm/run_vfio_guest.py --bdf 0000:b3:00.0 --driver rust
```

3. Install on the host

   install.sh installs the module and supports Secure Boot MOK signing.

```bash
./install.sh
```

4. Set module options

   Options go in a modprobe config file. This example comes from the README.

```text
options nvidia_rs pci_target=* runtime_engines=1
```

## When to use it

- Reading a worked example of a GPU kernel driver written in Rust
- Running CUDA workloads on Tesla V100 servers with the driver's reported bandwidth and clock changes
- Research into NVIDIA driver behavior and the 43-chip architecture matrix described in the repo's docs/PARITY_AND_UNLOCKS.md
- Testing the driver in a VFIO VM before any production use

## Version history

- 2026-11-30: Public launch of the clean-room Rust driver. The README reports 77/77 CUDA parity checks on eight Tesla V100-SXM2 cards, with other GPU generations verified offline only.
