# If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration'
# Disable os-prober, it might add menu entries for each guest GRUB_DISABLE_OS_PROBER=true
# Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console
# The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true
# Disable generation of recovery mode menu entries GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1"
将第 9 行的:
1
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
如果你是 Intel CPU 改为:
1
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
如果你是 AMD YES 的话,改为:
1
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"
保存之后执行以下命令来进行更新:
1
update-grub
再将下面的添加到 /etc/modules 中:
1 2 3 4
vfio vfio_iommu_type1 vfio_pci vfio_virqfd
执行以下命令来刷新 initramfs :
1
update-initramfs -u -k all
重启 Proxmox 主机,再执行以下命令来验证是否成功开启 IOMMU :
1
dmesg | grep -e DMAR -e IOMMU -e AMD-Vi
返回类似如下的内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[ 0.025301] ACPI: DMAR 0x000000007BFE6000 0000B0 (v01 HPE Server 00000001 1590 00000001) [ 0.061429] DMAR: IOMMU enabled [ 0.116477] DMAR: Host address width 39 [ 0.116478] DMAR: DRHD base: 0x000000fed91000 flags: 0x1 [ 0.116481] DMAR: dmar0: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da [ 0.116482] DMAR: RMRR base: 0x000000799d7000 end: 0x000000799f6fff [ 0.116482] DMAR: RMRR base: 0x000000799c6000 end: 0x000000799c6fff [ 0.116483] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 0 [ 0.116484] DMAR-IR: HPET id 0 under DRHD base 0xfed91000 [ 0.116484] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping. [ 0.118014] DMAR-IR: Enabled IRQ remapping in x2apic mode [ 0.593568] DMAR: No ATSR found [ 0.593593] DMAR: dmar0: Using Queued invalidation [ 0.595251] DMAR: Intel(R) Virtualization Technology for Directed I/O