*

GPU virtualization update

Elie Tournier avatar

Posted on 09/05/2018 by Elie Tournier

A few months ago, Robert Foss wrote a blog post about virtualizing GPU Access. In his post, Robert explained the architecture of the GPU virtualization stack and, how to build and run a VM with hardware acceleration.

If you are interested by the GPU virtualization topic, I suggest you read Robert’s post.

Today, I will discuss the major improvements which landed upstream during these pasts 3 months.

tl;dr:

  • QEMU can now use OpenGL ES acceleration.
  • Virglrenderer is close to be OpenGL ES 2.0 compliant.
  • We are still working on OpenGL ES 3.0.

For each component of the stack, I will explain the added modifications and our plan for the future.

Virglrenderer

At Collabora, we have been working as part of the upstream community to add new features and improve the code base.

Most of our work consisted in adding more caps to support OpenGL ES 3.0 on OpenGL ES and to find some workarounds for the missing OpenGL ES features. For example, OpenGL ES does not support 1D texture so we have to use a 2D texture with one of the component set to 0.5.

On my system, KabyLake with Mesa 18.0, I obtained the following results:

  • Android OpenGL ES 2.0 CTS on OpenGL backend: 4 failures
  • Android OpenGL ES 2.0 CTS on OpenGL ES backend: 4 failures
  • Android OpenGL ES 3.0 CTS on OpenGL backend: 40 failures
  • Android OpenGL ES 3.0 CTS on OpenGL ES backend: ~2400 failures

The OpenGL ES 2.0 CTS failures seems to be driver related. The tests fail on my system but pass on r600.

The difference between OpenGL ES 3.0 results might seem scary but a single fix should take care of it. These failures are due to the fact that we don't support reading back results from integer (as opposed to floating-point) rendering, so all the tests for integer formats fall.

QEMU

Status

We can, since 4867e47, create an OpenGL ES context. Thanks to this, we can now run QEMU on a system that only supports OpenGL ES.

Running QEMU on an OpenGL ES backend.

If you want to try it out, you can follow the guide from Robert’s blog. The only difference is the command line to run the WM, you just need to replace -sdl,gl=on by -sdl,gl=es.

So it will become:

qemu-system-x86_64 \
    -enable-kvm -M q35 -smp 2 -m 4G \
    -hda ubuntu.qcow2 \
    -net nic,model=virtio \
    -net user,hostfwd=tcp::2222-:22 \
    -vga virtio \
    -display sdl,gl=es

Others flags are also available:
-sdl,gl=core Force to create an OpenGL context.
-sdl,gl=on Try to create an OpenGL context and if it fails, we fallback and try to create an OpenGL ES context.
-sdl,gl=off Disable the hw acceleration.

Continuous Integration

Tomeu Vizoso initiated an effort to create a CI for Virglrenderer. The CI is hosted on Freedesktop.org but validation is limited. We only check that we were able to compile virglrenderer and that the dist-check passes.

The code for the CI is available here.

What’s next?

  • One of our long-term goals is to be compliant with the current OpenGL ES specification.
  • We also want to improve CI. We currently check that we are able to compile Virglrenderer and that the basic testsuite passes. The next step will be to run the Khronos Conformance Test Suite and/or Piglit. Virglrenderer is now being used in big projects so we need to make sure that new patches don’t introduce any regressions.
  • Security improvements. One of the main reasons to use containers is the process isolation. A bad implementation can cause leaks, give access to some unautorized components or even worse, crash the host system and lose all the advantage of process isolation. One of the solutions disscused with upstream is to use a memory safe programming language like Rust. We are still in discution. See this thread.
  • Performance and debugging improvements.

Thanks

This post has been a part of work undertaken by my employer Collabora.


Visit Elie's blog.

Comments (0)


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Latest Blog Posts

The docker.io Debian package is back to life

04/07/2018

Last week, a new version of docker.io, the Docker package provided by Debian, was uploaded to Debian Unstable. Quickly afterwards, the package…

Introducing debos, a versatile images generator

27/06/2018

In Debian and derivative systems, there are many ways to build images. The simplest tool of choice is often debootstrap. It works by downloading…

Secure video comes of age

25/06/2018

Launched by Haivision in 2017, and freely available on GitHub via the Mozilla Public License 2.0, SRT is an innovative UDP-based protocol…

GStreamer CI support for embedded devices

11/06/2018

Embedded devices are a popular deployment target for GStreamer yet they are not tested on the project's Continuous Integration (CI) system.…

Happy 20th, Open Source

05/06/2018

In late January 1998, Netscape surprised everyone by releasing the source for Communicator, its web browser, making it readily available…

Four open months at Collabora

29/05/2018

At the start of 2018 in January, I joined Collabora, an open source software consultancy, as a Software Engineer Intern with the Multimedia…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2018. All rights reserved. Website sitemap.