1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

Finally It Comes: A KMS Driver For QEMU-KVM

Virtualization

Published on 18 April 2011 04:41 PM EDT
Written by Michael Larabel in Virtualization
8 Comments

While Linux KVM virtualization works well for many, one of the areas where the Kernel-based Virtual Machine and its QEMU integration have lagged behind other virtualization solutions like VirtualBox and VMware is in terms of its 2D/3D support within guests. The KVM-QEMU situation is slightly more positive today though with the introduction of a basic KMS (kernel mode-setting) driver for KVM-QEMU riding in the Linux kernel.

VirtualBox and VMware virtualization products both are capable of passing 2D/3D/video calls from the guest operating systems -- regardless of whether it's Linux or Windows or even Solaris -- to the host system for execution on the GPU itself. Both Direct3D and OpenGL are fair game to the guests. It makes even gaming within a virtual machine somewhat possible or even to at least have a composited desktop. There is some performance overhead obviously, but it's much better than the KVM-QEMU accelerated display option: basically nothing.

The VMware solution even has an in-kernel DRM driver and its own Mesa Gallium3D driver. Though that isn't exactly surprising since VMware had acquired Tungsten Graphics, which was the entity behind Mesa. Due to leveraging Gallium3D, in theory the VMware guests also have exposure to OpenVG and OpenGL ES acceleration along with any future Gallium3D state trackers like OpenCL. There's also the Xorg Gallium3D state tracker for EXA and X-Video. A VA-API WebM/VP8 state tracker is also expected to come this summer. VirtualBox relies upon its own solution rather than integrating with the Linux graphics stack.

Xen virtualization users have a Gallium3D driver too for acceleration within guests, but few people actually know about the driver. This Gallium3D Xen driver was developed by an engineer working on the Open Trusted Computing project, but the work isn't maintained any longer.

Linux KVM-QEMU virtualization users meanwhile really haven't had any useful accelerated display support within guests. There is the QEMU QXL driver developed by Red Hat for the QXL Virtual GPU used by the SPICE Red Hat Enterprise Virtualization System. The QXL driver does provide UXA 2D acceleration support, but not much more, and it's still not widely used and dependent upon Red Hat's SPICE.

In late 2009, Red Hat's David Airlie experimented with KMS on QEMU. David modified the VMware KMS driver to work with QEMU just as VMware SVGA adapter works, but the work never went much beyond that.

By default, KVM-QEMU users just have an emulated Cirrus GPU, complete with its acceleration engine. There is, of course, a Cirrus X driver that can sit atop the guest operating system and pegs this emulated GPU in system memory. It's not particularly useful though it works, but without any actual GPU acceleration.

What's new today is Red Hat's Matthew Garret announcing a new DRM/KMS Linux driver for KVM-QEMU. It though is an un-accelerated KMS driver and basically just has a shadow frame-buffer. This should reduce the virtualization overhead slightly.

From his mailing list announcement, "qemu-kvm emulates a Cirrus GPU, including its acceleration engine. We typically then run a Cirrus-specific X driver on top of this, which turns requests into commands and sends them to the emulated accelerator. This all seems to be unnecessary overhead given that we're just going to end up writing to memory from the host instead, and performance is almost certainly going to be better using an unaccelerated framebuffer and a guest-side shadow."

So it's just a basic KMS driver for KVM-QEMU, that's all at this point. It's also a sample of a "simple" KMS driver. The code is actually derived from the KMS Glint driver that was developed last year as part of the Google Summer of Code as an easier way to understand Linux kernel mode-setting by programming KMS for an ancient, less-complex GPU compared to the modern Radeon / Intel / Nouveau drivers. The Glint driver has yet to be merged into the mainline Linux kernel, but at least the work has now proved to be useful.

This new kernel mode-setting driver by Matthew still takes advantage of the Cirrus GPU emulation, which at least means the host operating system and its KVM virtualization stack don't need to be upgraded to benefit from the new kernel driver. The driver itself comes in at just over 1,300 lines of code. For what it's worth, it does put running the Wayland Display Server in a virtualized environment being one (small) step closer.

It appears that it's part of official Red Hat work as opposed to being just a side project of Matthew's, so hopefully it will be merged into the Linux 2.6.40 kernel. Now if only we can be surprised by a Gallium3D KVM-QEMU driver providing acceleration to guests, but that would require much more work.

Latest Linux Hardware Reviews
  1. Mini-Box M350: A Simple, Affordable Mini-ITX Case
  2. Overclocking The AMD AM1 Athlon & Sempron APUs
  3. AMD Athlon 5350 / 5150 & Sempron 3850 / 2650
  4. Upgraded Kernel & Mesa Yield A Big Boost For Athlon R3 Graphics
Latest Linux Articles
  1. A Quick Look At GCC 4.9 vs. LLVM Clang 3.5
  2. Are AMD Athlon/Sempron APUs Fast Enough For Steam On Linux?
  3. AMD Athlon's R3 Graphics: RadeonSI Gallium3D vs. Catalyst
  4. GCC 4.9 Compiler Optimization Benchmarks For Faster Binaries
Latest Linux News
  1. R600 Gallium3D Disables LLVM Back-End By Default
  2. Fedora 21 Gets GNOME 3.12, PHP 5.6, Mono 3.4
  3. Fedora Workstation Is Making Me Quite Excited
  4. Maynard: A Lightweight Wayland Desktop
  5. Chromium Browser Going Through Growing Pains In Ubuntu 14.04
  6. KDE 4.13 Is Being Released Today With New Features
  7. Trying Out Radeon R9 290 Graphics On Open-Source
  8. Intel Broadwell GT3 Graphics Have Dual BSD Rings
  9. Early Linux 3.15 Benchmarks Of Intel Core i7 + Radeon
  10. Red Hat Releases Its RHEL 7 Release Candidate
  11. New Features Coming To Xubuntu 14.04 LTS
  12. NVIDIA Officially Releases CUDA 6
Latest Forum Discussions
  1. The GNOME Foundation Is Running Short On Money
  2. Linux Kernel Developers Fed Up With Ridiculous Bugs In Systemd
  3. Change installation destination from home directory
  4. After Jack Keane, RuseSoft will briing Ankh 3 to Linux through Desura
  5. Bye bye BSD, Hello Linux: A Sys Admin's Story
  6. New tool for undervolt/overclock AMD K8L and K10 processors
  7. How to enable opengl 3.3 on r9 270?
  8. R290x sound problems