virtio-gpu on the way upstream

We are making progress, time for the next status report …

virtio-gpu, 2d mode

It’s on the way upstream, both guest and host side. The qemu code landed in git master already and will be shipped with the upcoming 2.4 release. The linux kms driver is in drm-next right now and will most likely land upstream in the 4.2 merge window.

virtio-gpu, 3d mode

With 2d mode being almost completed now the focus shifts to put 3d/virgl into shape.

The qemu code is in a new virgl branch now, the vga and ui bits are no longer separated.

Current state: SDL2 display is working. egl display (headless, see below) is working.

TODO list: Make gtk diplay (egl mode) work. Add support for native opengl (available in 3.16+, needed to run on wayland) to gtk display. Add spice support.

Building qemu with virgl:
You need virglrenderer. Copr has packages. If you want try egl display too you need pretty cutting edge mesa and libepoxy packages, for dma-buf export and import support. Fedora 22 will do for mesa. For libepoxy you need the rawhide/F23 version.

Linux guest bits for virgl:
The virtio-gpu branch in my linux repo has the kernel bits you need. The Copr repos have a “mesa.git” package which you need to install. This isn’t full mesa, only the guest driver for virtio-gpu. I suggest to use Fedora 22 as guest as I’m usually testing with F22 too.

You might need to put selinux (at the host) into permissive mode when playing with this. svirt doesn’t allow qemu access the gpu.

headless egl display

In this mode qemu doesn’t need access to your X11 (or wayland) display. It’ll open a drm render node instead and use that for opengl operations. The guest display is rendered into a dma-buf. A simple standalone app can connect to qemu, get access to the dma-bufs via file descriptor passing and blit the dma-buf to your screen.

Start qemu: qemu-system-x86_64 -display egl -name $name
Start viewer: qemu-eglview $name

The viewer is proof-of-concept for the dma-buf passing and it is pretty simple. No pointer shape support. No relative pointer support, so a tablet device is mandatory for the guest if you want a working pointer.

Not sure yet how the long-term future will look like for qemu-eglview. Right now it is a useful hacking and testing tool. But spice will some day operate in a very simliar way and additionally provide all the extra goodies spice has to offer (sound, usb, smartcard, webdav, …), so it probably isn’t that useful to turn it into a full-blown viewer app …

2 thoughts on “virtio-gpu on the way upstream

  1. marc-andré

    Great news! Do you run X in the guest? with glamor? Last I checked, drm mesa driver was missing dmabuf support.

  2. Dave Airlie

    Marc-Andre, I realised I’d gotten glamor on dri2 working before, so explains why it wasn’t going, I added support in the mesa driver for the dri3 bits and it was all working yesterday, my virgl copr has a mesa for f22 with the guest bits in it, and it seems to work okay.

Comments are closed.