[wiki] Update the GVT-g Setup guide for Q2 community release:

Xu, Terrence terrence.xu at intel.com
Tue Jun 13 08:00:27 UTC 2017


Please ignore this email and just review the v2 version. :)

>-----Original Message-----
>From: Xu, Terrence
>Sent: Tuesday, June 13, 2017 3:58 PM
>To: intel-gvt-dev at lists.freedesktop.org
>Cc: Xu, Terrence <terrence.xu at intel.com>; Yang, Ronnie
><ronnie.yang at intel.com>
>Subject: [wiki] Update the GVT-g Setup guide for Q2 community release:
>
>1. Optimized the KVMGT Setup guide.
>2. Add the XenGT Setup guide.
>3. Update the newest code drop version.
>4. Fix the typo.
>
>Signed-off-by: Ronnie Yang <ronnie.yang at intel.com>
>Signed-off-by: Terrence Xu <terrence.xu at intel.com>
>---
> GVTg_Setup_Guide.md | 144
>++++++++++++++++++++++++++++++++++++++++++----------
> 1 file changed, 118 insertions(+), 26 deletions(-)
>
>diff --git a/GVTg_Setup_Guide.md b/GVTg_Setup_Guide.md index
>ade9356..57ff20d 100644
>--- a/GVTg_Setup_Guide.md
>+++ b/GVTg_Setup_Guide.md
>@@ -12,6 +12,8 @@ Contents
>          * [3.2.1 Build the initrd (initial ramdisk)](#321-build-the-initrd-initial-
>ramdisk)
>          * [3.2.2 Build Kernel Source](#322-build-kernel-source)
>       * [3.3 Build Qemu](#33-build-qemu)
>+         * [3.3.1 Build Qemu for KVMGT](#331-build-qemu-for-kvmgt)
>+         * [3.3.2 Build Qemu & Xen for XenGT](#332-build-qemu--xen-for-
>xengt                                                )
>       * [3.4 Grub Update](#34-grub-update)
>    * [4 Guest Setup](#4-guest-setup)
>       * [4.1 Linux Guest Setup](#41-linux-guest-setup) @@ -23,27 +25,28 @@
>Contents
>          * [4.2.2 Windows GFX Driver Support](#422-windows-gfx-driver-support)
>          * [4.2.3 Windows Remote Protocol Support](#423-windows-remote-
>protocol-support)
>    * [5 Basic usage](#5-basic-usage)
>-      * [5.1 Check mdev Module](#51-check-mdev-module)
>-      * [5.2 Generate the uuid for create VGPU](#52-generate-the-uuid-for-
>create-vgpu)
>-      * [5.3 Create VGPU](#53-create-vgpu)
>-      * [5.4 Remove VGPU](#54-remove-vgpu)
>+      * [5.1 Check mdev Module (KVMGT only)](#51-check-mdev-module-
>kvmgt-only)
>+      * [5.2 Generate the uuid for create VGPU (KVMGT only)](#52-generate-
>the-uuid-for-create-vgpu-kvmgt-only)
>+      * [5.3 Create VGPU (KVMGT only)](#53-create-vgpu-kvmgt-only)
>+      * [5.4 Remove VGPU (KVMGT only)](#54-remove-vgpu-kvmgt-only)
>       * [5.5 Network Bridge](#55-network-bridge)
>       * [5.6 Create VM](#56-create-vm)
>+         * [5.6.1 Create KVMGT VM](#561-create-kvmgt-vm)
>+         * [5.6.2 Create XenGT VM](#562-create-xengt-vm)
>    * [6 Features Supported](#6-features-supported)
>       * [6.1 Highlights Features](#61-highlights-features)
>       * [6.2 Validated Benchmarks](#62-validated-benchmarks)
>
>
>-
> # 1 Introduction #
>
>-Intel GVT-g for KVM (a.k.a. KVMGT) is a full GPU virtualization solution with
>mediated pass-through (VFIO mediated device framework based), starting
>from 5th generation Intel Core(TM) processors with Intel Graphics processors.
>+Intel GVT-g is a full GPU virtualization solution with mediated pass-through
>(VFIO mediated device framework based), starting from 5th generation Intel
>Core(TM) processors with Intel Graphics processors. GVT-g supports both Xen
>and KVM  (a.k.a XenGT & a.k.a KVMGT).
> A virtual GPU instance is maintained for each VM, with part of performance
>critical resources directly assigned. The capability of running native graphics
>driver inside a VM, without hypervisor intervention in performance critical
>paths, achieves a good balance among performance, feature, and sharing
>capability.
>
> # 2 System Reruirements #
>
> ## 2.1 Operating System Requirements  ##
>- Ubuntu 16.04.1 has been fully validated as host, other Linux operating
>system like RHEL / Fedora are also OK.
>+Ubuntu 16.04.1 has been fully validated as host, other Linux operating
>system like RHEL / Fedora are also OK.
>
> ## 2.2 Hardware Requirements  ##
> 5th or 6th Generation IntelĀ® Core Processor Graphics is required.
>@@ -58,18 +61,22 @@ Use Ubuntu as example, there are some software
>package needed by host environmen
>
> ## 3.1 Source Repositories ##
>
>-    GVT-g kernel tip: https://github.com/01org/gvt-linux.git (branch: "gvt-
>stable-4.10")
>-    QEMU: git://git.qemu.org/qemu.git (tag: "v2.8.0")
>+	GVT-g kernel: https://github.com/01org/gvt-linux/  (branch: gvt-
>stable-4.11)
>+	QEMU: https://github.com/01org/igvtg-qemu  (branch: stable-2.9.0)
>+	Xen :  https://github.com/01org/igvtg-xen (branch: xengt-stable-4.9)
>
> ## 3.2 Build Kernel ##
> ### 3.2.1 Build the initrd (initial ramdisk)  ###  Use Ubuntu as example,
>modify /etc/initramfs-tools/modules, like below:
> > kvmgt
>
>+> xengt
>+
> > vfio-iommu-type1
>
> > vfio-mdev
>
>+
> For Fedora or RHEL you should make the similar changes in "dracut".
>
> ### 3.2.2 Build Kernel Source ###
>@@ -78,22 +85,24 @@ For Fedora or RHEL you should make the similar
>changes in "dracut".
>
> > cd gvt-linux
>
>-> git checkout gvt-stable-4.10
>+> git checkout gvt-stable-4.11
>
> > echo ""|make oldconfig
>
>-Then make sure to enable **CONFIG_DRM_I915_GVT** and
>**CONFIG_DRM_I915_GVT_KVMGT** in ".config", which depends on
>**CONFIG_VFIO_MDEV** and **CONFIG_VFIO_MDEV_DEVICE**.
>+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**.
>
> > make -j8 && make modules_install && make install
>
> ## 3.3 Build Qemu ##
>-Then build QEMU as follow:
>
>-> git clone git://git.qemu.org/qemu.git
>+Pls follow chapter 3.3.1 for KVMGT setup and chapter 3.3.2 for XenGT
>+setup
>+
>+### 3.3.1 Build Qemu for KVMGT ###
>+> git clone https://github.com/01org/igvtg-qemu
>
>-> cd qemu
>+> igvtg-qemu
>
>-> git checkout v2.8.0
>+> git checkout stable-2.9.0
>
> > git submodule update --init roms/seabios
>
>@@ -129,9 +138,38 @@ Then build QEMU as follow:
>
> > cp roms/seabios/out/bios.bin /usr/bin/bios.bin
>
>+### 3.3.2 Build Qemu & Xen for XenGT ###
>+> git clone https://github.com/01org/igvtg-xen
>+
>+> cd igvtg-xen
>+
>+> git checkout xengt-stable-4.9
>+
>+> git clone https://github.com/01org/igvtg-qemu
>+
>+> cd igvtg-qemu
>+
>+> git checkout stable-2.9.0
>+
>+> cd ..
>+
>+> sed -i 's/\(QEMU_UPSTREAM_REVISION ?= \).*/\1origin\/stable-2.9/g'
>+> Config.mk
>+
>+> sed -i 's/\(QEMU_UPSTREAM_URL ?=
>+> \).*/\1file:\/\/localhost\/root\/igvtg-xen\/igvtg-qemu/g' Config.mk
>+> #Suppose the qemu-xen located in "/root/igvtg-xen/igvtg-qemu"#
>+
>+> ./autogen.sh
>+
>+> ./configure --prefix=/usr
>+
>+> make -j8 xen tools
>+
>+> make install-tools
>+
>+> cp xen/xen.gz /boot/vgt/xen-vgt.gz
>+
> ## 3.4 Grub Update ##
>
>-Make sure the "i915.enable_gvt=1" exist in host grub.cfg, use  Ubuntu as
>example, as below:
>+For KVMGT, Make sure the "i915.enable_gvt=1" exist in host grub.cfg, below
>is an example on ubuntu:
>
>     menuentry 'GVT-g Upstream' --class kvmgt --class gnu-linux --class gnu --
>class os $menuentry_id_option 'gnulinux-simple-106518cd-fb74-4048-81de-
>3ecee7ad74d4' {
>         recordfail
>@@ -146,13 +184,33 @@ Make sure the "i915.enable_gvt=1" exist in host
>grub.cfg, use  Ubuntu as example
>         else
>             search --no-floppy --fs-uuid --set=root 106518cd-fb74-4048-81de-
>3ecee7ad74d4
>         fi
>-            linux   /boot/vgt/host-gvt root=UUID=106518cd-fb74-4048-81de-
>3ecee7ad74d4 ro ignore_loglevel log_buf_len=128M
>console=ttyS0,115200,8n1 i915.enable_gvt=1 kvm.ignore_msrs=1
>+            linux   /boot/vgt/host-gvt root=UUID=106518cd-fb74-4048-81de-
>3ecee7ad74d4 ro ignore_loglevel log_buf_len=128M
>console=ttyS0,115200,8n1 i915.enable_gvt=1 kvm.ignore_msrs=1
>intel_iommu=igfx_off drm.debug=0
>             initrd  /boot/vgt/initrd-gvt.img
>     }
>
> NOTICE: Since some windows guest 3rd patry application / tools (like GPU-Z /
>Passmark9.0) will trigger MSR read / write directly, if it access the unhandled
>msr register,  guest will trigger BSOD soon. So we added the
>"kvm.ignore_msrs=1" into grub for workaround.
>
>
>+For XenGT, make sure the "i915.enable_gvt=1" exist in host grub.cfg, below
>is an example on ubuntu:
>+
>+	menuentry 'upstream vfio' --class kvmgt --class gnu-linux --class gnu --
>class os $menuentry_id_option 'gnulinux-simple-106518cd-fb74-4048-81de-
>3ecee7ad74d4' {
>+		recordfail
>+		load_video
>+		gfxmode $linux_gfx_mode
>+		insmod gzio
>+		insmod part_msdos
>+		insmod ext2
>+		set root='hd0,msdos1'
>+		if [ x$feature_platform_search_hint = xy ]; then
>+			search --no-floppy --fs-uuid --set=root --hint-
>bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1
>106518cd-fb74-4048-81de-3ecee7ad74d4
>+		else
>+			search --no-floppy --fs-uuid --set=root 106518cd-fb74-
>4048-81de-3ecee7ad74d4
>+		fi
>+		multiboot   /boot/vgt/xen-gvt.gz dom0_max_vcpus=2
>dom0_mem=2048M iommu=1 loglvl=all guest_loglvl=all msi=1
>conring_size=4M  console=com1 com1=115200,8n1 sync_console
>+		module   /boot/vgt/dom0-gvt root=UUID=106518cd-fb74-
>4048-81de-3ecee7ad74d4 ro ignore_loglevel intel_iommu=igfx_off
>i915.hvm_boot_foreground=1 log_buf_len=128M console=hvc0 drm.debug=0
>i915.enable_gvt=1
>+		module  /boot/vgt/initrd-gvt.img
>+	}
>+
> # 4 Guest Setup #
>
> ## 4.1 Linux Guest Setup ##
>@@ -237,8 +295,8 @@ Win7-32 / Win7-64 / Win8.1-64 /Win10-RS1-64 are
>validated.
> After you boot up Windows guest, you can see 2 GFX card in "Device
>manager" (One is the virtual GFX card "QXL" or "Cirrus", the other is Intel GFX
>card), then you must install the Intel GFX driver for the Intel GFX card to
>support OpenCL / OpenGL / DirectX9 / DirectX10/ DirectX11 / DirectX12
>hardware acceleration .
> You can get the Windows driver from Intel website:
>https://downloadcenter.intel.com/product/80939/Graphics-Drivers
>
>-    Skylake: 15.45.16.4627
>-	Broadwell: 15.40.34.4624
>+    Skylake: 15.45.19.4678
>+    Broadwell: 15.40.34.4624
>
> NOTICE: After you installed Windows GFX driver, you can see guest desktop
>by both QEMU and remote protocol. QEMU display the emulated driver and
>the remote protocol display the Intel GFX driver. BTW, There is a known issue
>that some 3D workload cannot run with hardware acceleration while both GFX
>card is available, so suggest to disable the emulated GFX card in "Device
>Manager" after you make sure the Intel GFX card is working.
>
>@@ -249,7 +307,7 @@ All Windows Remote protocol are supported, such as
>TightVNC, HP RGS, RDP.
> > vncviewer $guestIP
>
> # 5 Basic usage #
>-## 5.1 Check mdev Module  ##
>+## 5.1 Check mdev Module (KVMGT only) ##
> After you boot up you host to GVT-g menuentry, you make sure the
>"mdev_supported_types" node with differenct vgpu type existed(The "V#ID"
>represent the corresponding platform, "V4" means it is "Broadwell" platform,
>"V5" means it is "Skylake" platform), the example as below  > root at gvtg-
>host:~# ll /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/
>
>@@ -279,7 +337,7 @@ And you can check the detail description for each vgpu
>type,
>
> > resolution: 1920x1200
>
>-## 5.2 Generate the uuid for create VGPU  ##
>+## 5.2 Generate the uuid for create VGPU (KVMGT only) ##
> Use Ubuntu as example, you can use the third-party tool to generate uuid
>like "uuid", "uuidgen", if we need to create 3 VM, we must create 3 uuid for 3
>VGPU, like below:
> > root at gvtg-host:~# uuid -n 3
>
>@@ -290,7 +348,7 @@ Use Ubuntu as example, you can use the third-party
>tool to generate uuid like "u  > a297deec-f4c2-11e6-90f8-c39f1ae774e5
>
>
>-## 5.3 Create VGPU ##
>+## 5.3 Create VGPU (KVMGT only) ##
> Use the uuid you generated to create VGPU, notes: if you want to boot up
>multi guests, you can use echo "uuid" >
>"/sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-
>GVTg_V#ID_#Type/create", like below:
>
> > echo "a297db4a-f4c2-11e6-90f6-d3b88d6c9525" >
>"/sys/bus/pci/devices/0000:00:02.0/  mdev_supported_types/i915-
>GVTg_V4_4/create"
>@@ -301,7 +359,7 @@ Use the uuid you generated to create VGPU, notes: if
>you want to boot up multi g
>
> Then all the vgpu directory you created can be found at
>"/sys/bus/pci/devices/0000:00:02.0/"
>
>-## 5.4 Remove VGPU ##
>+## 5.4 Remove VGPU (KVMGT only) ##
> If you want to remove one vgpu you create, you need to "echo 1 > remove"
>at the vgpu directory and created, the example as below:
> > echo 1 > /sys/bus/pci/devices/0000:00:02.0/a297db4a-f4c2-11e6-90f6-
>d3b88d6c9525/remove
>
>@@ -310,11 +368,16 @@ If you want remove all vgpu you created, you can
>run below command.
>
> ## 5.5 Network Bridge ##
>
>-In order to let guest using the same network segment as host, you must
>create the network bridge. Besides, in order to let Qemu using the network
>bridge you created, you also need create a scripte as below (We saved it at
>/etc/qemu-ifup):
>+For KVMGT, in order to let guest using the same network segment as host,
>you must create the network bridge. Besides, in order to let Qemu using the
>network bridge you created, you also need create a scripte as below (We
>saved it at /etc/qemu-ifup):
>
> Detail you can reference the the "Configuring Guest Networking" wiki page
>http://www.linux-kvm.org/page/Networking
>
>+
>+For XenGT you can just create the network bridge by yourself.
>+
> ## 5.6 Create VM ##
>+Pls refer chapter 5.6.1 to create KVMGT VM and chapter 5.6.2 to create
>+XenGT VM ### 5.6.1 Create KVMGT VM ###
> We sugguest to use the secondary gfx card mode (virtual "qxl" or "cirrus" gfx
>card as 1st guest gfx card, intel gfx card as 2nd guest gfx card)to create VM,
>the example of create VM script as below :
>
>     #! /bin/bash -x
>@@ -333,13 +396,42 @@ We sugguest to use the secondary gfx card mode
>(virtual "qxl" or "cirrus" gfx ca
>         -cpu host -usb -usbdevice tablet \
>         -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/a297db4a-
>f4c2-11e6-90f6-d3b88d6c9525,rombar=0
>
>+### 5.6.2 Create XenGT VM ###
>+You can create hvm configuration file by modifying /etc/xen/xlexample.hvm
>like below:
>+
>+	builder='hvm'
>+    vgt=1
>+	vcpus=2
>+	memory = 4096
>+	name = "win10-1"
>+	vif =
>[ 'type=ioemu,bridge=xenbr0,mac=00:25:10:03:0A:01,model=e1000' ]
>+	disk = ['/home/img/win10-red-stone.img,raw,hda,w']
>+	device_model_version = 'qemu-xen'
>+	device_model_override = '/usr/lib/xen/bin/qemu-system-i386'
>+	boot="dc"
>+	opengl=0
>+	serial='pty'
>+	usb=1
>+	usbdevice='tablet'
>+	sdl=0
>+	vnc=1
>+	keymap='en-us'
>+	vgt_low_gm_sz=128   # Only support 64 / 128 / 256 / 512
>+	acpi_s4=0
>+	acpi_s3=0
>+
>+
>+
>+After that, you can create XenGT VM via the below command:
>+
>+    xl create xlexample.hvm
>
> # 6 Features Supported #
> ## 6.1 Highlights Features ##
>   - General:
>     * Supported Linux distributions (64bit): Ubuntu, Fedora, RHEL, SUSE, etc
>     * Supported Windows guest: Windows7 (32bit, 64bit), Windows8.1 (64bit),
>-      Windows10 RedStore (64bit)
>+      Windows10 RedStone (64bit)
>     * Supported total vGPU number <= 7
>     * Single display with resolution up to 1920x1080p
>   - 3D/2D:
>@@ -360,4 +452,4 @@ We sugguest to use the secondary gfx card mode
>(virtual "qxl" or "cirrus" gfx ca
>   - Media:
>     * Multiple thread decode/transcode for JPEG, MPEG2, H264, HEVC, VC1,
>VP8, etc
>   - OpenCL:
>-    * LuxMark, Beignet
>\ No newline at end of file
>+    * LuxMark, Beignet
>--
>2.7.4



More information about the intel-gvt-dev mailing list