Skip to content

Passing an NVIDIA A100 Through to a KVM VM Using Cockpit

Published:
2 min read

I recently worked on configuring full GPU passthrough on a DELL R760 server running Ubuntu with KVM virtualization managed through Cockpit Machines.

The server itself is built for heavy AI and compute workloads:

The client required a dedicated Ubuntu 22.04 virtual machine with:

Instead of using VMware or Proxmox, I used Cockpit with Cockpit Machines on Ubuntu because its faster to setup, clean and lightweight to manage libvirt/KVM from the browser.

The process involved enabling Intel VT-d and IOMMU from BIOS of host server, configuring VFIO on the Ubuntu host, isolating the NVIDIA GPU from the host operating system, and attaching the PCIe device (our main gpu) directly to the VM through Cockpit.

After binding the A100 to vfio-pci, the VM was configured using:

Inside the VM, I installed NVIDIA datacenter drivers, CUDA 12.x, Docker, and NVIDIA Container Toolkit. The final setup allowed the Ubuntu VM to fully own the A100 GPU with near bare-metal performance.

The result was a stable AI-ready virtual machine capable of running GPU accelerated Docker containers directly inside KVM while still keeping the management layer simple through Cockpit.

I’d suggest you to read these article for better understanding, and installation steps:


https://wiki.gentoo.org/wiki/GPU_passthrough_with_virt-manager,_QEMU,_and_KVM

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/

https://cockpit-project.org/blog/cockpit-247.html


Aight, Good luck!

New posts, linux stories, and useful links straight to your inbox.

usually 2× per month, no marketing bs.


Edit on GitHub