Elie Tournier
May 09, 2018
Reading time:
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.
For each component of the stack, I will explain the added modifications and our plan for the future.
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:
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.
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.
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.
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.
This post has been a part of work undertaken by my employer Collabora.
Visit Elie's blog.
25/04/2024
While I managed to land support for two extensions, implementing control flow re-convergence in NVK did not go as planned. This is the story…
14/03/2024
In continuation with our series about Kernel Integration we'll go into more detail about how regression detection, processing, and tracking…
21/02/2024
Now included in our Debian images & available via our GitLab, you can build a complete, working BL31 (Boot Loader stage 3.1), and replace…
19/02/2024
Back in 2022, after a series of issues were found in its design, I made the call to rework some of WirePlumber's fundamentals in order to…
08/02/2024
Continuing our Kernel Integration series, we're excited to introduce DRM-CI, a groundbreaking solution that enables developers to test their…
23/01/2024
This is the fourth and final part in a series on persian-rug, a Rust crate for interconnected objects. We've touched on the two big limitations:…
Comments (2)
Salvador:
Apr 03, 2019 at 10:52 PM
Hi, i am on rpi3 with mesa 19. It has full opengl capabilities, or sorta. The fact its than i could compile virgl render 0.6 and enabling it and it works, the problem its than i cant set gl=on becase it fails on shader profile, it ask to be 3.0. So, the question is, I need to have opengl on to have opengl acceleration or with virgl render only I have the acceleration. Its weird than qemu pass on compiling with opengl and glx but it dindt work when you set it. It should refuse opengl es profiles lower than 3.0
Reply to this comment
Reply to this comment
Elie Tournier:
Apr 04, 2019 at 03:04 PM
Hello Salvador,
You already open issues[1][2] on the project GitLab.
We are happy to help you but please keep all the information/discussion in on place.
Unfortunately, the output you just pasted indicate that your system doesn't fulfil the minimum requirement for running virgl.
Elie
[1] https://gitlab.freedesktop.org/virgl/virglrenderer/issues/96
[2] https://gitlab.freedesktop.org/virgl/virglrenderer/issues/101
Reply to this comment
Reply to this comment
Add a Comment