Linux KVM qemu 12代CPU 开启核显虚拟化
关键词:SRIOV KVM QEMU IGPU
20230917
https://www.michaelstinkerings.org/gpu-virtualization-with-intel-12th-gen-igpu-uhd-730/
升级内核到6.2
sh uname -sr # https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.2/ # 下载amd64 4个deb sudo dpkg -i *.deb reboot uname -sr Linux 6.2.0-060200-generic
安装 dkms & 依赖
sh apt update && apt upgrade -y apt install build-* dkms sysfsutils
安装 dkms_i915_sriov
```sh cd Github/ git clone https://github.com/strongtz/i915-sriov-dkms.git cd i915-sriov-dkms/ # 更改配置 包名 & 版本 cat dkms.conf PACKAGE_NAME="i915-sriov-dkms" PACKAGE_VERSION="6.2"
MAKE[0]="make -j$(nproc) -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build KVER=${kernelver}" CLEAN="make -j$(nproc) -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build KVER=${kernelver} clean"
BUILT_MODULE_NAME[0]="i915" DEST_MODULE_LOCATION[0]=/kernel/drivers/gpu/drm/i915
AUTOINSTALL=yes
# 创建 包名+版本的文件夹 sudo mkdir /usr/src/i915-sriov-dkms-6.2 sudo cp -r * /usr/src/i915-sriov-dkms-6.2/ cd /usr/src/i915-sriov-dkms-6.2/ # 安装模块 包名+版本 sudo dkms install -m i915-sriov-dkms -v 6.2 # 查看 dkms status ```
配置 gurb
```sh sudo vim /etc/default/grub ''' GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on i915.enable_guc=3 i915.max_vfs=7" '''
cat /proc/cmdline sudo update-grub sudo update-initramfs -u
# 报错了,记录一下,问题不大,以后有了这个文件补全吧 catcher@catcher /u/s/i915-sriov-dkms-6.2> sudo update-initramfs -u update-initramfs: Generating /boot/initrd.img-6.2.0-060200-generic W: Possible missing firmware /lib/firmware/i915/dg2_huc_gsc.bin for module i91
cd /lib/firmware/i915/ sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/i915/dg2_huc_gsc.bin sudo update-initramfs -u ```
开启 VFs
sh lspic | grep VGA 00:02.0 VGA compatible controller: Intel Corporation Device 4692 (rev 0c) # sysfs echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 7" > /etc/sysfs.conf reboot sudo 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)
虚拟机添加vfs
linux
windows
win10 LTSC 成功 win11失败
分配VF
下载驱动
使用远程桌面连接
AI小值-电脑数码
校验提示文案
电器狂友
校验提示文案
电器狂友
校验提示文案
AI小值-电脑数码
校验提示文案