Joined: 23 Jul 2017
|Posted: Fri Sep 01, 2017 3:08 pm Post subject: KVM QEMU virtual GPU for 3D: Intel GVT-g setup
I have found an interesting feature for KVM or Xen virtualised 3D experience on Intel GPUs, the GVT-g for 5th and 6th generation processors (7th experimental). See https://01.org/igvt-g
Official github documentation is on https://github.com/01org/gvt-linux/wiki/GVTg_Setup_Guide#5-basic-usage
Relevant Kernel Flags: "Then make sure to enable CONFIG_DRM_I915_GVT, CONFIG_DRM_I915_GVT_KVMGT and CONFIG_DRM_I915_GVT_XENGT in ".config", which depends on CONFIG_VFIO_MDEV and CONFIG_VFIO_MDEV_DEVICE." Compiled kernel 4.12.5 with it.
Added i915.enable_gvt=1 to /boot/grub/grub.cfg
Use Qemu 2.9.0-r56. I am unsure if and with which use flags I need to re-compile Qemu, but the Github Docu shows a 5 year old upstream that's why I believe the igpu should work already out of the box from the Gentoo repo's Qemu.
I can modprobe the kvmgt:
lenovo-yoga ~ # lsmod | grep kvm
kvmgt 24576 0
mdev 16384 2 kvmgt,vfio_mdev
vfio 24576 3 vfio_iommu_type1,kvmgt,vfio_mdev
kvm_intel 184320 0
kvm 483328 2 kvm_intel,kvmgt
irqbypass 16384 1 kvm
But the module is not autoloaded at boot and after modprobing it, I cannot successfully shutdown my notebook.
The Github docu says, there should be a mdev_supported_types directory, what is missing for my graphic card identifier path:
Copied from Github Docu:
root@gvtg-host:~# ll /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/
drwxr-xr-x 5 root root 0 Apr 10 21:24 ./
drwxr-xr-x 12 root root 0 Apr 10 20:04 ../
drwxr-xr-x 3 root root 0 Apr 10 21:24 i915-GVTg_V4_1/ $ This node with low_gm_size=512MB, high_gm_size=2048MB, fense=4, resolution=1920x1200
drwxr-xr-x 3 root root 0 Apr 10 21:24 i915-GVTg_V4_2/ # This node with low_gm_size=256MB, high_gm_size=1024MB, fense=4, resolution=1920x1200
drwxr-xr-x 3 root root 0 Apr 10 21:24 i915-GVTg_V4_4/ # This node with low_gm_size=128MB, high_gm_size=512MB, fense=4, resolution=1920x1200
drwxr-xr-x 3 root root 0 Apr 10 21:24 i915-GVTg_V4_8/ # This node with low_gm_size=64MB, high_gm_size=384MB, fense=4, resolution=1024x768
I want to use the virtual GPU in a Windows machine, should be supported according to the documentation.
Did anyone run a virtual GPU successfully yet and any idea what is missing in my setup?