I'll explain below how you can test things on Fedora 24, but first let's cover the hurdles and caveats. This is far from being something that can be turned on by default and there's still serious integration issues to iron out. All of this is regarding usage with libvirt tools.
Caveats and known issues
- This doesn't work with qemu:///system yet, which is what virt-manager uses by default. Permissions and cgroup access are problematic at the moment. qemu:///session (the gnome-boxes default) is saved from some of these issues, but it's still affected by...
- svirt/selinux issues. We haven't come up with a plan here yet.
- When enabled, your VM can't be migrated or saved (migrate to disk), either directly or as part of taking a VM snapshot
- This only works if connecting to a VM on your local machine. And once enabled, the VM isn't accessible remotely whatsoever
- virt-manager has some weird rendering behavior that requires resizing the window first before you see any display output. It's fixed upstream, but no fedora build yet. virt-viewer works fine
- virt-manager has some weird behavior if trying to run two GL enabled VMs at once. Patches have been posted upstream for spice-gtk
Testing it outYou'll need the following packages (or later) to test this:
- At least F24 beta on the host
- Fedore 24 beta in the guest. Anything earlier is not going to actually enable the 3D acceleration. I have no idea about the state of other distributions. And to make it abundantly clear this is linux only and likely will be for a long time at least, I don't know if Windows driver support is even on the radar.
The first command will switch the graphics device to 'virtio' and enable the 3D acceleration setting. The second command will set up spice to listen locally only, and enable GL. Make sure to fully poweroff the VM afterwards for the settings to take effect. If you want to make the changes manually with 'virsh edit', the XML specifics are described in the spice GL documentation.
Once your VM has started up, you can verify that everything is working correctly by checking
glxinfooutput in the VM, 'virgl' should appear in the renderer string:
And of course the more fun test of giving supertuxkart a spin :)
Credit to Dave Airlie, Gerd Hoffman, and Marc-André Lureau for all the great work that got us to this point!