Hi all,
Below you have the steps to get SR-IOV working in a Gigabyte GA-AB350M-Gaming 3 (Rev. 1.x) motherboard. This is very much based on the tutorial by "Enabling SR-IOV for Intel NIC (X550-T2) on Proxmox 6" by @Sandbo Thanks.
As explained in other tutorials it is must to have support form the motherboard in IOMMU.
As explained in other tutorials as of version 6.3-4 of Proxmox there is the need to add /etc/modprobe.d module configurations for the NIC drivers in order to set the maximum number of virtual functions for each NIC, add /etc/modules vfio modules and update the /etc/default/grub bootloader with command lines to enable IOMMU,
TO BE CONTINUED.
Below you have the steps to get SR-IOV working in a Gigabyte GA-AB350M-Gaming 3 (Rev. 1.x) motherboard. This is very much based on the tutorial by "Enabling SR-IOV for Intel NIC (X550-T2) on Proxmox 6" by @Sandbo Thanks.
- Motherboard Gigabyte GA-AB350M-Gaming 3 (Rev. 1.x). BIOS version F50d
- CPU AMD Ryzen 5 1500X
- Three PCI expansion slots in the motherboard:
- 1 x slot PCI Express x16 running x16 (PCIEX16). Populated with a NVIDIA GTX1060 graphics card. This follows PCI Express 3.0 standard.
- 1 x slot PCI Express x1 running x1 (PCIEX1). Populated with an intel NIC. Dual 1Gbps (E1G42ET - Intel 82576). This follows PCI Express 2.0 standard.
- 1 x slot PCI Express x16 running x4 (PCIEX4). Populated with an intel NIC. Dual 10Gbps (X520-DA2 - Intel 82599ES). This follows PCI Express 2.0 standard.
- Proxmox 6.3-4 in cluster (the other node an HP micro gen8 but that should not have any effect on this)
As explained in other tutorials it is must to have support form the motherboard in IOMMU.
- GA-AB350M BIOS F50d
- Enable IOMMU
- A side note, please bear in mind that proxmox needs SVM mode enabled for KVM functionality (not related to this, but good to remember)
2. Proxmox ConfigurationAs explained in other tutorials as of version 6.3-4 of Proxmox there is the need to add /etc/modprobe.d module configurations for the NIC drivers in order to set the maximum number of virtual functions for each NIC, add /etc/modules vfio modules and update the /etc/default/grub bootloader with command lines to enable IOMMU,
- Add configuration files in /etc/modprobe.d (create the files as probably they do not exist). igb.conf provide 4 virtual functions for each of the two 1Gbps ports of E1G42ET. ixgbe.conf provide 8 virtual functions for each of the two ports 10Gbps of X520-DA2
- file /etc/modprobe.d/igb.conf. Add the following: options igb max_vfs=4
root@ryzen:~# cat /etc/modprobe.d/igb.conf
options igb max_vfs=4
- file /etc/modprobe.d/ixgbe.conf. Add the following: options ixgbe max_vfs=8
root@ryzen:~# cat /etc/modprobe.d/ixgbe.conf
options ixgbe max_vfs=8
- Edit /etc/modules to add configuration for vfio modules
- file /etc/modules. Add the following lines:
root@ryzen:~# cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
- Update initramfs
root@ryzen:~# update-initramfs -u -k all
- Edit /etc/default/grub Note that the process of GRUB command line update needs to be done in two steps. If only IOMMU and Passthrough are enabled in GRUB, the operating system creates a number of IOMMU groups that mix devices that we want separated in order to passthrough them independently. Let's see it:
- Initially the line GRUB_CMDLINE_LINUX_DEFAUL. should be edited to look like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
- amd_iommu=on This is required to enable IOMMU support in the kernel.
- iommu=pt This is required to enable IOMMU passthrough
- edit grub file
- Initially the line GRUB_CMDLINE_LINUX_DEFAUL. should be edited to look like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
root@ryzen:~# cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
....
GRUB_DISTRIBUTOR="Proxmox Virtual Environment"
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
GRUB_CMDLINE_LINUX=""
....
- Update grub
root@ryzen:~# update-grub
- Reboot Proxmox server
root@ryzen:~# reboot
- After reboot. Let's check that IOMMU is active and the IOMMU groups generated
root@ryzen:~# dmesg | grep -e IOMMU -e AMD-Vi
[ 0.765091] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
[ 0.766199] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 0.766200] pci 0000:00:00.2: AMD-Vi: Extended features (0xf77ef22294ada):
[ 0.766203] AMD-Vi: Interrupt remapping enabled
[ 0.766203] AMD-Vi: Virtual APIC enabled
[ 0.766365] AMD-Vi: Lazy IO/TLB flushing enabled
[ 0.766528] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
- Let's check the IOMMU groups generated by the kernel
root@ryzen:~# for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU Group %s ' "$n"; lspci -nns "${d##*/}"; done;
IOMMU Group 0 00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 0 00:01.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge [1022:1453]
IOMMU Group 0 00:01.3 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge [1022:1453]
IOMMU Group 0 01:00.0 Non-Volatile memory controller [0108]: Phison Electronics Corporation E12 NVMe Controller [1987:5012] (rev 01)
IOMMU Group 0 02:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset USB 3.1 xHCI Controller [1022:43bb] (rev 02)
IOMMU Group 0 02:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset SATA Controller [1022:43b7] (rev 02)
IOMMU Group 0 02:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Device [1022:43b2] (rev 02)
IOMMU Group 0 03:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 0 03:01.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 0 03:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 0 04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
IOMMU Group 0 05:00.0 Ethernet controller [0200]: Intel Corporation 82576 Gigabit Network Connection [8086:10c9] (rev 01)
IOMMU Group 0 05:00.1 Ethernet controller [0200]: Intel Corporation 82576 Gigabit Network Connection [8086:10c9] (rev 01)
IOMMU Group 0 06:10.0 Ethernet controller [0200]: Intel Corporation 82576 Virtual Function [8086:10ca] (rev 01)
IOMMU Group 0 06:10.1 Ethernet controller [0200]: Intel Corporation 82576 Virtual Function [8086:10ca] (rev 01)
IOMMU Group 0 06:10.2 Ethernet controller [0200]: Intel Corporation 82576 Virtual Function [8086:10ca] (rev 01)
IOMMU Group 0 06:10.3 Ethernet controller [0200]: Intel Corporation 82576 Virtual Function [8086:10ca] (rev 01)
IOMMU Group 0 06:10.4 Ethernet controller [0200]: Intel Corporation 82576 Virtual Function [8086:10ca] (rev 01)
IOMMU Group 0 06:10.5 Ethernet controller [0200]: Intel Corporation 82576 Virtual Function [8086:10ca] (rev 01)
IOMMU Group 0 06:10.6 Ethernet controller [0200]: Intel Corporation 82576 Virtual Function [8086:10ca] (rev 01)
IOMMU Group 0 06:10.7 Ethernet controller [0200]: Intel Corporation 82576 Virtual Function [8086:10ca] (rev 01)
IOMMU Group 0 07:00.0 Ethernet controller [0200]: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection [8086:10fb] (rev 01)
IOMMU Group 0 07:00.1 Ethernet controller [0200]: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection [8086:10fb] (rev 01)
IOMMU Group 0 08:10.0 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:10.1 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:10.2 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:10.3 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:10.4 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:10.5 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:10.6 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:10.7 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:11.0 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:11.1 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:11.2 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:11.3 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:11.4 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:11.5 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:11.6 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 0 08:11.7 Ethernet controller [0200]: Intel Corporation 82599 Ethernet Controller Virtual Function [8086:10ed] (rev 01)
IOMMU Group 1 00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 2 00:03.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 2 00:03.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge [1022:1453]
IOMMU Group 2 09:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)
IOMMU Group 2 09:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev a1)
IOMMU Group 3 00:04.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 4 00:07.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 4 00:07.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B [1022:1454]
IOMMU Group 4 0a:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Raven/Raven2 PCIe Dummy Function [1022:145a]
IOMMU Group 4 0a:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Platform Security Processor [1022:1456]
IOMMU Group 4 0a:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) USB 3.0 Host Controller [1022:145c]
IOMMU Group 5 00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 5 00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B [1022:1454]
IOMMU Group 5 0b:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Renoir PCIe Dummy Function [1022:1455]
IOMMU Group 5 0b:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)
IOMMU Group 5 0b:00.3 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) HD Audio Controller [1022:1457]
IOMMU Group 6 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 59)
IOMMU Group 6 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU Group 7 00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 0 [1022:1460]
IOMMU Group 7 00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 1 [1022:1461]
IOMMU Group 7 00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 2 [1022:1462]
IOMMU Group 7 00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 3 [1022:1463]
IOMMU Group 7 00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 4 [1022:1464]
IOMMU Group 7 00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 5 [1022:1465]
IOMMU Group 7 00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6 [1022:1466]
IOMMU Group 7 00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 [1022:1467]
TO BE CONTINUED.