Activate IOMMU and iGPU to Passthrough PCI into VM/CT

Activate IOMMU and iGPU to Passthrough PCI into VM/CT. It will include a guide to split the iGPU into two parts for those who needed.

1. Enable VT-d in the BIOS

  • Reboot the server and access the BIOS by pressing the DEL key.
  • Enable VT-d in the Chipset tab.
  • Save and reboot.

Image  01 - Mainboard B365m Aorus Elite. Enable VT-d in BIOS


2. Edit the GRUB configuration file

  • SSH to the Promox Server by using MobaXterm.
  • Edit the grub configuration file by using nano function or using SFTP.
1nano /etc/default/grub

Image  02 - Edit grub file by using MobaXterm

  • Now you need to find the line GRUB_CMDLINE_LINUX_DEFAULT in the configuration file and edit it. The default config looks like this:
1GRUB_CMDLINE_LINUX_DEFAULT="quiet"
  • Active IOMMU and iGPU
1GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on i915.enable_gvt=1 iommu=pt pcie_acs_override=downstream,multifunction video=efifb:off video=vesa:off vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1 modprobe.blacklist=radeon,nouveau,nvidia,nvidiafb,nvidia-gpu"
  • Active IOMMU and split iGPU into 2 parts
1GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction initcall_blacklist=sysfb_init video=simplefb:off video=vesafb:off video=efifb:off video=vesa:off disable_vga=1 vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1 modprobe.blacklist=radeon,nouveau,nvidia,nvidiafb,nvidia-gpu,snd_hda_intel,snd_hda_codec_hdmi,i915"
  • Save the grub configuration file and update the grub file
1update-grub

3. Config Promox modules to allow PCI Passthrough

  • Edit modules file
1nano /etc/modules

Image  03 - Edit modules file by using MobaXterm.

  • Adding the following line at the bottom of the file
1# Modules required for PCI passthrough
2vfio
3vfio_iommu_type1
4vfio_pci
5vfio_virqfd
6
7# Modules required for Intel GVT-g Split. Do not add if you do not split iGPU
8kvmgt
  • Now, your modules file will look like this

Image  04 - Adding modules required.

  • Update the configuration changes
1update-initramfs -u -k all
  • Reboot the Promox server to apply the changes

4. Verify IOMMU is enabled

  • Run the script below to verify if IOMMU is enabled.
1dmesg | grep -e DMAR -e IOMMU
  • You will see the line: DMAR: IOMMU enabled look like this.

Image  05 - Verify IOMMU is enabled.

  • And now, When you add a new PCI device, the notification `No IOMMU detected" has been dissapear.

Image  06 - IOMMU activated. iGPU is split into 2 parts.

With only 4 steps you have successfully activated IOMMU and can passthrough PCI to VM.

In my case, Which PCI do I passthrough in each VM/CT ? I will show you in the next article.

The image below is one of my practice.

Image  07 - Passthrough SATA Controller to XPEnology VM.