When enabling use of the Nvidia driver (services.xserver.videoDrivers = [ "nvidia" ]
) I lose the ability to use OpenGL for my libvirt guests; the option to enable opengl, via virt-manager
, is there but the guest VM will fail to start. It looks like libvirt is trying to use the wrong driver and unable to find it, but it’s not clear why it isn’t looking for the Nvidia driver or how I can force it to do so.
Error seen when attempting to run a guest with OpenGL enabled while the host is using Nvidia driver:
Error starting domain: internal error: process exited while connecting to monitor: MESA-LOADER: failed to open nouveau (search paths /run/opengl-driver/lib/dri)
failed to load driver: nouveau
MESA-LOADER: failed to open kms_swrast (search paths /run/opengl-driver/lib/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast (search paths /run/opengl-driver/lib/dri)
failed to load swrast driver
2020-05-12T15:45:34.599799Z qemu-system-x86_64: egl: gbm_create_device failed
2020-05-12T15:45:34.599826Z qemu-system-x86_64: Failed to initialize EGL render node for SPICE GL
Traceback (most recent call last):
File "/nix/store/9zmil5nqrjscy75cgh498d2cjh21w84w-virt-manager-2.2.1/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/nix/store/9zmil5nqrjscy75cgh498d2cjh21w84w-virt-manager-2.2.1/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
callback(*args, **kwargs)
File "/nix/store/9zmil5nqrjscy75cgh498d2cjh21w84w-virt-manager-2.2.1/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
ret = fn(self, *args, **kwargs)
File "/nix/store/9zmil5nqrjscy75cgh498d2cjh21w84w-virt-manager-2.2.1/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
self._backend.create()
File "/nix/store/vnzr628n5rdgd9mggj9f4vqqq5jla1vn-python3.7-libvirt-6.1.0/lib/python3.7/site-packages/libvirt.py", line 1234, in create
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: internal error: process exited while connecting to monitor: MESA-LOADER: failed to open nouveau (search paths /run/opengl-driver/lib/dri)
failed to load driver: nouveau
MESA-LOADER: failed to open kms_swrast (search paths /run/opengl-driver/lib/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast (search paths /run/opengl-driver/lib/dri)
failed to load swrast driver
2020-05-12T15:45:34.599799Z qemu-system-x86_64: egl: gbm_create_device failed
2020-05-12T15:45:34.599826Z qemu-system-x86_64: Failed to initialize EGL render node for SPICE GL
This is not an issue if I disable the Nvidia driver and use nouveau.
Any thoughts on where I’ve gone wrong, or what I can try, are appreciated.
I believe all relevant configuration is in this post, but my config is available on GitHub if that’s useful.