intel / gvt-linux

Other
509 stars 95 forks source link

GVT-g Ubuntu 20.04. #227

Closed zombielinux closed 1 year ago

zombielinux commented 1 year ago

I previously followed the Archlinux wiki page to get GVT-g functioning on my Dell Precision 5540.

I'm running Ubuntu 20.04 Kernel: 5.15.0-67-generic Kernel boot line: BOOT_IMAGE=/vmlinuz-5.15.0-67-generic root=/dev/mapper/vgubuntu-root ro quiet splash intel_iommu=on i915.enable_gvt=1 i915.enable_guc=0 kvm.ignore_msrs=1 mem_sleep_default=deep vt.handoff=7 libvirtd: 6.0.0 qemu-system-x86_64: 4.2.1

At some point between now and May of last year, the installation no longer functioned and fails with the cryptic message

Error starting domain: internal error: qemu unexpectedly closed the monitor: 2023-03-20T20:27:09.549017Z qemu-system-x86_64: -device vfio-pci,id=hostdev0,sysfsdev=/sys/bus/mdev/devices/1a9995f6-f772-47c6-ae1e-85bef9bc604b,display=on,bus=pci.9,addr=0x0: vfio 1a9995f6-f772-47c6-ae1e-85bef9bc604b: vfio-display-dmabuf: opengl not available
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
    self._backend.create()
  File "/usr/lib/python3/dist-packages/libvirt.py", line 1234, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2023-03-20T20:27:09.549017Z qemu-system-x86_64: -device vfio-pci,id=hostdev0,sysfsdev=/sys/bus/mdev/devices/1a9995f6-f772-47c6-ae1e-85bef9bc604b,display=on,bus=pci.9,addr=0x0: vfio 1a9995f6-f772-47c6-ae1e-85bef9bc604b: vfio-display-dmabuf: opengl not available

dmesg doesn't show anything being "DENIED"

systemctl status libvirtd shows

Mar 20 16:27:09 $HOST libvirtd[2729]: internal error: qemu unexpectedly closed the monitor: Connection reset by peer
Mar 20 16:27:09 $HOST libvirtd[2729]: internal error: qemu unexpectedly closed the monitor: 2023-03-20T20:27:09.549017Z qemu-system-x86_64: -device vfio-pci,id=hostdev0,sysfsdev=/sys/bus/mdev/devices/1a9995f6-f772-47c6-ae1e-85bef9bc604b,display=on,bus=pci.9,addr=0x0: vfio 1a9995f6-f772-47c6-ae1e-85bef9bc604b: vfio-display-dmabuf: opengl not available

1a9995f6-f772-47c6-ae1e-85bef9bc604b is the UUID of my GVT-g device. /sys/bus/pci/devices/0000\:00\:02.0/1a9995f6-f772-47c6-ae1e-85bef9bc604b/ is present and a valid path owned by root:root

Curiously, /sys/bus/pci/devices/0000\:00\:02.0/1a9995f6-f772-47c6-ae1e-85bef9bc604b/driver points to /sys/bus/mdev/drivers/vfio_mdev but I vaguely recall that being reincorporated somewhere else. Trying to modprobe vfio_mdev yeilds modprobe: FATAL: Module vfio_mdev not found in directory /lib/modules/5.15.0-67-generic

At this point, I've tugged on all the threads I can think of.

zombielinux commented 1 year ago

A bit more digging shows the vfio_mdev.ko module was last built properly into the kernel at 5.13.0.52-generic.

zombielinux commented 1 year ago

The solution. View the example config here: https://github.com/libvirt/libvirt/blob/master/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml

I was missing:

    <graphics type='egl-headless'>
      <gl rendernode='/dev/dri/renderD128'/>
    </graphics>