Enabling and Disabling IOMMU / VT-d¶
The IOMMU enable state is decided by both BIOS settings and the OS/kernel settings.
. |
IOMMU enabled in BIOS |
IOMMU disabled in BIOS |
---|---|---|
IOMMU enabled in kernel |
enabled |
disabled |
IOMMU disabled in kernel |
disabled |
disabled |
Checking if the IOMMU is currently enabled¶
To check if the IOMMU is enabled in linux run:
# ls /sys/class/iommu/
dmar0 dmar1
If the directory is empty, IOMMU is disabled. If there are entries in the directory the IOMMU is enabled.
Enabling IOMMU in Linux Kernel¶
The kernel parameter to use depends on the processor type:
CPU Type |
Kernel parameter |
Intel CPUs |
|
AMD CPUs |
|
For a full list of options, see the Kernel command-line parameters documentation at kernel.org.
RHEL 7 / CentOS 7¶
On RHEL 7 / CentOS 7 refer to Customizing the GRUB 2 Configuration File.
Other Distributions¶
Most modern Linux distributions use GRUB2.
To permanently add kernel command-line options, /etc/default/grub
must be edited.
In this file, change GRUB_CMDLINE_LINUX_DEFAULT
to set options for all kernels.
Example:
GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on"
After changing this file, the grub configuration must be updated. On Ubuntu distributions run:
# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50-curtin-settings.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-54-generic
Found initrd image: /boot/initrd.img-4.15.0-54-generic
Adding boot menu entry for EFI firmware configuration
done
On other distributions grub2-mkconfig
must be used. It requires that the output
grub2 configuration file is manually specified. What file to use depends on the
distribution and if the system boots with UEFI or not. Sometimes there’s a symlink
in /etc
:
ls -l /etc/grub*.cfg
lrwxrwxrwx. 1 root root 22 Jun 6 14:06 /etc/grub2.cfg -> ../boot/grub2/grub.cf
Enabling IOMMU in BIOS¶
The option to toggle IOMMU in BIOS goes by different names:
IOMMU
Intel VT for Directed I/O (VT-d)
Intel VT-d
Please refer to your system’s manual.