Intel SR-IOV vGPU is a hardware virtualization technology that allows multiple virtual machines to share a single physical GPU without sacrificing performance. SR-IOV defines a standard method for sharing physical device functionality by partitioning the device into multiple virtual functions. Each virtual function is assigned directly to a virtual machine, enabling near-native performance for the virtual machine. Intel Graphics SR-IOV is Intel’s latest graphics virtualization technology, allowing multiple virtual machines to share a single physical GPU, providing GPU-accelerated workloads within virtual machines.
Intel’s 12th generation CPUs are Intel’s latest desktop processors, also known as Alder Lake. They feature a new performance hybrid architecture that combines performance cores and efficiency cores, elevating gaming, productivity, and creativity. The 12th Gen Intel Core desktop processors provide a new performance hybrid architecture, combining performance cores and efficiency cores to further improve gaming, productivity, and creativity.
This article describes the process of configuring SR-IOV vGPU on a 12th Gen Intel i5-12400 machine.
Step 1: Install Proxmox 7.4.1
1) Download Proxmox 7.4 (proxmox-ve_7.4-1.iso)
[https://mirrors.ustc.edu.cn/proxmox/iso/](https://mirrors.ustc.edu.cn/proxmox/iso/)
2) Create a bootable USB using Ventoy.
Ventoy, as a next-generation USB boot tool, eliminates the need for repeated USB formatting. Simply copy the ISO to the Ventoy-prepared USB, simplifying the process of creating a bootable USB. You can boot multiple systems from one USB stick.
Copy the Proxmox ISO file to the root directory of the Ventoy-prepared USB.
Step 2: Update sources and enable Linux kernel version 6.1 on PVE
The process of updating sources and installing PVE kernel 6.1 has been scripted for one-click execution.
The script is as follows:
#!/bin/sh
# Author: DoraCloud Technology Ltd.co
#
# Date: 2023/05/07
#
# DoraCloud for Proxmox Enable vGPU
# Phase 1: update source to mirrors.ustc.edu.cn
cp /etc/apt/sources.list /etc/apt/sources.list.backup
sed -i ‘s|^deb http://ftp.debian.org|deb https://mirrors.ustc.edu.cn|g’ /etc/apt/sources.list
sed -i ‘s|^deb http://security.debian.org|deb https://mirrors.ustc.edu.cn/debian-security|g’ /etc/apt/sources.list
mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak
CODENAME=`cat /etc/os-release |grep PRETTY_NAME |cut -f 2 -d “(” |cut -f 1 -d “)”`
echo “deb https://mirrors.ustc.edu.cn/proxmox/debian $CODENAME pve-no-subscription” > /etc/apt/sources.list.d/pve-no-subscription.list
# Update
apt update -y
apt dist-upgrade -y
apt install pve-kernel-6.1 -y
reboot
You can also download and run the script directly in PVE using the following command:
curl -o- http://vdi.doracloud.cn:9000/software/sriov01.sh |bash
After running the script, the PVE server will reboot, and after rebooting, the PVE kernel will switch to 6.1. You can verify that the kernel has been switched by using the `uname -r` command.
root@db12:/var/lib/vz/dump# uname -r
6.1.15-1-pve
Step 3: Install the i915-sriov dkms module, enable IOMMU, and configure 7 VFs
After the reboot, execute the following script. The script includes installing the i915-sriov-dkms module, enabling IOMMU, and configuring SR-IOV with 7 VFs.
After running the script, the server will reboot.
#!/bin/sh
# Author: DoraCloud Technology Ltd.co
#
# Date: 2023/05/07
#
# Enable IO-MMU on PVE Server
apt update && apt install pve-headers-$(uname -r)
apt install git dkms build-* unzip -y
wget http://vdi.doracloud.cn:9000/software/i915-sriov-dkms-6.1.tar.gz
tar -zxvf i915-sriov-dkms-6.1.tar.gz -C /usr/src
dkms install -m i915-sriov-dkms -v 6.1
dkms status
# Enable IO-MMU on proxmox host
echo “”
echo “********************************************”
echo “*** Enable IO-MMU on proxmox host ***”
echo “********************************************”
# Add intel_iommu=on iommu=pt to /etc/default/grub’s GRUB_CMDLINE_LINUX_DEFAULT
sed -i ‘s/GRUB_CMDLINE_LINUX_DEFAULT=”quiet”/GRUB_CMDLINE_LINUX_DEFAULT=”quiet intel_iommu=on i915.enable_guc=3 i915.max_vfs=7″/g’ /etc/default/grub
echo “”
echo ” Update grub …. “
update-grub
update-initramfs -u
pve-efiboot-tool refresh
echo “”
echo ” Install sysfsutils, set sriov_numvfs=7″
apt install sysfsutils -y
echo “devices/pci0000:00/0000:00:02.0/sriov_numvfs = 7” > /etc/sysfs.conf
echo “”
echo ” Please Verify SR-IOV by lspci |grep VGA after reboot ….”
reboot
The script can also be run online using the following command:
curl -o- http://vdi.doracloud.cn:9000/software/sriov02.sh |bash
After the server reboots, verify that vGPU is enabled by running the `lspci |grep VGA` command.
root@db12:/var/lib/vz/dump# lspci |grep VGA
00:02.0 VGA compatible controller: Intel Corporation Device 4692 (rev 0c)
00:02.1 VGA compatible controller: Intel Corporation Device 4692 (rev 0c)
00:02.2 VGA compatible controller: Intel Corporation Device 4692 (rev 0c)
00:02.3 VGA compatible controller: Intel Corporation Device 4692 (rev 0c)
00:02.4 VGA compatible controller: Intel Corporation Device 4692 (rev 0c)
00:02.5 VGA compatible controller: Intel Corporation Device 4692 (rev 0c)
00:02.6 VGA compatible controller: Intel Corporation Device 4692 (rev 0c)
00:02.7 VGA compatible controller: Intel Corporation Device 4692 (rev 0c)
Summary: To enable SR-IOV vGPU on 12th Gen CPUs, simply execute two commands:
After PVE installation, run the following command and wait for the reboot:
curl -o- http://vdi.doracloud.cn:9000/software/sriov01.sh |bash
Then run the following command and wait for the automatic reboot:
curl -o- http://vdi.doracloud.cn:9000/software/sriov02.sh |bash
Finally, use `lspci |grep VGA` to verify that vGPU has been enabled.
Leave a Reply