IGVT-g: Difference between revisions
imported>User No edit summary |
imported>Abbradar Updated libvirt guide with improvements from ArchWiki |
||
Line 61: | Line 61: | ||
=== libvirtd === | === libvirtd === | ||
If using virt-manager, create new or open existing VM. | If using virt-manager, create new or open existing VM. Change existing <code><graphics></code> and <code><video></code> sections. | ||
sudo -E virsh edit win10 | sudo -E virsh edit win10 | ||
Line 71: | Line 71: | ||
<gl enable='yes'/> | <gl enable='yes'/> | ||
</graphics> | </graphics> | ||
<hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci'> | <video> | ||
<model type='none'/> | |||
</video> | |||
<hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci' display='on'> | |||
<source> | <source> | ||
<address uuid='a297db4a-f4c2-11e6-90f6-d3b88d6c9525'/> | <address uuid='a297db4a-f4c2-11e6-90f6-d3b88d6c9525'/> | ||
Line 82: | Line 85: | ||
<qemu:arg value='device.hostdev0.x-igd-opregion=on'/> | <qemu:arg value='device.hostdev0.x-igd-opregion=on'/> | ||
<qemu:arg value='-set'/> | <qemu:arg value='-set'/> | ||
<qemu:arg value='device.hostdev0. | <qemu:arg value='device.hostdev0.ramfb=on'/> | ||
<qemu:arg value='-set'/> | |||
<qemu:arg value='device.hostdev0.driver=vfio-pci-nohotplug'/> | |||
</qemu:commandline> | </qemu:commandline> | ||
</domain> | </domain> | ||
Line 93: | Line 98: | ||
** (libvirtd) Change main adapter type from QXL to say Cirrus | ** (libvirtd) Change main adapter type from QXL to say Cirrus | ||
** use BIOS (SeaBIOS) machine, [https://lists.01.org/pipermail/igvt-g/2018-July/001431.html EFI (OVMF) is not supported]. As a workaround you may [https://gist.githubusercontent.com/gnidorah/2951b1f8bebeac899623fd67694ed47b/raw/99320ab33d30cc28b6813d630b6121e266032c30/gistfile1.txt create qcow boot image that is capable of booting EFI windows disk on BIOS machine] | ** use BIOS (SeaBIOS) machine, [https://lists.01.org/pipermail/igvt-g/2018-July/001431.html EFI (OVMF) is not supported]. As a workaround you may [https://gist.githubusercontent.com/gnidorah/2951b1f8bebeac899623fd67694ed47b/raw/99320ab33d30cc28b6813d630b6121e266032c30/gistfile1.txt create qcow boot image that is capable of booting EFI windows disk on BIOS machine] |
Revision as of 08:05, 4 July 2019
Intel GVT-g is a full GPU virtualization solution with mediated pass-through which allows host and multiple guests to share same Intel integrated videocard. Guest gets a near-native graphics peformance.
Win7-32 / Win7-64 / Win8.1-64 /Win10-RS1-64 are validated.
Hardware Requirements
For client platforms, 5th, 6th or 7th Generation Intel® Core Processor Graphics is required. For server platforms, E3_v4, E3_v5 or E3_v6 Xeon Processor Graphics is required.
Select VGPU devices
Enable iGVT-g with
/etc/nixos/configuration.nix
virtualisation.kvmgt.enable = true;
then rebuild and reboot. Choose virtual GPU
$ ls /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/ i915-GVTg_V5_4/ i915-GVTg_V5_8/
$ cat /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_8/description low_gm_size: 64MB high_gm_size: 384MB fence: 4 resolution: 1024x768 weight: 2
Generate UUID
$ nix run nixpkgs.libossp_uuid -c uuid a297db4a-f4c2-11e6-90f6-d3b88d6c9525
NixOS configuration
/etc/nixos/configuration.nix
virtualisation.kvmgt.enable = true;
virtualisation.kvmgt.vgpus = {
"i915-GVTg_V5_8" = {
uuid = "a297db4a-f4c2-11e6-90f6-d3b88d6c9525";
};
};
environment.systemPackages = with pkgs; [
virtmanager
virt-viewer
];
virtualisation.libvirtd.enable = true;
users.extraUsers.user.extraGroups = [ "libvirtd" ];
Configure KVM
Bare Qemu
qemu-system-x86_64 \ -enable-kvm \ -m 1G \ -nodefaults \ -M graphics=off \ -serial stdio \ -display gtk,gl=on \ -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/a297db4a-f4c2-11e6-90f6-d3b88d6c9525,display=on,x-igd-opregion=on
libvirtd
If using virt-manager, create new or open existing VM. Change existing <graphics>
and <video>
sections.
sudo -E virsh edit win10
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<devices>
<graphics type='spice'>
<listen type='none'/>
<gl enable='yes'/>
</graphics>
<video>
<model type='none'/>
</video>
<hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci' display='on'>
<source>
<address uuid='a297db4a-f4c2-11e6-90f6-d3b88d6c9525'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</hostdev>
</devices>
<qemu:commandline>
<qemu:arg value='-set'/>
<qemu:arg value='device.hostdev0.x-igd-opregion=on'/>
<qemu:arg value='-set'/>
<qemu:arg value='device.hostdev0.ramfb=on'/>
<qemu:arg value='-set'/>
<qemu:arg value='device.hostdev0.driver=vfio-pci-nohotplug'/>
</qemu:commandline>
</domain>
Finally use sudo virt-viewer --attach win10
FAQ
- No video output
- (libvirtd) Change main adapter type from QXL to say Cirrus
- use BIOS (SeaBIOS) machine, EFI (OVMF) is not supported. As a workaround you may create qcow boot image that is capable of booting EFI windows disk on BIOS machine
- ensure that the recent Intel graphics driver is installed in the guest
- (libvirtd) "Element domain has extra content: qemu:commandline" error after editing via virsh
- you forgot to add xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'
- (libvirtd) "no drm render node available" error in virt-manager
- in virt-manager change SPICE display render node from auto to available one
- "write_loop: No space left on device" error when creating mdev device
- check whether available instances are left
$ cat /sys/bus/pci/devices/0000\:00\:02.0/mdev_supported_types/i915-GVTg_V5_4/available_instances 1
also check dmesg output for gvt related error, most likely there is not enough VRAM
- There is no VGPU device that has resolution of my screen
- Use this program in guest https://www.monitortests.com/forum/Thread-Custom-Resolution-Utility-CRU to set resolution you need
- (libvirtd) VM stops immediately with no error other than "internal error: process exited while connecting to monitor"
- qemu might be exiting due to SIGSYS, which may be related to this bug: https://github.com/intel/gvt-linux/issues/47
Try disabling seccomp sandboxing in qemu like so:
virtualisation.libvirtd = {
qemuVerbatimConfig = ''
seccomp_sandbox = 0
'';
};
Useful sources
- vgpu display support on a contributor (kraxel)'s blog - this guide misses info that Windows guest requires x-igd-opregion=on parameter and also that QXL may go into conflict
- https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide - obsoleted guide, but some parts are useful
- https://github.com/intel/gvt-linux/wiki/Dma_Buf_User_Guide - obsoleted guide, but some parts are useful
- https://blog.bepbep.co/posts/gvt/ - How to get 60fps!