收起左侧

虚拟显卡 开启iommu 解决报错43

0
回复
141
查看
[ 复制链接 ]

1

主题

0

回帖

0

牛值

江湖小虾

2025-8-28 11:07:49 显示全部楼层 阅读模式

搞了好久 大概说一下思路
先搞定iommu 再搞驱动
虚拟机里面的 iommu要已开启
我是华硕h610m
开Control IOMMU Pre-boot Behavior
vtd
Above 4G Decoding
SR-IOV Support
关Network stack(关闭网络uefi启动 加快开机自检)
搞完去系统看还是未开启 就要用ssh改配置
打开cmd
ssh admin@192.168.2.254(admin-你的账户名 后面的是你的地址)
输入密码 显示admin@xxx:~$时为成功(xxx为nas名)
输入sudo -i
输入密码 显示root@xxx:时为成功(xxx为nas名)
输入nano /etc/default/grub
显示一个界面
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
改成GRUB_CMDLINE_LINUX_DEFAULT="quiet i915.force_probe=7d55 intel_iommu=on iommu=pt i915.enable_guc=3 i915.max_vfs=7"
按ctrl+x 按y 按确认
然后跳转回root@xxx:为成功
输入update-grub
输入update-initramfs -u -k all
可能提示缺少rtl8126a-2和3.fw
去谷歌下一个然后用命令放进去
(cp /tmp/rtl8126a-2.fw /usr/lib/firmware/rtl_nic--将什么文件放到什么目录)
再执行update-initramfs -u -k all
然后重启
iommu应该就开了

接下来修驱动
应用中心下载i915-sriov-dkms(我是13代u uhd730其他的自行找驱动 但是大差不差)
重启
进root 查pci设备
输入lspci
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-S GT1 [UHD Graphics 730]
这个就是你的显卡
如果只有1个就说明还没虚拟化完成
输入 lspci -nnk 00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-S GT1 [UHD Graphics 730] [8086:4692] (rev 0c)
DeviceName: Onboard - Video
Subsystem: ASUSTeK Com**r Inc. Alder Lake-S GT1 [UHD Graphics 730] [1043:8694]
Kernel driver in use: i915
Kernel modules: i915
这个就是驱动成功并虚拟化的样子 一共有8个

遇到的问题
直通未虚拟化的显卡(显示代码43)
直通虚拟化成功并装驱动的显卡(开机自动装驱动 没有感叹号 在任务管理器可看到显卡)
虚拟机模板选win显示代码43(改Linux)
如果更新软件速度为0或者错误(改软件源或者挂墙 是路由器挂墙那种)

感谢教程
https://www.bilibili.com/video/BV134Fce5EQq/
https://packages.debian.org/sid/all/firmware-realtek/filelist
https://zhuanlan.zhihu.com/p/1907812673627877496
https://club.fnnas.com/forum.php?mod=viewthread&tid=20974&highlight=
https://github.com/strongtz/i915-sriov-dkms

收藏
送赞
分享
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则