webosose / meta-webosose

Yocto layer for webOS
GNU General Public License v2.0
109 stars 42 forks source link

qemu: support graphic hw acceleration #8

Open sparkleholic opened 6 years ago

sparkleholic commented 6 years ago

: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.

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

:QA Notes: None

:Issues Addressed: None

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

sparkleholic commented 6 years ago
  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
  2. 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
  3. Required Jobs (To use runqemu params)

    • slirp - enable user networking
    • kvm - enable KVM when running x86/x86_64
      runqemu qemux86 kvm slirp
heegoo-han commented 6 years ago

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 tollvm::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 tollvm::RTDyldMemoryManager::getSymbolAddressInProcess(std::string const&)' | collect2: error: ld returned 1 exit status

heegoo-han commented 6 years ago

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

sparkleholic commented 6 years ago

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

heegoo-han commented 6 years ago

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

sparkleholic commented 6 years ago

@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.

heegoo-han commented 6 years ago

@sparkleholic , Thanks for your efforts.

chbae commented 6 years ago

Thanks. we will review it soon and release it.

flowergom commented 5 years ago

@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.