PVE8 上启用 12 代 Intel CPU 核显 SR-IOV

玩机教程 > Proxmox VE/PVE (24) 2025-05-20 11:17:43

Intel 产品 GPU 虚拟化技术列表

图形虚拟化技术支持每个英特尔®图形家族

内容类型: 产品信息和文件   |   文章 ID: 000093216   |   上次审核日期: 2024 年 12 月 24 日

英特尔持续推动英特尔®图形处理器上的图形虚拟化技术。这些技术中的最新技术是单根 IO 虚拟化 (SR-IOV),它取代了之前的 英特尔® Graphics Virtualization Technology –g (GVT-g)

要了解每个英特尔®显卡家族支持哪种显卡虚拟化技术,请参阅下表:

PVE8 上启用 12 代 Intel CPU 核显 SR-IOV_图示-a88d334a30f34b18819ea180cc419c64.png

原文连接:图形虚拟化技术支持每个英特尔®图形家族

核显虚拟化SR-IOV

PVE内核版本:6.8.12-4-pve

建议操作前更新一次源

apt update -y

安装必要的软件包

 
apt install build-* dkms git sysfsutils -y

安装所需版本的内核和头文件

 
apt install proxmox-headers-$(uname -r) proxmox-kernel-$(uname -r)

以下建议在home目录执行,所以现切换到home目录

 
cd ~

拉取最新i915-sriov-dkms

 
git clone https://github.com/strongtz/i915-sriov-dkms.git

进入i915-sriov-dkms目录

 
cd ~/i915-sriov-dkms

将当前目录中的内核模块添加到DKMS

 
dkms add .

添加完成后可以在/usr/src/目录看到已经添加进来的内核模块i915-XXXX

编译并安装该模块

 
dkms install i915-sriov-dkms/2025.02.03

执行以下命令,确认显卡ID是不是00:02.0

 
lspci | grep VGA
PVE8 上启用 12 代 Intel CPU 核显 SR-IOV_图示-b8a13c9149584f74b5e1d256c95cb1c9.png

 确认后,调整内核命令行

nano /etc/default/grub

把GRUB_CMDLINE_LINUX_DEFAULT 的参数值改成 intel_iommu=on i915.enable_guc=3 i915.max_vfs=7 module_blacklist=xe

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

这里要注意,如果要虚拟成7个核显,则i915.max_vfs=7;如果要虚拟成3个核显,则i915.max_vfs=3

PVE8 上启用 12 代 Intel CPU 核显 SR-IOV_图示-95bd5a14904e4b7a8fe312d4c8a112b2.png

 

更新grub和initramfs

update-grub
update-initramfs -u

建议再补充执行一次

pve-efiboot-tool refresh

启用VFs

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

#注意,这里的sriov_numvfs = X"必须与上一步的i915.max_vfs=X 数值相同

如果你的显卡ID不是00:02.0,则也需要做相应的调整

重启PVE后执行

lspci | grep VGA

你就可以看到虚拟化的核显已经出现

PVE8 上启用 12 代 Intel CPU 核显 SR-IOV_图示-8000fa3d40a3476ea6163f44f33d5af9.png

 

最后,你就能通过VFs到LXCs或VMs。

切勿将00.02.0那个物理GPU / PF传递给VM,这会使所有其他VF崩溃。

 

官方指导

Linux i915 driver (dkms module) with SR-IOV support for linux 6.8-6.15(-rc5)

This repo is a code snapshot of the i915 module from https://github.com/intel/mainline-tracking/tree/linux/v6.12 and will randomly merge patches from the linux-stable tree.

Warning

This package is highly experimental, you should only use it when you know what you are doing.

You need to install this dkms module in both host and guest!

Tested kernel versions: 6.12.10-zen1/6.11.9-arch1/6.10.9-arch1/6.9.10-arch1/6.8.9-arch1 with ArchLinux

Required Kernel Parameters

intel_iommu=on i915.enable_guc=3 i915.max_vfs=7 module_blacklist=xe
 

Besides intel_iommu=on, the other 3 parameters could be applied by modprobe by putting following content to /etc/modprobe.d/i915-sriov-dkms.conf

blacklist xe
options i915 enable_guc=3
options i915 max_vfs=7
 

Creating Virtual Functions (VF)

echo 1 > /sys/devices/pci0000:00/0000:00:02.0/sriov_numvfs
 

You can create up to 7 VFs on Intel UHD Graphics

Arch Linux Installation Steps (Tested Kernel 6.12.6-zen1)

For Arch Linux users, it is available in AUR. i915-sriov-dkms

You also can download the package from the releases page and install it with pacman -U.

PVE Host Installation Steps (Tested Kernel 6.8)

  1. Install build tools: apt install build-* dkms
  2. Install the kernel and headers for desired version: apt install proxmox-headers-6.8 proxmox-kernel-6.8 (for unsigned kernel).
  3. Download deb package from the releases page

    wget -O /tmp/i915-sriov-dkms_2025.05.18_amd64.deb "https://github.com/strongtz/i915-sriov-dkms/releases/download/2025.05.18/i915-sriov-dkms_2025.05.18_amd64.deb"
     
  4. Install the deb package with dpkg: dpkg -i /tmp/i915-sriov-dkms_2025.05.18_amd64.deb
  5. Once finished, the kernel commandline needs to be adjusted: nano /etc/default/grub and change GRUB_CMDLINE_LINUX_DEFAULT to intel_iommu=on i915.enable_guc=3 i915.max_vfs=7 module_blacklist=xe, or add to it if you have other arguments there already.
  6. Update grub and initramfs by executing update-grub and update-initramfs -u
  7. Optionally pin the kernel version and update the boot config via proxmox-boot-tool.
  8. In order to enable the VFs, a sysfs attribute must be set. Install sysfsutils, then do echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 7" > /etc/sysfs.conf, assuming your iGPU is on 00:02 bus. If not, use lspci | grep VGA to find the PCIe bus your iGPU is on.
  9. Reboot the system.
  10. When the system is back up again, you should see the number of VFs under 02:00.1 - 02:00.7. Again, assuming your iGPU is on 00:02 bus.
  11. You can passthrough the VFs to LXCs or VMs. However, never pass the PF (02:00.0) to VM which would crash all other VFs.

Linux Guest Installation Steps (Tested Ubuntu 24.04/Kernel 6.8)

We will need to run the same driver under Linux guests.

  1. Install build tools

    apt install build-* dkms linux-headers-$(uname -r) linux-modules-extra-$(uname -r)
    
     
  2. Download and install the .deb

    wget -O /tmp/i915-sriov-dkms_2025.05.18_amd64.deb "https://github.com/strongtz/i915-sriov-dkms/releases/download/2025.05.18/i915-sriov-dkms_2025.05.18_amd64.deb"
    dpkg -i /tmp/i915-sriov-dkms_2025.05.18_amd64.deb
    
     
  3. Update kernel parameters nano /etc/default/grub and change GRUB_CMDLINE_LINUX_DEFAULT to i915.enable_guc=3 module_blacklist=xe, or add to it if you have other arguments there already.

    Example:

    GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on i915.enable_guc=3 module_blacklist=xe"
    
     
  4. Once that's done, update grub and initramfs, then reboot.

    update-grub
    update-initramfs -u
    
     
  5. Once the VM is back up again, do dmesg | grep i915 to see if your VF is recognized by the kernel. You should also check if xe is blacklisted correctly by running lspci -nnk to see which driver is in use by the VF.

  6. Optionally, install vainfo by running apt install vainfo, then do vainfo to see if the iGPU has been picked up by the VAAPI.

  7. If OpenCL is desired:

    apt install intel-opencl-icd
    apt install clinfo
    clinfo
    
     

Windows Guest (Tested with Proxmox 8.3 + Windows 11 24H2 + Intel Driver 32.0.101.6460/32.0.101.6259)

Thanks for resiliencer and his contribution in #225.

These steps ensure compatibility across all driver versions. In theory you can install any version and won't be hit by the dreaded Code 43.

Extract Graphics EFI Firmware

  1. Download UEFITools (UEFITool_NE_A68_win64 for Windows. They supply Linux and Mac binaries, too)
  2. Download BIOS for motherboard (I suspect any motherboard BIOS would work as long as it is for Alder/Raptop Lake Desktop Platform)
  3. Unzip BIOS
  4. Use UEFITools (Run as Admin) to load the BIOS (usually .cap)
  5. Go to Action - Search or use keyboard shortcut ctrl+F and search for Hex string 49006e00740065006c00280052002900200047004f0050002000440072006900760065007200
  6. Double click the search result in the search column, it will highlight the item found within the BIOS.
  7. Right click on the highlighted result and Extract body...
  8. Save the file, file name and extension do not matter. I used intelgopdriver_desktop and it would save as intelgopdriver_desktop.bin.
  9. You can also compare the checksum of the file:
    1. Windows Terminal Command: Get-FileHash -Path "path-to-rom" -Algorithm SHA256
    2. For desktop with UHD730 and UHD770: 131c32cadb6716dba59d13891bb70213c6ee931dd1e8b1a5593dee6f3a4c2cbd
    3. For ADL-N: FA12486D93BEE383AD4D3719015EFAD09FC03352382F17C63DF10B626755954B
  10. You'll need to copy this file to /usr/share/kvm directory on Proxmox host. I uploaded it to a NAS and downloaded it with wget.

Windows VM Creation

  1. When setting up the machine, set CPU as host.
  2. TIPS: You can skip the Microsoft Account setup by pressing Shift+F10 at the first setup screen and type OOBE\BYPASSNRO. The VM will reboot, and you can choose "I don't have Internet" option to set up a local account. Alternatively, you can remove the network device from the Windows VM.
  3. When the setup process is done and you are at the Desktop, enable Remote Desktop and make sure your local account user has access. You can shut down the VM for now.
  4. When the VM powered off, edit the configuration file:```
# Passing the 02.1 VF, specify the romfile. ROM path is relative

hostpci0: 0000:00:02.1,pcie=1,romfile=Intelgopdriver_desktop.efi,x-vga=1
 
  1. In the Hardware tab, set Display to none.
  2. Start the VM. You won't be able to access it with console, so your only way in is Remote Desktop. Once you are in, download the graphics driver from Intel, any version should work.
  3. During install, you may experience black screen when the actual graphics drivers are being installed and applied. This black screen will persist until you restart the VM. My advice is give it a few minutes to do its thing. You can make your best judgement by looking at the VM CPU usage in Proxmox.
  4. After rebooting, connect with RDP once again. Go to Device Manager and verify the result. You should see the Intel Graphics is installed and working.
PVE8 上启用 12 代 Intel CPU 核显 SR-IOV_图示-d9ff79a480dd40f9979ade0e2ee3f4f9.png

See also: #8 (comment)

Manual Installation Steps

  1. Install build tools: apt install build-essential dkms git / pacman -S base-devel dkms git.
  2. Install the kernel and headers for desired version: apt install linux-headers-$(uname -r) / pacman -S linux-headers.
  3. Clone the repository: git clone https://github.com/strongtz/i915-sriov-dkms.git.
  4. Add the module to DKMS: dkms add ./i915-sriov-dkms.
  5. Install the module with DKMS: dkms install i915-sriov-dkms/2025.05.18.
  6. Once finished, the kernel commandline needs to be adjusted: nano /etc/default/grub and change GRUB_CMDLINE_LINUX_DEFAULT to intel_iommu=on i915.enable_guc=3 i915.max_vfs=7, or add to it if you have other arguments there already.
  7. Update grub and initramfs by executing update-grub and update-initramfs -u / for Arch Linux grub-mkconfig -o /boot/grub/grub.cfg and mkinitcpio -P.
  8. Optionally use sysfsutils to set the number of VFs on boot. Install sysfsutils, then do echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 7" > /etc/sysfs.conf, assuming your iGPU is on 00:02 bus. If not, use lspci | grep VGA to find the PCIe bus your iGPU is on.
  9. Reboot the system.

Uninstallation

dpkg

Remove the package with dpkg -P i915-sriov-dkms

pacman

Remove the package with pacman -R i915-sriov-dkms

manual

Remove the dkms module with dkms remove i915-sriov-dkms/2025.05.18

 

GitHub连接:GitHub - strongtz/i915-sriov-dkms: dkms module of Linux i915 driver with SR-IOV support

 


评论
User Image
提示:请评论与当前内容相关的回复,广告、推广或无关内容将被删除。

相关文章
由于折腾,购入了一个联想1L小主机M710Q,主板自带的板载网卡Intel I219-v网卡。安装PVE虚拟平台的时候在硬件检查的时候总是提示没有网卡,通过查询资料得知,绝大多数发行版Linux...
i219-v 刷i219-lm 解决Linux下i219-v无法驱动问题。最近购入了一个联想的1L小主机M710Q,准备安装pve,却发现无法驱动有线网卡,故有
Intel Core I3 4130对比I3 4130T,标准版与节能版区别对比,Intel Core I3 4130对比I3 4130T区别优缺,i3 4130T
proxmox VE(PVE) 虚拟机CPU睿频问题最近搭建了一颗I7 8700T ES@1.6GHz(睿频3.6GHz) CPU的PVE平台。在pve上安装了window 10 (CPU是以H...
概述pve 在Windows环境下使用VMware练手教程 VMware虚拟机创建 创建虚拟机一路到最后即可,系统选择Linux,虚拟机配置参考然后就是有个cp
PVE软件源更换禁用pve企业源mv/etc/apt/sources.list.d/pve-enterprise.list/etc/apt/sources.list.d/pve-enterpri...
PVE 添加新硬盘-PVE将新硬盘添加为存储首先登录pve控制台,选中pve设备下面的磁盘磁盘查看磁盘点击后可以在右侧看到目前链接刀pve的硬盘数量。
PVE 7.x更换国内源备份之前的cp /etc/apt/sources.list.d/pve-install-repo.list /root删除企业源rm /etc/apt/sources.l...
概述模拟pve系统盘挂了,恢复数据盘环境说明pve 版本8.4.1测试环境为VMware虚拟机内部虚拟机配置:CPU 4核内存 8GB硬盘1:100G (系统盘
效果图参考服务配置编辑文件 /usr/share/perl5/PVE/API2/Nodes.pm 跳转到 my $dinfo =位置,编辑成如下所示
PVE 7显示CPU温度工具准备xshell 或者其他ssh工具xftp 或者其他ftp工具notepad++或者其他文本编辑工具 需要修改以下两个文件/usr/share/pve-manage...
准备工具UEFITool-0.28.0WinHex_v20.3_SR-2_x86_x64BIOS.bin(已经魔改好的bios文件)提取网卡模块使用UEFITo
前言这里扩容的情况分为两种第一是:PVE系统之前安装到U盘,后面想安装到硬盘通过克隆将U盘上面的信息克隆到了硬盘,这导致硬盘大于U盘外的容量无法使用
not a valid block device/错误很多人觉得 PVE 复杂的原因主要就是因为 PVE 有很多操作需要用命令去完成,就比如上面这个删除失效存储
PVE 安装黑群晖6.x一 PVE安装黑群晖准备Proxmox VE虚拟环境(以下简称PVE)黑群晖引导(这里用的DSM 6.17版本)群晖系统官方文件DS3617_6.17-15284.pat...