An AI Rewrote NVIDIA’s Kernel Driver

Eric Hartford, founder of independent AI lab QuixiAI, put an open project on GitHub that rewrites NVIDIA’s closed Linux kernel driver with the help of AI. Replace the original nvidia.ko with nvdriver and, by the project’s account, standard CUDA and large models still run, while a set of restrictions quietly disappear: peer-to-peer links on consumer cards, concurrency caps on video encoding, virtualisation licence checks and compute locks. A Tesla V100 from 2017 gains about 26 per cent more memory bandwidth in the process.

nvdriver project page showing Rust NVIDIA Linux kernel driver repository
The nvdriver repository says it replaces NVIDIA’s closed kernel module (Source: 36Kr)

Why rewrite a driver

The story starts with a V100 Hartford owned. NVIDIA’s open kernel modules do not support the nine-year-old card, so he built his own. Written in Rust and developed with AI reverse-engineering tools, nvdriver was validated on his eight-card V100 machine. Once installed, memory allocation, clock behaviour and peer-to-peer access no longer depend on NVIDIA’s closed rules. The original CUDA stack and models keep working.

On the same card and in the same virtual machine, the project reports passing all 77 CUDA compatibility checks, with PyTorch, NCCL and llama.cpp outputs matching the official driver. It also raises V100 HBM2 frequency from NVIDIA’s locked 877.5 MHz to the V100S factory specification of 1,107 MHz. Memory bandwidth goes from 821.85 GB/s to 1,040.75 GB/s per card, or about 8.33 TB/s across eight cards. FP16 matrix performance rises 9.3 per cent from 97.69 to 106.82 TFLOPS. Prompt processing in llama.cpp improves 13.2 per cent, from 31,067 to 35,162 tokens per second.

Which layer got replaced

NVIDIA’s software stack has three broad layers. At the top sit user-space tools such as CUDA, PyTorch and llama.cpp, with the core CUDA runtime still closed. In the middle sits the Linux kernel driver, which controls memory allocation, job dispatch, clocks and whether two cards can talk directly. At the bottom sits chip firmware. On Turing and later architectures, the GSP handles some initialisation formerly done by the host driver, with signed closed binaries. Older V100 and P40 cards rely on another path and were never covered by the open kernel modules.

Hartford’s target was the middle layer. He thanks Gemini Neon in his posts, though a CLAUDE.md file and community pull requests show Claude Code in use as well. The workflow has three steps. Agents connect to reverse-engineering tools such as Ghidra through MCP and decompile nv-kernel.o_binary, nvidia-uvm.ko and libcuda.so, learning how functions take arguments, write hardware registers and handle errors. The logic is then reproduced in Rust and tested in Unicorn and QEMU against official machine code, with any mismatch sent back for correction. Finally, traces recorded from the official driver on a real V100 are replayed against the new driver on real hardware.

The clean-room argument

Hartford passed each V100 into an isolated virtual machine using VFIO, so a kernel crash could be cleared with a ten-second reboot rather than a trip to the data centre. That tolerance for automated failure is what makes the method work: a closed problem broken into thousands of checkable subproblems can be ground down by an agent.

Hacker News argued about whether the result is a clean-room implementation. Commenter rickdeckard noted that a classic clean room separates the team analysing a product from the team writing the replacement, while here an agent decompiled and reproduced functions directly. Hartford replied that he had no original source and had done decompilation, analysis and reimplementation, later adding that reverse engineering and clean-room work can coexist if analysis and development are sufficiently isolated.

A former AMD GPU driver engineer known as diydsp warned that drivers contain undisclosed hardware workarounds which may surface only after a long sequence of operations. Others pointed out that reverse engineering has an advantage: the original driver is available to trace, with timing fixes and silicon errata embedded in register settings and operation order.

nvdriver already runs real workloads on V100 cards, and community testing is exposing memory management and multi-card issues while other architectures remain in progress. Hartford plans to widen hardware coverage and then optimise the compute kernels themselves. Users who bought a card now have more say in how long it stays useful. For NVIDIA, the challenge is no longer only the next competitor. It is also customers pointing AI at hardware the company would rather move on from.

Editor’s note: This is an adapted translation of the original 36Kr report. It has been trimmed and restructured for readability for an international business audience. The full original (in Chinese) is at https://36kr.com/p/4096329092350724.

Leave a comment