2

I am planning to perform nested virtualization with GPU device. I have guest Ubuntu OS running and I have mapped GPU to it by enabling intel_iommu on the host, and configuring NVIDIA PCI as vfio-pci device. I am also able to install NVIDIA driver on the guest and use it for deep-learning.

However, now I want to run another VM inside the guest, let's call the guest that runs on host as L1 and the guest that runs on guest as L2, I want the GPU to be accessiable by the L2 guest, I came across vIOMMU supported on Q35 Qemu chipset, how do I enable IOMMU on L1 guest, so that I can pass the gpu directly to L2 guest??

Hardware : Intel i7 8th Gen NVIDIA GeForce 1070 Linux - Ubuntu 18.04, Hypervisor - KVM

1 Answers1

0

There are a couple of things to be done on KVM-QEMU to allow nested IOMMU

  1. Use BIOS OVMF.fd, because default bios might not support the same
  2. enable the chipset q35 with accel=kvm,kernel_irqchip=split

then check with dmesg | grep -e DMAR -e IOMMU and find /sys/kernel/iommu_groups/ -type l, for iommu groups inside the VM.

Vipin Varghese
  • 4,540
  • 2
  • 9
  • 25