You are not logged in.

#1 2020-10-19 13:52:52

miomio
Member
Registered: 2016-01-17
Posts: 167

[SOLVED] GVT-g libvirt qemu error "EGL_MESA_image_dma_bug_export"

I'm having three repeating errors running a Win VM via libvirt:

  • OpenGL not supported by the display

  • Failed to initialize EGL render node for SPICE GL

  • kvm_init_vcpu failed: Function not implemented

I begin with the following appended to my libvirt VM XML config:

  <qemu:commandline>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.x-igd-opregion=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.display=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.ramfb=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.driver=vfio-pci-nohotplug"/>
    <qemu:arg value="-display"/>
    <qemu:arg value="gtk,gl=on"/>
    <qemu:env name="DISPLAY" value=":0"/>
    <qemu:env name="GDK_SCALE" value="1.0"/>
    <qemu:env name="MESA_LOADER_DRIVER_OVERRIDE" value="i915"/>
  </qemu:commandline>

I fix the first error with `xhost si:localuser:nobody`, but this results in the second error. Full trace:

Error starting domain: internal error: qemu unexpectedly closed the monitor: 2020-10-19T13:23:25.411916Z qemu-system-x86_64: egl: EGL_MESA_image_dma_buf_export not supported
2020-10-19T13:23:25.411959Z 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 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 101, 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 1330, in startup
    self._backend.create()
  File "/usr/lib/python3.8/site-packages/libvirt.py", line 1334, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2020-10-19T13:23:25.411916Z qemu-system-x86_64: egl: EGL_MESA_image_dma_buf_export not supported
2020-10-19T13:23:25.411959Z qemu-system-x86_64: Failed to initialize EGL render node for SPICE GL

According to https://www.mail-archive.com/qemu-devel … 04013.html I have to use 'egl-headless' and 'gl=off', so I edit the XML to:

  <qemu:commandline>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.x-igd-opregion=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.display=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.ramfb=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.driver=vfio-pci-nohotplug"/>
    <qemu:arg value="-display"/>
    <qemu:arg value="egl-headless"/>
    <qemu:arg value="-spice"/>
    <qemu:arg value="gl=off"/>
    <qemu:env name="DISPLAY" value=":0"/>
    <qemu:env name="GDK_SCALE" value="1.0"/>
    <qemu:env name="MESA_LOADER_DRIVER_OVERRIDE" value="i915"/>
  </qemu:commandline>

(note: where does the 'gtk' argument go?)

But this then results in the third error. Full trace:

Error starting domain: internal error: qemu unexpectedly closed the monitor: Hyper-V synthetic interrupt controller (hv-synic) requires Hyper-V VP_INDEX MSR (hv-vpindex)
2020-10-19T13:39:03.846456Z qemu-system-x86_64: kvm_init_vcpu failed: Function not implemented

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 101, 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 1330, in startup
    self._backend.create()
  File "/usr/lib/python3.8/site-packages/libvirt.py", line 1334, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: Hyper-V synthetic interrupt controller (hv-synic) requires Hyper-V VP_INDEX MSR (hv-vpindex)
2020-10-19T13:39:03.846456Z qemu-system-x86_64: kvm_init_vcpu failed: Function not implemented

Have you run into this problem before? Would you share your solution?

(I have already fully installed Win in the VM, installed SPICE win guest binary, and shut down the VM. I'm now trying to switch over to vGPU.)

Last edited by miomio (2020-10-19 18:38:46)

Offline

#2 2020-10-19 17:30:43

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: [SOLVED] GVT-g libvirt qemu error "EGL_MESA_image_dma_bug_export"

No matter the different options I re-arrange, libvrt keeps coming back around to EGL_MESA_image_dma_bug_export related error. Found some info on it here https://www.khronos.org/registry/EGL/ex … export.txt and an explanation from 5 years ago about what its function https://qemu-devel.nongnu.narkive.com/m … -detection

Testing suggestions here https://bugzilla.redhat.com/show_bug.cgi?id=1628892

EDIT:

OK, may be getting somewhere now. I have dropped spice-gtk, and pursuing configuration via egl-headless. Also update acl in /etc/libvirt/qemu.conf per the last URL I referenced.

So XML now has:

    <graphics type="egl-headless">
      <gl rendernode="/dev/dri/by-path/pci-0000:00:02.0-render"/>
    </graphics>
...
  <qemu:commandline>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.x-igd-opregion=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.display=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.ramfb=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.driver=vfio-pci-nohotplug"/>
    <qemu:arg value="-display"/>
    <qemu:arg value="gtk,gl=on"/>
    <qemu:env name="DISPLAY" value=":0"/>
    <qemu:env name="GDK_SCALE" value="1.0"/>
    <qemu:env name="MESA_LOADER_DRIVER_OVERRIDE" value="i915"/>
  </qemu:commandline>

This then generates a lot of ALSA related errors but no error about EGL_MESA_image_dma_bug_export or dma related, so assuming progress. Solving most of the ALSA errors with:

    <qemu:env name="QEMU_AUDIO_DRV" value="pa"/>
    <qemu:env name="QEMU_PA_SERVER" value="/run/user/1000/pulse/native"/>

Leaving behind a connection refusal from pulseaudio. Following the wiki to update qemu.conf https://wiki.archlinux.org/index.php/Libvirt#PulseAudio

Testing...

EDIT:

Updated /etc/libvirt/qemu.conf with my $USER per the wiki, which results in another error:

Error starting domain: internal error: process exited while connecting to monitor: No protocol specified
Unable to init server: Could not connect: Connection refused
2020-10-19T18:11:20.384474Z qemu-system-x86_64: OpenGL is not supported by the display

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 101, 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 1330, in startup
    self._backend.create()
  File "/usr/lib/python3.8/site-packages/libvirt.py", line 1334, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: process exited while connecting to monitor: No protocol specified
Unable to init server: Could not connect: Connection refused
2020-10-19T18:11:20.384474Z qemu-system-x86_64: OpenGL is not supported by the display

Found a posted bug https://bugs.archlinux.org/task/66168 but the reporter describes closing the case due to having realised s/he made a mistake in their config, however doesn't describe what the mistake was.

EDIT:

I changed qemu.conf to run under my $USER so I do `xhost +`. Error now reports OpenGL required:

Error starting domain: internal error: qemu unexpectedly closed the monitor: No provider of glGetShaderiv found.  Requires one of:
    Desktop OpenGL 2.0
    OpenGL ES 2.0

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 101, 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 1330, in startup
    self._backend.create()
  File "/usr/lib/python3.8/site-packages/libvirt.py", line 1334, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: No provider of glGetShaderiv found.  Requires one of:
    Desktop OpenGL 2.0
    OpenGL ES 2.0

But I'm using OpenGL:

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Version: 20.2.0
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 520 (SKL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.2.0
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.2.0
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.2.0
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
    GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix, 

So, I'll sleep on it.

EDIT:

Needed to remove the MESA_LOADER_DRIVER_OVERRIDE line and VM works.

Last edited by miomio (2020-10-19 18:32:39)

Offline

Board footer

Powered by FluxBB