Proxmox Virtual Environment 9.2 released with Linux kernel 7.0 as the new stable default. Intel Xe SR-IOV is mature enough to be useful in this version, opening new possibilities for hardware acceleration in VM.
Let’s give it a little test drive!
Requirements#
- Intel GPU with SR-IOV support in Xe driver
- Tiger Lake iGPU
- Alder Lake iGPU
- including N-series (Alder Lake-N, Twin Lake)
- Panther Lake iGPU
- including Wildcat Lake
- Battlemage dGPU
- Proxmox Virtual Environment 9.2+
- Guest OS
- Linux kernel 6.18+
- Xe kernel module
Steps#
1. Ensure xe is the kernel driver in use on PVE#
Run lspci -k, if i915 is the kernel driver in use instead of xe, like
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]
DeviceName: Onboard - Video
Kernel driver in use: i915
Kernel modules: i915, xethen create file /etc/modprobe.d/intel-graphics.conf with following content
# block i915 probe for all known devices
options i915 force_probe=!*
# force xe probe for all known devices
options xe force_probe=*I am cutting corners by using wildcard because it works on my machine. You can use device ID here if you want to be more specific, which can be helpful in cases when you have to keep using i915 on part of the devices.
See detailed description in xe_pci.c, i915/Kconfig, xe/Kconfig.
Panther Lake, Wildcat Lake, Battlemage users can safely skip this step since it’ll use xe by default.
2. Enable VF (Virtual Function) on PVE#
Install sysfsutils
apt install sysfsutilsand create file /etc/sysfs.d/gpu-sriov.conf with following content
devices/pci0000:00/0000:00:02.0/sriov_numvfs = 7Your PCI domain, bus and device number may vary if you’re using a dGPU, please modify the content accordingly.
3. Reboot PVE node and check VFs#
# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]
00:02.1 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]
00:02.2 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]
00:02.3 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]
00:02.4 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]
00:02.5 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]
00:02.6 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]
00:02.7 VGA compatible controller: Intel Corporation Alder Lake-N [Intel Graphics]00:02.1 and so on are VFs that can be passed through to VMs.
4. Ensure xe is the kernel driver in use on guest OS#
Guest OS also needs xe to drive VF that are passed through.
Repeat step 1, this time in the guest VM.
On Windows guests, updating GPU driver to the latest version usually gives you the best chance to get things working.
5. Reboot VM and check vGPU#
In the guest VM
# check render node
ls /dev/dri/renderD128
# check VA-API
vainfo --display drm --device /dev/dri/renderD128You may need va-driver-all and vainfo for this.
Addendum#
HAOS should have Linux kernel 6.18 with Xe kernel module included in HAOS 18.0. See home-assistant/operating-system#4611.
According to HAOS developer documentation, module configuration files in /etc/modprobe.d is persistent. This workflow to enable Xe SR-IOV should work by then.