1. Check if VFIO is already in the System.
Linux 5.4 build the VFIO into the kernel. Here is the way to check it.
Looks like VFIO_MDEV is still a module.
Another way to check:
Check kernel log too:
OK, looks like my system already have VFIO. But not sure if it is running.
2. Check if IOMMU enabled
No "IOMMU enabled" in the log. So we need to enable it.
Open /etc/default/grub and add following commands:
intel_iommu=on iommu=pt pcie_aspm=off vfio_iommu_type1.allow_unsafe_interrupts=1 vfio_pci.disable_vga=1 vfio_pci.disable_idle_d3=1
As following: