我正在尝试让 3D 加速在 virt-manager 中运行,但无论我在 virt-manager 中使用什么客户端,如果我启用 3D 加速,我收到这个错误。
在错误的详细信息中,有以下内容:
Error starting domain: internal error: process exited while connecting to monitor: 2023-04-14T06:53:32.967256Z qemu-system-x86_64: egl: eglInitialize failed
2023-04-14T06:53:32.967390Z qemu-system-x86_64: Failed to initialize EGL render node for SPICE GL
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
ret = fn(self, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1384, in startup
self._backend.create()
File "/usr/lib/python3/dist-packages/libvirt.py", line 1353, in create
raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2023-04-14T06:53:32.967256Z qemu-system-x86_64: egl: eglInitialize failed
2023-04-14T06:53:32.967390Z qemu-system-x86_64: Failed to initialize EGL render node for SPICE GL
以下是我为 virt-manager 实例配置的设置:
视频:
<video>
<model type="virtio" heads="1" primary="yes">
<acceleration accel3d="yes"/>
</model>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>
图形类型:
<graphics type="spice">
<listen type="none"/>
<image compression="off"/>
<gl enable="yes" rendernode="/dev/dri/by-path/pci-0000:05:00.0-render"/>
</graphics>
是什么egl: eglInitialize failed
意思Failed to initialize EGL render node for SPICE GL
?如何修复此错误?为什么会发生这种情况?我是否遗漏了重要信息?
为了确认,我已经使用以下命令检查了是否在 GRUB 中启用了虚拟化功能grep CMDLINE_LINUX_DEFAULT /etc/default/grub
,结果是:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt splash"
我用于主机的 GPU 是 NVIDIA GeForce GTX 950,安装了最新的专有 nvidia 驱动程序。这是我唯一的 GPU。
我甚至尝试过跑步DRI_PRIME=1 virt-manager
,但没有效果。
我甚至看过这里,但该解决方案不起作用。
如何使 3D 加速在 virt-manager 中运行?