Building QEMU and Linux with virtio-vulkan and venus support

A couple of patches are required for the kernel and qemu on the host side. You should use the latest version of mesa (host and guest) and virglrenderer libraries (host) from the upstream main branches.

Package Dependencies

T.B.D. (Assume Ubuntu in the following instructions.)

Build virglrenderer

$ sudo apt install libdrm-dev libepoxy-dev pkg-config cmake meson libvulkan-dev libva-dev $ meson setup build \ -Dvenus=true \ -Drender-server=true \ -Drender-server-worker=thread \ -Dbuildtype=release \ -Dprefix=${INSTDIR} $ ninja -C build install

Build mesa

LLVM is required to build mesa libaray. If llvm doesn't enable cpp_rtti, add the following line to meson.build.

-rtti = false

and add "-cpp_rtti=false" to the following meson setup.

$ sudo apt install \ yacc \ bison \ cmake \ llvm-15 \ glslang-tools \ libglvnd-dev \ libwayland-egl-backend-dev \ libxext-dev \ libxfixes-dev \ libxcb-glx0-dev \ libxcb-shm0-dev \ libx11-xcb-dev \ libxcb-dri2-0-dev \ libxcb-dri3-dev \ libxcb-present-dev \ libxshmfence-dev \ libxxf86vm-dev \ libxrandr-dev \ libudev-dev \ libelf-dev \ libdrm-dev $ meson setup build \ -Dgallium-nine=false -Dgallium-xa=disabled -Dglx=dri \ -Dshared-glapi=enabled -Ddri3=enabled -Degl=enabled -Dgbm=enabled \ -Dglvnd=true -Dgallium-drivers=radeonsi,virgl -Dplatforms=x11,wayland \ -Dgles1=disabled -Dgles2=enabled -Dvulkan-drivers=virtio,amd \ -Dlibunwind=disabled -Dbuildtype=release \ -Dprefix=${INSTDIR} $ ninja -C build install

For guest, use the following command to configure

(TBD)

Build qemu

Download the source code[1] from Collabora or the patch[2] from AMD should also work. Replacee “x86_64-linux-gnu” with “aarch64-linux-gnu” on AVA.

[1] https://gitlab.freedesktop.org/digetx/qemu.git branch:venus-v4

[2] https://patchew.org/QEMU/20230915111130.24064-1-ray.huang@amd.com/

Build kernel

Download the source code[3] from Collabora.

When you use “defconfig” configuration, don’t forget add the following options

(TBD)

[3] https://gitlab.freedesktop.org/digetx/linux.git branch:venus-v4

Run the guest on x86

(Note for Intel platform only)

If you see a problem similar to [4] when you run vkmark or vulkan applications, apply the following tweak to the host kernel.

[4]

Run the guest on AVA

(TBD)