GL accelerated spice with egl-headless display in qemu?

I’ve got this:

    <graphics type='spice'>
      <listen type='none'/>
    </graphics>
    <graphics type='egl-headless'>
      <gl rendernode='/dev/dri/renderD128'/>
    </graphics>
    <video>
      <model type='virtio' heads='1' primary='yes'>
        <acceleration accel3d='yes'/>
      </model>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>

To use my nvidia gpu for virgl in my qemu vm in libvirt. And it works (so long as the nvidia rendering device is listed in cgroups).

However that’s somewhat of a moot point because I cannot enable 3d acceleration for spice.

So even if my virgl performance is better, it’s a bit of a moot point if spice isn’t gl enabled because it makes viewing anyting in the VM laggy as hell.

Is there any way around this issue?

I tried this:

<graphics type="spice">
  <listen type="none"/>
  <gl enable="yes" rendernode="/dev/dri/renderD128"/>
</graphics>

But it didn’t work (probably cuz it’s not an egl-headless type).

I don’t mind if the spice hardware acceleration uses my igpu instead of my nvidia gpu but it doesn’t seem possible to set that up either.