Re: How to enable graphics acceleration on qemux86-64?


Manuel Wagesreither
 

Hi all,
hi Alexander,

I solved my problems. Things work fine now. Below I'm summing things up as documentation for myself and also others in case this pops up in someones search query.

Am So, 17. Okt 2021, um 13:32, schrieb Alexander Kanavin:
On Sat, 16 Oct 2021 at 14:08, Manuel Wagesreither <ManWag@...> wrote:

Here are some updates:

Building core-image-weston on hardknott succeeded. Couldn't `runqmu kvm slirp sdl core-image-weston` first because I got an error message about 'dri.pc' being missing. Debian package search told me it's part of 'mesa-commond-dev', so I installed it on my host machine and indeed, that runqemu command above got working again. Not just that, now even OpenGL acceleration with `runqmu kvm slirp sdl gl core-image-weston` worked, altough I didn't change anything OpenGL-wise. core-image-weston feels really snappy now. Great!

I got curious and reverted back to dunfell to check if the now-installed dri.pc made a difference, but no, it didn't. `runqemu` with `sdl` started (like it did before), and with `sdl gl` it still said "OpenGL support is disabled".

You need to replicate the settings from oe-selftest (link provided previously). I think on dunfell it's not enabled out of the box, and needs to be configured explicitly.

You were are right. In hindsight, your initial post contained everything necessary. The 'PACKAGECONFIG_append_pn-<package-name>' variables tell everything necessary. I couldn't make sense of what I was reading at the beginning.

DUNFELL:
=========
Summing things up, here's what I need on Dunfell for `runqemu kvm slirp sdl gl`.

* DISTRO_FEATURES opengl
* 'weston-xwayland' in IMAGE_INSTALL.
* 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl gtk+ virglrenderer glx"'. (Having opengl in DISTRO_FEATURES puts opengl in libsdl2-native PACKAGECONFIG automatically.)

It's interesting the gtk+ part was necessary even for `runqemu kvm slirp sdl gl`. Thought gtk+ and sdl are different solutions for the same problem. Without gtk+, it would fail with
```
qemu-system-x86_64: ../libepoxy-1.5.4/src/dispatch_common.c:863: epoxy_get_proc_address: Assertion `0 && "Couldn't find current GLX or EGL context.\n"'
```
Can't make sense of that and won't investigate any further.

HARDKNOTT:
============
Here's what I need on Hardknott:

As Alexander wrote, with Hardknott explicit configuration is no longer necessary if DISTRO_FEATURES has opengl. Think it's due to following patch: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=7561eb32a01f7990ad4a4606ac97ebe2a659e029

Hence I need:
* DISTRO_FEATURES opengl
* 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl".
* 'weston-xwayland' in IMAGE_INSTALL.
* /etc/systemd/system/default.target is a symlink to multi-user.target and shadows /lib/systemd/system/default.target which is a symlink to graphical.target. Hence, one must start graphical.target manually.
* Need to adapt weston.service to start weston with --modules=xwayland.so.

Perhaps this helps anyone.

Thanks again for your help, Alexander.

Manuel

Join yocto@lists.yoctoproject.org to automatically receive all group messages.