409 字
2 分钟
PVE Intel核显SR-IOV虚拟化配置

使用项目 https://github.com/strongtz/i915-sriov-dkms/

kernel配置#

先查一下kernel列表,改到6.8.太高了不兼容

Terminal window
proxmox-boot-tool kernel list
apt-cache search pve-kernel
#准备装6.8
apt install proxmox-headers-6.8 proxmox-kernel-6.8
proxmox-boot-tool kernel pin 6.5.13-5-pve

如果你的就是6.8,那进行以下操作

#装header
apt install pve-headers-$(uname -r)
proxmox-boot-tool kernel list
#根据列出的信息进行以下操作
proxmox-boot-tool kernel pin 6.8.12-8-pve

切换完内核重启一次

grub配置#

加一下cmdline

Terminal window
vim /etc/default/grub
#GRUB_CMDLINE_LINUX_DEFAULT
#加入intel_iommu=on iommu=pt i915.enable_guc=3 i915.max_vfs=7 module_blacklist=xe

安装#

下载本体
wget -O /tmp/i915-sriov-dkms_2025.02.03_amd64.deb "https://github.com/strongtz/i915-sriov-dkms/releases/download/2025.02.03/i915-sriov-dkms_2025.02.03_amd64.deb"
进行基础安装操作

Terminal window
apt install build-* dkms
dpkg -i /tmp/i915-sriov-dkms_2025.02.03_amd64.deb
#完成后
update-initramfs -u
update-grub

配置sysfutils#

apt install sysfsutils
echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 7" > /etc/sysfs.conf

完成后重启即可

完成验证#

lspci | grep VGA输出如下为正常

00:02.0 VGA compatible controller: Intel Corporation Alder Lake-S GT1 [UHD Graphics 730] (rev 0c)
00:02.1 VGA compatible controller: Intel Corporation Alder Lake-S GT1 [UHD Graphics 730] (rev 0c)
...
00:02.7 VGA compatible controller: Intel Corporation Alder Lake-S GT1 [UHD Graphics 730] (rev 0c)

注意事项#

后面开虚拟机的时候cpu一定要选host模式,分配vgpu要在高级选上pcie,主显卡也要打勾,一定不要选全部功能,不能错选根设备00:02.0!

因为Intel的驱动将pciid固定到02.0,我们使用02.1/2/3等sriov核显时,不能被正常驱动,即便是直通的sriov核显中勾选了PCI-Express显示正常驱动,但是也会因为pciid的原因导致一些软件工作不正常,比如流媒体Jellyfin Emby等无法硬解和转码。

我们需要在虚拟机conf中把直通的核显指定地址

nano /etc/pve/qemu-server/虚拟机序号.conf
添加:
args: -set device.hostpci0.addr=02.0 -set device.hostpci0.x-igd-gms=0x2

卸载:dkms remove i915-sriov-dkms/6.1

建议搭配#

https://github.com/nomi-san/parsec-vdd
https://github.com/HaliComing/parsec-vdd-cli
添加开机启动:shell:startup

PVE Intel核显SR-IOV虚拟化配置
https://iiii.fun/posts/pve/pve-intel-sriov/
作者
慶靈
发布于
2025-03-04
许可协议
CC BY-NC-SA 4.0