meta-webosose icon indicating copy to clipboard operation
meta-webosose copied to clipboard

qemu: support graphic hw acceleration

Open sparkleholic opened this issue 6 years ago • 10 comments

:Release Notes: support "runqemu qemux86" to use hw acceleration options

:Detailed Notes: Currently qemux86 generated from oe build fails launching with hw acceleration options (e.g. -vga virtio -display sdl,gl=on) on X11 WM linux host.

  • To support acceleration options, the following should be required. qemu should be compiled with "--enable-opengl".
  • libepoxy should be compiled with "-enable-x11" as well as "-enable-egl" (These options are not mutual exclusive.).

:Testing Performed: Tested locally on Ubuntu 18.04. $ runqemu qemux86 kvm slirp

:QA Notes: None

:Issues Addressed: None

sparkleholic avatar Sep 04 '18 05:09 sparkleholic

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 04 '18 05:09 CLAassistant

  1. First Issue

Error Message: qemu does not support opengl

Solution: qemu should be compiled with "--enable-opengl" (oe-core/meta/recipes-devtools/qemu/qemu.inc)

PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa" 
  1. Second Issue

Segment Fault when running qemu on the host pc

( meta-webosose/meta-webos-backports/meta-webos-backports-2.4/recipes-graphics/libepoxy/libepoxy_1.4.3.bb ) Solution: libepoxy should be compiled with "--enable-x11" as well as "--enable-egl" (These options are not mutual exclusive.)

  1. Required Jobs (enabling virgl hw acceleration) : QB_OPT_APPEND should have the following options ( oe-core/meta/conf/machine/include/qemuboot-x86.inc )
-vga virtio -display sdl,gl=on
  1. Required Jobs (/dev/kvm permission) https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu
sudo groupadd --system kvm
sudo gpasswd -a $USER kvm
sudo chown root:kvm /dev/kvm
sudo chmod 0660 /dev/kvm
  1. Required Jobs (To use runqemu params)
  • slirp - enable user networking
  • kvm - enable KVM when running x86/x86_64
runqemu qemux86 kvm slirp

sparkleholic avatar Sep 04 '18 05:09 sparkleholic

In my 16.04 Ubuntu, build fails with followings, mesa-native_17.1.7

../../../../src/gallium/auxiliary/.libs/libgallium.a(lp_bld_misc.o): In function llvm::RTDyldMemoryManager::getSymbolAddress(std::string const&)': | lp_bld_misc.cpp:(.text._ZN4llvm19RTDyldMemoryManager16getSymbolAddressERKSs[_ZN4llvm19RTDyldMemoryManager16getSymbolAddressERKSs]+0x4): undefined reference to llvm::RTDyldMemoryManager::getSymbolAddressInProcess(std::string const&)' | ../../../../src/gallium/auxiliary/.libs/libgallium.a(lp_bld_misc.o): In function llvm::RTDyldMemoryManager::findSymbol(std::string const&)': | lp_bld_misc.cpp:(.text._ZN4llvm19RTDyldMemoryManager10findSymbolERKSs[_ZN4llvm19RTDyldMemoryManager10findSymbolERKSs]+0x1b): undefined reference to llvm::RTDyldMemoryManager::getSymbolAddressInProcess(std::string const&)' | collect2: error: ld returned 1 exit status

heegoo-han avatar Sep 04 '18 08:09 heegoo-han

I checked the above with original meta-webosose and then same error occurs.

heegoo-han avatar Sep 04 '18 10:09 heegoo-han

@heegoo-han Thanks for notifying this. I found a similar issue for this. (https://lists.freedesktop.org/archives/mesa-dev/2015-April/082023.html)

sparkleholic avatar Sep 04 '18 10:09 sparkleholic

I resolved the mesa-native build error in both meta-webosose master branch and this @sparkleholic 's pull requested changes like below:

  • take aside /usr/bin/llvm-* to a temporary directory . It means remove host pc side llvm tools.
  • make cleanall-mesa-native
  • bitbake mesa-native

heegoo-han avatar Sep 04 '18 10:09 heegoo-han

@heegoo-han In conclusion, under certain circumstances a build error occurred regardless of this code patch. Depending on the llvm installed on the host pc, there seems to be an error occuring. This part will be communicated to the SCM separately from the PR.

  • @chbae

sparkleholic avatar Sep 04 '18 10:09 sparkleholic

@sparkleholic , Thanks for your efforts.

heegoo-han avatar Sep 04 '18 13:09 heegoo-han

Thanks. we will review it soon and release it.

chbae avatar Sep 17 '18 13:09 chbae

@sparkleholic Is this commit tested in the latest build? If it is tested in latest build, we will review and be decided to release. Sorry for late reply.

flowergom avatar May 15 '19 02:05 flowergom