本文内容主要来自【PVE9.x开启Intel核显SR-IOV保姆级教程,小白一看就会】 https://www.bilibili.com/video/BV1mtvNzwEis/?share_source=copy_web&vd_source=0500830e81ac8b7c6640b5a6f7b7f4e1
我是具体操作一遍记录下来。我这里用的CPU是N100,理论上12代以后的intel核显CPU都是没问题的。
操作之前最好先把PVE改成国内源,可以用Github项目:https://github.com/Mapleawaa/PVE-Tools-9,操作简单,适合新手。在PVE输入以下命令行即可食用:

bash <(curl -sSL https://ghfast.top/raw.githubusercontent.com/Mapleawaa/PVE-Tools-9/main/PVE-Tools.sh)

然后输入lspci查看PCI设备信息。
找到显卡,我这里是:

00:02.0 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]

然后用命令行查看是否打开SR-IOV功能。

lspci -vv -s 00:02.0

在返回信息中能看到类似如下内容,即说明已经打开了该功能,否则还需要到BIOS里面打开。

Capabilities: [320 v1] Single Root I/O Virtualization (SR-IOV)
      IOVCap: Migration- 10BitTagReq- IntMsgNum 0
      IOVCtl: Enable- Migration- Interrupt- MSE- ARIHierarchy- 10BitTagReq-
      IOVSta: Migration-
      Initial VFs: 7, Total VFs: 7, Number of VFs: 0, Function Dependency Link: 00
      VF offset: 1, stride: 1, Device ID: 46d1
      Supported Page Size: 00000553, System Page Size: 00000001
      Region 0: Memory at 0000004010000000 (64-bit, non-prefetchable)
      Region 2: Memory at 0000004020000000 (64-bit, prefetchable)
      VF Migration: offset: 00000000, BIR: 0

下面就是具体操刀了。输入命令修改grub:

nano /etc/default/grub

控制光标位置,对相应行进行修改,改成这样:

GRUB_CMDLINE_LINUX_DEFAULT="quiet i915.enable_guc=3 i915.max_vfs=7 module_blacklist=xe"

如果不行就改成这样:

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on i915.enable_guc=3 i915.max_vfs=7 module_blacklist=xe"

上面的intel,如果是AMD核显需改成AMD。Ctrl+S,Ctrl+X,保存并退出。
执行下面两条命令:

apt install -y build-essential git dkms sysfsutils proxmox-headers-$(uname -r) intel-gpu-tools
echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 7" >> /etc/sysfs.conf

数字7是设置虚拟显卡数量。
下面到这个地址找到最新核显驱动并安装:https://github.com/strongtz/i915-sriov-dkms
输入命令行:

wget https://github.com/strongtz/i915-sriov-dkms/releases/download/2026.02.04/i915-sriov-dkms_2026.02.04_amd64.deb
dpkg -i i915-sriov-dkms_2026.02.04_amd64.deb

安装时间比较久,耐心等待。最后输入:

update-grub

重启PVE,在Shell输入lspci可以看到显卡多了,就说明设置成功了。

00:02.0 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]
00:02.1 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]
00:02.2 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]
00:02.3 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]
00:02.4 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]
00:02.5 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]
00:02.6 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]
00:02.7 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]

使用的时候在虚拟机硬件里面添加PCI设备,在原始设备里面选择虚拟显卡,但是要注意第一个是实体显卡,不能使用,只能使用后面虚拟出来的显卡。虚拟机系统里面还需要安装intel核显驱动,才能起作用。