Hardware Passthrough
GPU
iGPU (Intel)
Intels integrated GPUs from 5th up to and including 10th Gen have GVT-g support. That means that the GPU can be subdivided into smaller, logical GPUs. That way you can pass the GPU to multiple VMs instead of just one (like you do if the iGPU only supports VTD-d).
To enable GPU passthrough with GVT-g do the following:
- Add
intel_iommu=on i915.enable_gvt=1
to the grub configuration:
/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on i915.enable_gvt=1"
- Make it so the necessary kernel modules are loaded at boot time:
/etc/modules
vfio
vfio_iommu_type1
vfio_pci
kvmgt
- Update initramfs
update-initramfs -u -k all
- Update GRUB
update-grub
Reboot
Check dmesg output for output:
dmesg | grep -e DMAR -e IOMMU
Output should contain
DMAR: IOMMU enabled
DMAR: Intel(R) Virtualization Technology for Directed I/O
- You can list the amount of available logical GPUs (change device ID to that of yours):
cat /sys/bus/pci/devices/0000\:00\:02.0/mdev_supported_types/i915-GVTg_V5_4/available_instances
- Now a logical GPU can be passed through to a VM or container!
ChooseAdd -> PCI Device
and select your iGPU. Notice how it saysMediated: yes
, that means the iGPU is divided into separate logical GPUs. Now open theMDev Type
Dropdown. Here you can see the different logical GPUs and select one: