virtio gpu - mehome/openthos GitHub Wiki
Instructions for building Android-x86 Marshmallow using mesa/DRM graphics stack. Currently supported is virtio-gpu on QEMU (x86 KVM).
Install dependent packages
This is for ubuntu and assuming your machine is already setup for building kernel and QEMU.
sudo apt-get install libgbm-dev libsdl2-dev libgtk-3-dev libgles2-mesa-dev libpixman-1-dev libtool autoconf
#before qemu-2.6
Build virglrenderer
git clone git://people.freedesktop.org/~airlied/virglrendererORgit://git.freedesktop.org/git/virglrenderer./autogen.sh- HACK: Remove the line with CODE_COVERAGE_RULES in generated Makefile. Alternatively, install the necessary dependency.
makesudo make install
Build QEMU
- fetch current mainline (ver-2.5+)
- HACK: Mouse input with GTK 3.16 and OpenGL appears to be broken. Work-around is edit configure script and force ‘gtk_gl=”no”’.
./configure --target-list=x86_64-softmmu --enable-gtk --with-gtkabi=3.0 --enable-kvmmake
Build Android-x86
repo init -u git://gitscm.sf.net/gitroot/android-x86/manifest -b marshmallow-x86repo sync -j10cd external/drm_grallocgit fetch x86 virglgit checkout x86/virglcd ../..cd kernelgit fetch x86 kernel-4.4git checkout x86/kernel-4.4cd ..lunchSelect android_x86_64-engmake iso_img -j8
Run QEMU
This is the script I use:
#!/bin/sh
${QEMU_PATH}/qemu-system-x86_64 \
-enable-kvm \
-m 1024 \
-serial stdio \
-cdrom ${ANDROID_IMAGE_PATH}/android_x86_64.iso\
-device virtio-gpu-pci,virgl -display gtk,gl=on
Then press "ctrl-alt-2" to see the GPU-based screen in qemu.
Reference
after qemu-2.6
get qemu-2.6 sorce code
From
http://wiki.qemu-project.org/download/qemu-2.6.0.tar.bz2
compile qemu-2.6
tar jxf qemu-2.6.0.tar.bz2
cd qemu-2.6.0
mkdir build
cd build
../configure --target-list=x86_64-softmmu --enable-kvm
make -j8
virgl
if you want to build qemu-with-virgl, you also need install virglrenderer
Build Android-x86-6.0
run
/home/chyyuu/develop/qemu-related/qemu/build-2.6/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 1024 -serial stdio -cdrom /backup/android-related/android-x86-related/out/target/product/x86/android_x86.iso -hda /backup/vms/diska.img -device virtio-gpu-pci,virgl