Intel NUC IGD PassThrough: Where can I specify the Total Available Graphic Memory for passed-through IGD device in Windows?

Acewind acewind at gmail.com
Thu Sep 20 11:08:58 UTC 2018


Enviroment:   Intel NUC 6i5SYH + Fedora 25 (kernel=4.8.6, qemu=2.7,
runlevel=3)

[root at idv ~]# cat /proc/cpuinfo | grep 'model name' | head -1
model name  : Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz

[root at idv ~]# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Iris Graphics 540 (rev
0a)

[root at idv home]# uname -a
Linux idv 4.8.6-300.fc25.x86_64 #1 SMP Tue Nov 1 12:36:38 UTC 2016 x86_64
x86_64 x86_64 GNU/Linux

[root at idv home]# cat /proc/cmdline | grep iommu
BOOT_IMAGE=/vmlinuz-4.8.6-300.fc25.x86_64 root=/dev/mapper/fedora_idv-root
ro rd.lvm.lv=fedora_idv/root rd.lvm.lv=fedora_idv/swap intel_iommu=on
iommu=pt rhgb quiet

[root at idv home]# lsmod | grep vfio
vfio_iommu_type1       20480  1
vfio_pci               45056  1
vfio_virqfd            16384  1 vfio_pci
irqbypass              16384  3 kvm,vfio_pci
vfio                   28672  5 vfio_iommu_type1,vfio_pci

According to Alex's blog:
http://vfio.blogspot.com/2016/07/intel-graphics-assignment.html
I create a win7 instance with hostdev:

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
    </hostdev>

and with x-igd-gms=1:

  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-igd-opregion=on'/>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-igd-gms=1'/>
  </qemu:commandline>

Then a win7 instance is started with IGD passed through successfully but
with low resolution of 640*480.
Intel driver is not installed.
In the "Standard VGA Adapter Properties" interface, the "Total Available
Graphic Memory" is 4194240 KB.
The video ram, system video ram, system shared memory are all unavailable.

If I install intel driver and reboot, windows will be rebooted to recovery
mode.

In host os, dmesg shows these error:

[四 9月 20 19:02:23 2018] Console: switching to colour dummy device 80x25
[四 9月 20 19:02:23 2018] vgaarb: device changed decodes:
PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
[四 9月 20 19:02:23 2018] virbr0: port 2(vnet0) entered blocking state
[四 9月 20 19:02:23 2018] virbr0: port 2(vnet0) entered disabled state
[四 9月 20 19:02:23 2018] device vnet0 entered promiscuous mode
[四 9月 20 19:02:23 2018] virbr0: port 2(vnet0) entered blocking state
[四 9月 20 19:02:23 2018] virbr0: port 2(vnet0) entered listening state
[四 9月 20 19:02:24 2018] DMAR: DRHD: handling fault status reg 2
[四 9月 20 19:02:24 2018] DMAR: [DMA Write] Request device [00:02.0] fault
addr 0 [fault reason 02] Present bit in context entry is clear
[四 9月 20 19:02:24 2018] vfio_ecap_init: 0000:00:02.0 hiding ecap 0x1b at 0x100
[四 9月 20 19:02:25 2018] kvm: zapping shadow pages for mmio generation
wraparound
[四 9月 20 19:02:25 2018] virbr0: port 2(vnet0) entered learning state
[四 9月 20 19:02:26 2018] kvm: zapping shadow pages for mmio generation
wraparound
[四 9月 20 19:02:27 2018] virbr0: port 2(vnet0) entered forwarding state
[四 9月 20 19:02:27 2018] virbr0: topology change detected, propagating
[四 9月 20 19:03:16 2018] usb 1-3: reset low-speed USB device number 2 using
xhci_hcd
[四 9月 20 19:03:16 2018] usb 1-3: reset low-speed USB device number 2 using
xhci_hcd
[四 9月 20 19:03:17 2018] usb 1-3: reset low-speed USB device number 2 using
xhci_hcd

The whole libvirt xml:

<domain type='kvm' id='1' xmlns:qemu='
http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>win7</name>
  <uuid>6072d1a4-e968-4715-bf78-637c12d43874</uuid>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Broadwell-noTSX</model>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/home/win7.qcow2'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:e2:d9:a6'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x093a'/>
        <product id='0x2521'/>
        <address bus='1' device='2'/>
      </source>
      <alias name='hostdev1'/>
      <address type='usb' bus='0' port='2'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04'
function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-igd-opregion=on'/>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-igd-gms=1'/>
  </qemu:commandline>
</domain>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20180920/37b6ab25/attachment.html>


More information about the intel-gvt-dev mailing list