IGVT-g: Difference between revisions

imported>User
No edit summary
imported>User
No edit summary
Line 14: Line 14:
then rebuild and reboot. Choose virtual GPU
then rebuild and reboot. Choose virtual GPU


<pre>
  $ ls /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/
$ ls /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/
  i915-GVTg_V5_4/  i915-GVTg_V5_8/
i915-GVTg_V5_4/  i915-GVTg_V5_8/
</pre>


<pre>
  $ cat /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_8/description  
$ cat /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_8/description  
  low_gm_size: 64MB
low_gm_size: 64MB
  high_gm_size: 384MB
high_gm_size: 384MB
  fence: 4
fence: 4
  resolution: 1024x768
resolution: 1024x768
  weight: 2
weight: 2
</pre>


Generate UUID
Generate UUID


<pre>
  $ nix run nixpkgs.libossp_uuid -c uuid
$ nix run nixpkgs.libossp_uuid -c uuid
  a297db4a-f4c2-11e6-90f6-d3b88d6c9525
a297db4a-f4c2-11e6-90f6-d3b88d6c9525
</pre>


== NixOS configuration ==
== NixOS configuration ==
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
   virtualisation.kvmgt.enable = true;  
   virtualisation.kvmgt.enable = true;  
Line 54: Line 49:


=== Bare Qemu ===
=== Bare Qemu ===
<syntaxHighlight lang="sh">
 
   qemu-system-x86_64 \
   qemu-system-x86_64 \
     -enable-kvm \
     -enable-kvm \
Line 62: Line 57:
     -serial stdio \
     -serial stdio \
     -display gtk,gl=on \
     -display gtk,gl=on \
     -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/a297db4a-f4c2-11e6-90f6-d3b88d6c9525,display=on,x-igd-opregion=on
     -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/'''a297db4a-f4c2-11e6-90f6-d3b88d6c9525''',display=on,x-igd-opregion=on
</syntaxHighlight>


=== libvirtd ===
=== libvirtd ===
If using virt-manager, create new or open existing VM.
If using virt-manager, create new or open existing VM.


sudo -E virsh edit win10
sudo -E virsh edit win10
<pre>
<syntaxHighlight lang="xml" highlight="1,9">
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<devices>
  <devices>
<graphics type='spice'>
    <graphics type='spice'>
  <listen type='none'/>
      <listen type='none'/>
  <gl enable='yes'/>
      <gl enable='yes'/>
</graphics>
    </graphics>
<hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci'>
    <hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci'>
  <source>
      <source>
    <address uuid='a297db4a-f4c2-11e6-90f6-d3b88d6c9525'/>
        <address uuid='a297db4a-f4c2-11e6-90f6-d3b88d6c9525'/>
  </source>
      </source>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</hostdev>
    </hostdev>
</devices>
  </devices>
   <qemu:commandline>
   <qemu:commandline>
  <qemu:arg value='-set'/>
    <qemu:arg value='-set'/>
  <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.display=on'/>
    <qemu:arg value='device.hostdev0.display=on'/>
   </qemu:commandline>
   </qemu:commandline>
</domain>
</domain>
</pre>
</syntaxHighlight>
Finally use sudo virt-viewer --attach win10
Finally use sudo virt-viewer --attach win10


Line 116: Line 111:


** check whether available instances are left
** check whether available instances are left
<pre>
  $ cat /sys/bus/pci/devices/0000\:00\:02.0/mdev_supported_types/i915-GVTg_V5_4/available_instances  
$ cat /sys/bus/pci/devices/0000\:00\:02.0/mdev_supported_types/i915-GVTg_V5_4/available_instances  
  1
1
</pre>
also check dmesg output for gvt related error, most likely there is not enough VRAM
also check dmesg output for gvt related error, most likely there is not enough VRAM


Line 129: Line 122:


** qemu might be exiting due to SIGSYS, which may be related to this bug: https://github.com/intel/gvt-linux/issues/47
** 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:
Try disabling seccomp sandboxing in qemu like so:
<pre>
<syntaxHighlight lang="nix">
virtualisation.libvirtd = {
  virtualisation.libvirtd = {
  qemuVerbatimConfig = ''
    qemuVerbatimConfig = ''
    seccomp_sandbox = 0
      seccomp_sandbox = 0
  '';
    '';
};
  };
</pre>
</syntaxHighlight>
 
== Used sources ==
== Used sources ==