I recently hosted an episode of Software Engineering Radio called “Danilo Krummrich on Rust in the Linux Kernel”!

  • Home
  • Teaching
    • Overview
    • Algorithm Analysis
    • Computer Security
  • Research
    • Overview
    • Papers
    • Presentations
  • Outreach
    • Software
    • Service
    • Blog
  • About
    • Biography
    • Schedule
    • Contact
    • Blog
    • Service
    • Papers
    • Presentations
    • Light
    • Dark
    • System

Contents

  • Introduction
  • Insights
  • Listen

Insights from my Software Engineering Radio interview with Danilo Krummrich

post
software development
software engineering radio
How is Rust changing the way that GPU drivers are written for the Linux kernel?
Author

Gregory M. Kapfhammer

Published

2026

Introduction

In a recent episode of the Software Engineering Radio podcast, I interviewed Danilo Krummrich, a principal software engineer at Red Hat and a member of the Rust for Linux core team. We talked about Nova, the Rust driver that he and his colleagues are building for NVIDIA GPUs, why the kernel needed a memory-safe second language, how pin-init makes self-referential structures safe, and why only a handful of unsafe blocks remain in the driver. I’m thankful that Danilo took the time for this interview!

Insights

Before you listen to the full episode, please check out some of its key insights:

Why did the Linux kernel community decide to support a second language?

Danilo starts with the data that motivated the change:

“So I think roughly two-thirds of serious kernel CVEs stem from memory safety bugs and 30 years of C-discipline hadn’t moved that number in any other positive direction. So I think there is a huge motivation for a language that delivers memory-safe concepts. And I think Rust is just a good fit for that. It’s a system-level language, has no things like garbage collectors, has a minimal runtime, direct memory control, and is C-ABI-compatible.”

What is a self-referential structure, and why is it hard to build in Rust?

The definition comes first:

“It’s simply an object that has a field that points to another field of that same object.”

Danilo then explains why the ownership model gets in the way:

“Right. So Rust fundamentally does not support self-referential structures natively. It’s just because the Rust ownership model assumes values can be moved. … There are ways to work with that in the Rust language or the standard library already, which is maybe uninit and then you initialize the fields and then assert that you initialized all the fields, but that’s fundamentally unsafe again and something we definitely want to avoid.”

The kernel’s answer is a crate that Nova also vendors:

“And the way we had to solve that in Rust was with a component that’s called pin-init, which basically provides exactly this pattern, but with a way that the implementer cannot forget to initialize fields or initialize things in the wrong order. So it provides so-called initializers, which is kind of a structure that represents the recipe to initialize a structure within a given chunk of memory.”

How much of the Nova driver is still unsafe code?

Danilo puts the remaining unsafe code in context:

“So Nova has about 13,000 lines of code, and I think out of those 13,000 lines of code, we have maybe a handful of unsafe blocks, which is really just for the DMA buffer interaction that we touched on previously. … So it’s really just a handful of unsafe.”

Does Rust help performance, or only memory safety?

Danilo points to the I/O abstractions as an example of what a zero-cost abstraction looks like in practice:

“And this is, I think, an interesting story when it comes to zero-cost abstractions where really thousands of lines of code really just compile down to just two assembly instructions, right?”

He then describes a case where lifetimes remove work that C code would do at run time:

“With Rust, it is possible to track lifetimes in a different way, such that the compiler takes care of it by Rust native lifetimes. So you don’t have to introduce reference counts in the first place, just in order to gather a little bit of additional memory safety. So there is Rust code where we get away with really just using lifetimes and having the chance to avoid reference counts, which obviously saves memory allocations and saves atomic operations.”

What did you learn from building the driver upstream rather than downstream?

Danilo describes the process that Nova’s team adopted, starting from a constraint that every kernel change has a user:

“And there is one fundamental rule in the kernel, which says that you cannot have code upstream that does not have a user. … And the difference that I can see is with the approach of building this driver out upstream in the kernel is that we are benefiting a lot from upstreaming it in smaller chunks, which makes it much more accessible to maintainers in the kernel, to other contributors, to other reviewers. And it significantly increases the code quality because if you’re upstream a huge chunk of code in one go, you’re likely not having the core maintainers of the core infrastructure you’re using taking a look on it.”

Listen

In conclusion, if you’re interested in learning more about bringing Rust into the Linux kernel, GPU driver architecture, or what it takes to build a driver upstream, I highly recommend that you listen to Danilo Krummrich on Rust in the Linux Kernel from Software Engineering Radio! You can find it on your favorite podcast player, Apple Podcasts, Spotify, YouTube, or listen to it with this handy podcast player.

Software Engineering Radio · Episode 744

Danilo Krummrich on Rust in the Linux Kernel

0:00 / --:--

Return to Blog Post Listing

GMK

Top

  • GitHub

  • Mastodon

  • LinkedIn

  • Google Scholar