Skip to contentSkip to conversation

VirtIO-GPU 3D OpenGL Hardware Acceleration for VMs and Xen

DISCUSSION Pasi Kärkkäinen 3 participants 5 messages Nov 16, 2015 – Jan 11, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

It seems upstream Linux/Gallium3D/Mesa/Qemu/KVM has recently gained virtualized support for 3D/OpenGL hardware acceleration in VMs, allowing using the GPU of the host in VMs.

Components:
- Linux 4.4 kernel includes the DRM driver for VirtIO-GPU 3D acceleration (needed in the VM).
- Qemu 2.5 (rc0) includes the VirtIO-GPU 3D mode support (needed on the host/dom0).
- Gallium3D VirGL driver is included in Mesa git (needed in the VM, supports up to OpenGL 3.3 atm).
- On the host/dom0 one needs *any* OpenGL driver (for the host GPU obviously), no special requirements there, if I understood correctly.

Has someone looked into this already? How much work would it be to get VirtIO-GPU working in Xen HVM guests?

Thanks,

-- Pasi

#1 lore raw
Quoted 4 lines · Pasi Kärkkäinen

Hello,

It seems upstream Linux/Gallium3D/Mesa/Qemu/KVM has recently gained virtualized support for 3D/OpenGL hardware acceleration in VMs, allowing using the GPU of the host in VMs.

Quoted 8 lines

Components:
- Linux 4.4 kernel includes the DRM driver for VirtIO-GPU 3D acceleration (needed in the VM).
- Qemu 2.5 (rc0) includes the VirtIO-GPU 3D mode support (needed on the host/dom0).
- Gallium3D VirGL driver is included in Mesa git (needed in the VM, supports up to OpenGL 3.3 atm).
- On the host/dom0 one needs *any* OpenGL driver (for the host GPU obviously), no special requirements there, if I understood correctly.

Has someone looked into this already? How much work would it be to get VirtIO-GPU working in Xen HVM guests?

Are there any instructions on how to make this work? Looks like:
CONFIG_DRM_VIRTIO_GPU needs to be set.

In the host/dom0 one would need to get the latest version of QEMU for build (easy, just change the Config.mk to point to the upstream qemu repo)

And then the syntax in the guest. I presume that 'sdl=1\nopengl=1' would need to be set and also some of device_model_args_hvm=XX magic.

That 'XX' magic should be whatever is needed for QEMU to expose this VirtIO driver?

Looking at https://www.kraxel.org/blog/tag/virtio-gpu/

It looks to be: -set device.video0.driver=virtio-vga -display gtk,gl=on ?

Quoted 11 lines

Thanks,

-- Pasi

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
In reply to Pasi Kärkkäinen

Hello,

And now all the components listed below are released and available easily.

Dom0:
- Qemu 2.5 has virtio-gpu 3D/OpenGL acceleration support for VMs.

DomU:
- Linux 4.4 kernel has the virtio-gpu drm driver.
- Mesa 11.1 has the virtio-gpu 3D driver (virgl galliumd3 / OpenGL).

Did anyone try this stuff with Xen already? :)

-- Pasi

Quoted 18 lines · Pasi Kärkkäinen

Hello,

It seems upstream Linux/Gallium3D/Mesa/Qemu/KVM has recently gained virtualized support for 3D/OpenGL hardware acceleration in VMs, allowing using the GPU of the host in VMs.

Components:
- Linux 4.4 kernel includes the DRM driver for VirtIO-GPU 3D acceleration (needed in the VM).
- Qemu 2.5 (rc0) includes the VirtIO-GPU 3D mode support (needed on the host/dom0).
- Gallium3D VirGL driver is included in Mesa git (needed in the VM, supports up to OpenGL 3.3 atm).
- On the host/dom0 one needs *any* OpenGL driver (for the host GPU obviously), no special requirements there, if I understood correctly.

Has someone looked into this already? How much work would it be to get VirtIO-GPU working in Xen HVM guests?

Thanks,

-- Pasi

#3 lore raw

Il 11/01/2016 10:47, Pasi Kärkkäinen ha scritto:

Quoted 7 lines

Hello,

And now all the components listed below are released and available easily.

Dom0:
- Qemu 2.5 has virtio-gpu 3D/OpenGL acceleration support for VMs.

Quoted 6 lines

DomU:
- Linux 4.4 kernel has the virtio-gpu drm driver.
- Mesa 11.1 has the virtio-gpu 3D driver (virgl galliumd3 / OpenGL).

Did anyone try this stuff with Xen already? :)

I'm also interested on it but I not tried it for now because it is usable only locally (with qemu's gtk or sdl2 ui if I remember good), I'm waiting spice support (in development). I'll should be able to do needed libxl support if nobody will do it before but I'm not able to do hypervisor changes if needed (like initial problems with qxl on xen)

Quoted 29 lines

-- Pasi

Quoted 11 lines · Pasi Kärkkäinen

Hello,

It seems upstream Linux/Gallium3D/Mesa/Qemu/KVM has recently gained virtualized support for 3D/OpenGL hardware acceleration in VMs, allowing using the GPU of the host in VMs.

Components:
- Linux 4.4 kernel includes the DRM driver for VirtIO-GPU 3D acceleration (needed in the VM).
- Qemu 2.5 (rc0) includes the VirtIO-GPU 3D mode support (needed on the host/dom0).
- Gallium3D VirGL driver is included in Mesa git (needed in the VM, supports up to OpenGL 3.3 atm).
- On the host/dom0 one needs *any* OpenGL driver (for the host GPU obviously), no special requirements there, if I understood correctly.

Quoted 7 lines

Has someone looked into this already? How much work would it be to get VirtIO-GPU working in Xen HVM guests?

Thanks,

-- Pasi

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Pasi Kärkkäinen
Quoted 7 lines · Pasi Kärkkäinen

Hello,

And now all the components listed below are released and available easily.

Dom0:
- Qemu 2.5 has virtio-gpu 3D/OpenGL acceleration support for VMs.

Quoted 6 lines

DomU:
- Linux 4.4 kernel has the virtio-gpu drm driver.
- Mesa 11.1 has the virtio-gpu 3D driver (virgl galliumd3 / OpenGL).

Did anyone try this stuff with Xen already? :)

I was trying to compile QEMU with the options to enable this - but got derailed.

The big thing was that I needed to install virglrendered and then pass to QEMU --enable-virglrendered --enable-opengl --enable-spice --enable-gtk

Which meant getting virglrendered which was so new I needed to update the machine to Fedora 23. After that it built (I think), but then I ended up having trouble with qemu-traditional with VNC. There were some patches posted for this, and then .. X-Mas week came :-)

I will try dust this off next week.

Quoted 30 lines

-- Pasi

Quoted 11 lines · Pasi Kärkkäinen

Hello,

It seems upstream Linux/Gallium3D/Mesa/Qemu/KVM has recently gained virtualized support for 3D/OpenGL hardware acceleration in VMs, allowing using the GPU of the host in VMs.

Components:
- Linux 4.4 kernel includes the DRM driver for VirtIO-GPU 3D acceleration (needed in the VM).
- Qemu 2.5 (rc0) includes the VirtIO-GPU 3D mode support (needed on the host/dom0).
- Gallium3D VirGL driver is included in Mesa git (needed in the VM, supports up to OpenGL 3.3 atm).
- On the host/dom0 one needs *any* OpenGL driver (for the host GPU obviously), no special requirements there, if I understood correctly.

Quoted 7 lines

Has someone looked into this already? How much work would it be to get VirtIO-GPU working in Xen HVM guests?

Thanks,

-- Pasi

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel