DEV Community

Boriss V
Boriss V

Posted on

Running Talos Linux with GPU Passthrough on QEMU

I’ve been spending a lot of time with Talos Linux
lately. It’s awesome for running Kubernetes in a minimal, immutable way. But there’s always that moment when you go:

Talos is lightweight, QEMU is great for homelabs, but GPU passthrough is where things get a bit hacky. So I decided to make it work — and I put the results in a repo:

https://github.com/kubebn/talos-qemu-gpu-passthrough

Running Talos on QEMU is easy enough. Spin up a VM, boot the ISO, apply a machine config — done. But once I needed NVIDIA GPU support for workloads (think AI/ML testing or just experimenting with device plugins).

Here's the thing about GPU passthrough - you can't just point QEMU at your GPU and hope for the best. The host OS needs to completely release control of the GPU to the VFIO subsystem. This means:

Your GPU disappears from the host (no more nvidia-smi on that card)
VFIO takes ownership via kernel parameters
The VM gets exclusive access to the hardware

It's like lending your car to a friend - they get all the control, you get none.

OVMF and UEFI Considerations

Modern GPUs are picky about firmware. The scripts detect if your system supports OVMF (UEFI for VMs) and configure things appropriately. This is especially important for newer cards that expect UEFI environments.

Closing thoughts

This is homelab territory, so expect some rough edges. If you’ve ever wrestled with PCI passthrough, you know it’s always a bit finicky.

But hey, I got it working, and now my Talos VMs can see GPUs just fine. Hopefully it helps someone else avoid a weekend of trial-and-error.

Top comments (0)