[Openembedded-architecture] OpenGL acceleration in qemu

Alexander Kanavin alex.kanavin at gmail.com
Mon Jan 14 15:09:18 UTC 2019


Hello all,

I just posted a patchset that enables OpenGL acceleration in QEMU, and
thought I would seek feedback here as well.

The rationale is:
1. I think we are heading towards a reality where some kind of working
GL is a 'must' for any kind of UI work.
2. Typically people build images and then transfer them to the NUC or
even target boards for testing - using qemu would be less awkward.
3. Current qemu configuration is basically useless here.

Here's the cover letter:

0. TLDR:

$ . oe-init-build-env build-virgl
$ bitbake core-image-sato-sdk
$ runqemu kvm gl
$$ run glxgears or any other GL-capable binary inside qemu

1. qemu is switched over to use gtk frontend. I simply couldn't get SDL
frontend to work properly, it only displays a blank black window or doesn't
start at all. Same thing happens with qemu binaries provided by Fedora and
opensuse (Ubuntu's qemu lacks virgl support). Seems like SDL support has
regressed.

2. While the components are built against the most minimum necessary
mesa-native set (gbm, egl, dri with no drivers), libepoxy loads and uses the
host GL implementation (through a chrpath hack). This is both to save build
times, and because the host is likely to have a set of drivers more
appropriate for the physical machine (e.g. proprietary nvidia stack,
although I didn't test that).

3. I tested this with
- glamor X server
- weston compositor with drm backend (build core-image-weston, then edit
  weston.ini in the image to use drm backed instead of fbdev).
- kmscube
- glxgears
- https://www.geeks3d.com/gputest/

The latter two show FPS that is similar to running them directly on the host.

4. Some things I am not sure about:

 - how much of a 'default' should this be for running qemu. It works for me,
but other people might find it less stable compared to the existing
sdl-vmware-swrast setup.

- what other tests and demos could be run

- how could this be tested on the autobuilder. I wrote an oe-selftest for
this, but it does require an X session, and ability to create opengl
contexts on the host.

Thanks,
Alex


More information about the Openembedded-architecture mailing list