Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Intel VT-g (integrated graphics adapter virtualization).
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 264

PostPosted: Thu Apr 27, 2017 1:46 am    Post subject: Intel VT-g (integrated graphics adapter virtualization). Reply with quote

Does anyone have any idea of how to use it? I had been waiting for it to be completed and it is now in the kernel, but I am wondering if userspace utilities still need to catch up. My usual method of checking the Gentoo and Arch wikis did no good.
Back to top
View user's profile Send private message
Tribue
n00b
n00b


Joined: 05 Apr 2007
Posts: 13

PostPosted: Mon Dec 18, 2017 8:53 am    Post subject: Re: Intel VT-g (integrated graphics adapter virtualization). Reply with quote

R0b0t1 wrote:
Does anyone have any idea of how to use it? I had been waiting for it to be completed and it is now in the kernel, but I am wondering if userspace utilities still need to catch up. My usual method of checking the Gentoo and Arch wikis did no good.

If you have hardware supporting GVT-g, you can run a virtual machine with Oracle Virtualbox or VMware Workstation, and see if the guest operating system has the same 3D benchmarks as the host, for example with Unigine Heaven Benchmark 4.0 which is available for several operating systems.
Back to top
View user's profile Send private message
blopsalot
Apprentice
Apprentice


Joined: 28 Jan 2017
Posts: 231

PostPosted: Tue Dec 19, 2017 9:52 am    Post subject: Reply with quote

https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide

Quote:
NOTICE: For KVMGT, you also can use the current upstream Linux kernel and QEMU directly since all the enabling patches have been upstreamed.


KVMGT Gentoo Basic Instructions

kernel config: ENABLE: CONFIG_DRM_I915_GVT, CONFIG_DRM_I915_GVT_KVMGT, which depends on CONFIG_VFIO_MDEV and CONFIG_VFIO_MDEV_DEVICE.

Relevant QEMU USE Flags:
Code:
echo -e "-xen sdl spice vhost-net fdt qemu_softmmu_targets_x86_64" > /etc/portage/package.use/qemu

Emerge:
Code:
emerge qemu x11-misc/x11vnc

Grub Update
Code:
/etc/default/grub

Code:
GRUB_CMDLINE_LINUX_DEFAULT="... i915.enable_gvt=1 ..."


Linux Guest Setup Xorg Configure
Quote:


Code:
/etc/X11/xorg.conf.d/0-gvt.conf


Get BusID from lspci

Code:
 
Section "Device" Identifier "intel" Driver "intel" BusID "PCI:0:4:0" EndSection
Section "Screen" Identifier "intel" Device "intel" EndSection



Check mdev Module
Quote:

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" or "Kabylake" platform), the example as below
Code:

   ls -l /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/

    total 0

    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


And you can check the detail description for each vgpu type,

Code:
 root@gvtg-host:/sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V4_1# cat description

    low_gm_size: 512MB

    high_gm_size: 2048MB

    fence: 4

    resolution: 1920x1200



Generate the uuid for create VGPU
Quote:

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@gvtg-host:~#
Code:
uuid -n 3

    a297db4a-f4c2-11e6-90f6-d3b88d6c9525

    a297de6a-f4c2-11e6-90f7-cb6a86ce449f

    a297deec-f4c2-11e6-90f8-c39f1ae774e5



Create VGPU
Quote:

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

    echo "a297db4a-f4c2-11e6-90f6-d3b88d6c9525" > "/sys/bus/pci/devices/0000:00:02.0/ mdev_supported_types/i915-GVTg_V4_4/create"

    echo "a297de6a-f4c2-11e6-90f7-cb6a86ce449f" > "/sys/bus/pci/devices/0000:00:02.0/ mdev_supported_types/i915-GVTg_V4_4/create"

    echo "a297deec-f4c2-11e6-90f8-c39f1ae774e5" > "/sys/bus/pci/devices/0000:00:02.0/ mdev_supported_types/i915-GVTg_V4_4/create"

Then all the vgpu directory you created can be found at "/sys/bus/pci/devices/0000:00:02.0/"


Remove VGPU
Quote:

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:

Code:
 echo 1 > /sys/bus/pci/devices/0000:00:02.0/a297db4a-f4c2-11e6-90f6-d3b88d6c9525/remove


If you want remove all vgpu you created, you can run below command.

Code:
for i in /sys/bus/pci/devices/0000:00:02.0/*/remove; do echo 1 > $i; done



Create KVMGT VM

Code:
qemu-system-x86_64 \
    -m 2048 -smp 2 -M pc \
    -name gvt-g-guest \
    -hda /home/img/gentoo.qcow2  \
    -bios /usr/share/seabios/bios.bin \
    -enable-kvm \
    -net user,hostfwd=tcp::10022-:22 \
    -net user,hostfwd=tcp::15900-:5900 \
    -net nic,model=virtio \
    -vga qxl \
    -k en-us \
    -serial stdio \
    -vnc :1 \
    -machine kernel_irqchip=on \
    -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 \
    -cpu host -usb -usbdevice tablet \
    -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/a297db4a-f4c2-11e6-90f6-d3b88d6c9525,rombar=0


Access KVMGT VM

ssh 22 is forwarded to 127.0.0.1:10022
vnc 5900 is forwarded to 127.0.0.1:15900
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum