Some pointers on KVM, GPU Pass Through, and Syslinux.cfg


jonp

Recommended Posts

This is from virtmanager (latest,supporting Q35 machine) from my arch VM

Its untouched, so you need to tweak network,VNC, and more to fit your needs....... but its a original q35 machine.

 

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit rhel7.0
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>rhel7.0</name>
  <uuid>87eb0395-c085-444a-a2c5-67310e94e3cf</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>SandyBridge</model>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </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-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/vm_disk/KVM/testarch.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='ide' index='0'/>
    <interface type='network'>
      <mac address='52:54:00:50:b0:e4'/>
      <source network='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='vmvga' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Thanks so much. I had no problems modifying and Windows7 is up and running. Now I can try to pass thru my video. Thanks again!

 

Reed

Link to comment
  • Replies 103
  • Created
  • Last Reply

Top Posters In This Topic

Web virt manager is rejecting this code, it completely disappears when I create a new instance from xml.

 

  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.1,bus=root.1,addr=00.1'/>
  </qemu:commandline>

 

This is what is being pasted into the "from xml" window of web virt manager:

 

<domain type='kvm'>
  <name>rhel7.0</name>
  <uuid>87eb0395-c085-444a-a2c5-67310e94e3cf</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>SandyBridge</model>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </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-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/cache/kvm/Windows7.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='ide' index='0'/>
    <interface type='network'>
      <mac address='52:54:00:50:b0:e4'/>
      <source network='xenbr0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='vmvga' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.1,bus=root.1,addr=00.1'/>
  </qemu:commandline>
</domain>

 

This is my hardware:

 

root@test-Tower:~# lspci -knn
00:00.0 Host bridge [0600]: Intel Corporation Haswell DRAM Controller [8086:0c00
        Subsystem: ASRock Incorporation Device [1849:0c00]
        Kernel driver in use: hsw_uncore
00:01.0 PCI bridge [0604]: Intel Corporation Haswell PCI Express x16 Controller
        Kernel driver in use: pcieport
00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell Integrated G
        Subsystem: ASRock Incorporation Device [1849:0412]
00:03.0 Audio device [0403]: Intel Corporation Haswell HD Audio Controller [8086
        Subsystem: ASRock Incorporation Device [1849:0c0c]
00:14.0 USB controller [0c03]: Intel Corporation Lynx Point USB xHCI Host Contro
        Subsystem: ASRock Incorporation Device [1849:8c31]
        Kernel driver in use: xhci_hcd
00:16.0 Communication controller [0780]: Intel Corporation Lynx Point MEI Contro
        Subsystem: ASRock Incorporation Device [1849:8c3a]
00:19.0 Ethernet controller [0200]: Intel Corporation Ethernet Connection I217-V
        Subsystem: ASRock Incorporation Device [1849:153b]
        Kernel driver in use: e1000e
        Kernel modules: e1000e
00:1a.0 USB controller [0c03]: Intel Corporation Lynx Point USB Enhanced Host Co
        Subsystem: ASRock Incorporation Device [1849:8c2d]
        Kernel driver in use: ehci-pci
00:1b.0 Audio device [0403]: Intel Corporation Lynx Point High Definition Audio
        Subsystem: ASRock Incorporation Device [1849:1151]
00:1c.0 PCI bridge [0604]: Intel Corporation Lynx Point PCI Express Root Port #1
        Kernel driver in use: pcieport
00:1c.2 PCI bridge [0604]: Intel Corporation Lynx Point PCI Express Root Port #3
        Kernel driver in use: pcieport
00:1c.3 PCI bridge [0604]: Intel Corporation Lynx Point PCI Express Root Port #4
        Kernel driver in use: pcieport
00:1c.4 PCI bridge [0604]: Intel Corporation Lynx Point PCI Express Root Port #5
        Kernel driver in use: pcieport
00:1d.0 USB controller [0c03]: Intel Corporation Lynx Point USB Enhanced Host Co
        Subsystem: ASRock Incorporation Device [1849:8c26]
        Kernel driver in use: ehci-pci
00:1f.0 ISA bridge [0601]: Intel Corporation Lynx Point LPC Controller [8086:8c4
        Subsystem: ASRock Incorporation Device [1849:8c44]
00:1f.2 SATA controller [0106]: Intel Corporation Lynx Point 6-port SATA Control
        Subsystem: ASRock Incorporation Device [1849:8c02]
        Kernel driver in use: ahci
        Kernel modules: ahci
00:1f.3 SMBus [0c05]: Intel Corporation Lynx Point SMBus Controller [8086:8c22]
        Subsystem: ASRock Incorporation Device [1849:8c22]
        Kernel modules: i2c_i801
01:00.0 VGA compatible controller [0300]: AMD/ATI [Advanced Micro Devices, Inc.]
        Subsystem: PC Partner Limited Device [174b:e204]
        Kernel driver in use: vfio-pci
01:00.1 Audio device [0403]: AMD/ATI [Advanced Micro Devices, Inc.] Caicos HDMI
        Subsystem: PC Partner Limited Sapphire HD 6450 1GB DDR3 [174b:aa98]
        Kernel driver in use: vfio-pci
03:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1062 Serial ATA Contr
        Subsystem: ASRock Incorporation Device [1849:0612]
        Kernel driver in use: ahci
        Kernel modules: ahci
04:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Conne
        Subsystem: ASRock Incorporation Device [1849:1539]
        Kernel driver in use: igb
        Kernel modules: igb
05:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1062 Serial ATA Contr
        Subsystem: ASRock Incorporation Device [1849:0612]
        Kernel driver in use: ahci
        Kernel modules: ahci

 

Any ideas? Thanks

 

Reed

Link to comment

Trying adding this line after <qemu:commandline> and prior to your devices.

 

      <qemu:arg value='-device'/>

      <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>

 

 

JonP has his example on the 1st post.

 

Not sure what that device is? I tried using the line but to no avail maybe different entries are needed for my motherboard?

 

MOBO:  ASRock - Z87 Extreme6

CPU:      Intel® Core i7-4771 CPU @ 3.50GHz

 

Reed

 

Link to comment

Whenever I run:

root@Tower:/usr/local/sbin# vfio-bind 0000:01:00.0 0000:01.00.1

 

The result is:

 

root@Tower:/usr/local/sbin# vfio-bind 0000:01:00.0 0000:01.00.1
cat: /sys/bus/pci/devices/0000:01.00.1/vendor: No such file or directory
cat: /sys/bus/pci/devices/0000:01.00.1/device: No such file or directory
./vfio-bind: line 11: echo: write error: Invalid argument

 

My lspci -knn contains:

01:00.0 VGA compatible controller [0300]: AMD/ATI [Advanced Micro Devices, Inc.] Cape Verde XT [Radeon HD 7770 GHz Edition] [1002:683d]
        Subsystem: PC Partner Limited Device [174b:e244]
01:00.1 Audio device [0403]: AMD/ATI [Advanced Micro Devices, Inc.] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] [1002:aab0]
        Subsystem: PC Partner Limited Device [174b:aab0]

 

I have an Intel i7-3770 (base, not K,T,S) and Gigabyte GA-Z68X-UD3H-B3 motherboard.  Virtualization tech and VT-D are enabled in the bios.  I'm running Unraid 6b10a

 

Here is my syslinux.cfg:

default /syslinux/menu.c32
menu title Lime Technology
prompt 0
timeout 50
label unRAID OS
  menu default
  kernel /bzimage
  append pcie_acs_override=downstream initrd=/bzroot
label unRAID OS Safe Mode (no plugins)
  kernel /bzimage
  append initrd=/bzroot unraidsafemode
label Memtest86+
  kernel /memtest
label Xen/unRAID OS
  kernel /syslinux/mboot.c32
  append /xen --- /bzimage --- /bzroot
label Xen/unRAID OS Safe Mode (no plugins)
  kernel /syslinux/mboot.c32
  append /xen --- /bzimage --- /bzroot unraidsafemode

 

I have only one docker (Plex), and it is not set to autostart.

What am I doing wrong?  All help is much appreciated.

 

Thanks! 

Link to comment

 

 

Whenever I run:

root@Tower:/usr/local/sbin# vfio-bind 0000:01:00.0 0000:01.00.1

 

The result is:

 

root@Tower:/usr/local/sbin# vfio-bind 0000:01:00.0 0000:01.00.1
cat: /sys/bus/pci/devices/0000:01.00.1/vendor: No such file or directory
cat: /sys/bus/pci/devices/0000:01.00.1/device: No such file or directory
./vfio-bind: line 11: echo: write error: Invalid argument

 

My lspci -knn contains:

01:00.0 VGA compatible controller [0300]: AMD/ATI [Advanced Micro Devices, Inc.] Cape Verde XT [Radeon HD 7770 GHz Edition] [1002:683d]
        Subsystem: PC Partner Limited Device [174b:e244]
01:00.1 Audio device [0403]: AMD/ATI [Advanced Micro Devices, Inc.] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] [1002:aab0]
        Subsystem: PC Partner Limited Device [174b:aab0]

 

I have an Intel i7-3770 (base, not K,T,S) and Gigabyte GA-Z68X-UD3H-B3 motherboard.  Virtualization tech and VT-D are enabled in the bios.  I'm running Unraid 6b10a

 

Here is my syslinux.cfg:

default /syslinux/menu.c32
menu title Lime Technology
prompt 0
timeout 50
label unRAID OS
  menu default
  kernel /bzimage
  append pcie_acs_override=downstream initrd=/bzroot
label unRAID OS Safe Mode (no plugins)
  kernel /bzimage
  append initrd=/bzroot unraidsafemode
label Memtest86+
  kernel /memtest
label Xen/unRAID OS
  kernel /syslinux/mboot.c32
  append /xen --- /bzimage --- /bzroot
label Xen/unRAID OS Safe Mode (no plugins)
  kernel /syslinux/mboot.c32
  append /xen --- /bzimage --- /bzroot unraidsafemode

 

I have only one docker (Plex), and it is not set to autostart.

What am I doing wrong?  All help is much appreciated.

 

Thanks!

 

You are really going to kick yourself over this one.

 

root@Tower:/usr/local/sbin# vfio-bind 0000:01:00.0 0000:01.00.1

 

You have a period instead of a colon in the second device ID. You have:

 

0000:01.00.1

 

You should have

 

0000:01:00.1

 

Altogether, the vfio-bind statement should read:

 

vfio-bind 0000:01:00.0 0000:01:00.1

Link to comment

 

Syslinux.cfg 101

As of beta 10a, you no longer have to include nearly as many additional "append" statements in the syslinux.cfg to make use of KVM or the advanced features of virtualization like IOMMU.  While we haven't tested this with AMD, for Intel-based chipsets, you do not need iommu=1 in your syslinux config.  You also do not need to use pciback to hide any PCI devices from unRAID.  unRAID doesn't bind drivers to PCI devices.

 

The only statement you WILL need in there to ensure clean operations with VFIO is this: 

pcie_acs_override=downstream

Can confirm is not working for me (amd fx8350).

My syslinux:

append amd_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1 pcie_acs_override=downstream initrd=/bzroot

 

Link to comment

<domain type='kvm' id='2' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

<name>Windows</name>

<memory unit='KiB'>4194304</memory>

<currentMemory unit='KiB'>4194304</currentMemory>

<memoryBacking>

<nosharepages/>

<locked/>

</memoryBacking>

<vcpu placement='static'>4</vcpu>

<cputune>

<vcpupin vcpu='0' cpuset='0'/>

<vcpupin vcpu='1' cpuset='1'/>

<vcpupin vcpu='2' cpuset='2'/>

<vcpupin vcpu='3' cpuset='3'/>

</cputune>

    <os>

<type arch='x86_64' machine='pc-q35-2.1'>hvm</type>

<boot dev='cdrom'/>

<bootmenu enable='no'/>

    </os>

<features>

<acpi/>

<apic/>

</features>

<cpu mode='host-passthrough'>

<topology sockets='2' cores='2' threads='1'/>

</cpu>

<clock offset='localtime'/>

<on_poweroff>destroy</on_poweroff>

<on_reboot>restart</on_reboot>

<on_crash>destroy</on_crash>

 

<devices>

<emulator>/usr/bin/qemu-system-x86_64</emulator>

 

    <disk type='file' device='disk'>

      <driver name='qemu' type='qcow2' cache='none' io='native'/>

      <source file='/mnt/user/vms/kvm/windows.qcow'/>

      <target dev='vdc' bus='virtio'/>

    </disk>

 

    <disk type='file' device='cdrom'>

    <source file='/mnt/cache/domains/isos/win81.iso'/>

    <target dev='hda' bus='sata'/>

    <readonly/>

    </disk>

 

<interface type='bridge'>

<mac address='52:54:00:d0:c0:dc'/>

<source bridge='xenbr0'/>

<model type='virtio'/>

</interface>

 

<!-- BELOW IS REQUIRED -->

<controller type='usb' index='0' model='ich9-ehci1'>

<alias name='usb0'/>

<address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/>

</controller>

<controller type='usb' index='0' model='ich9-uhci1'>

<alias name='usb0'/>

<master startport='0'/>

<address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0' multifunction='on'/>

</controller>

<controller type='usb' index='0' model='ich9-uhci2'>

<alias name='usb0'/>

<master startport='2'/>

<address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x1'/>

</controller>

<controller type='usb' index='0' model='ich9-uhci3'>

<alias name='usb0'/>

<master startport='4'/>

<address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x2'/>

</controller>

 

<!-- EACH HOSTDEV IS A USB DEVICE -->

<hostdev mode='subsystem' type='usb'>

<source>

<vendor id='0x####'/>

<product id='0x####'/>

</source>

</hostdev>

 

<hostdev mode='subsystem' type='usb'>

<source>

<vendor id='0x####'/>

<product id='0x####'/>

</source>

</hostdev>

 

</devices>

 

<seclabel type='none' model='none'/>

 

<qemu:commandline>

<qemu:arg value='-device'/>

<qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>

<qemu:arg value='-device'/>

<!-- MODIFY BELOW LINE AFTER 'host=' BASED ON YOUR GPU DEVICE / AUDIO DEVICE -->

<qemu:arg value='vfio-pci,host=0#:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>

<qemu:arg value='-device'/>

<qemu:arg value='vfio-pci,host=0#:00.1,bus=pcie.0'/>/>

</qemu:commandline>

</domain>

 

Link to comment

Hi Jonp,

          My windows 8 VM is running ok but i think it could be better so I've just been doing a bit of a stare and compare between your xml and mine and I've found some differences.

 

In your xml you have this section.

 

      <controller type='usb' index='0' model='ich9-ehci1'>

        <alias name='usb0'/>

        <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/>

      </controller>

      <controller type='usb' index='0' model='ich9-uhci1'>

        <alias name='usb0'/>

        <master startport='0'/>

        <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0' multifunction='on'/>

      </controller>

      <controller type='usb' index='0' model='ich9-uhci2'>

        <alias name='usb0'/>

        <master startport='2'/>

        <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x1'/>

      </controller>

      <controller type='usb' index='0' model='ich9-uhci3'>

        <alias name='usb0'/>

        <master startport='4'/>

        <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x2'/>

      </controller>

 

My xml has the following in its place

 

  <controller type='sata' index='0'>

    </controller>

    <controller type='pci' index='0' model='pcie-root'/>

    <controller type='pci' index='1' model='dmi-to-pci-bridge'>

    </controller>

    <controller type='pci' index='2' model='pci-bridge'>

    </controller>

    <controller type='usb' index='0' model='none'>

    </controller>

 

I was just wondering whats the difference and whats the benefit of one over the other.

 

My other question is in your xml you have.

 

      <cputune>

        <vcpupin vcpu='0' cpuset='0'/>

        <vcpupin vcpu='1' cpuset='1'/>

        <vcpupin vcpu='2' cpuset='2'/>

        <vcpupin vcpu='3' cpuset='3'/>

      </cputune>

 

<topology sockets='2' cores='2' threads='1'/>

 

Which I'm guessing is pining vcpus to actual cores, is there any benefit in doing this and if you have a quad core CPU and you pin 4 vcpus to the 4 cores does that mean that you cant have any other VMs running at the same time?

 

I'm currently only really using my Win8 VM to run XBMC which i have feeding my main TV via a pair of HDMI/Cat5 extenders and it's working really well. The only issue i have is that if i reboot the host when my VM reboots the AMD HDMI sound device always has an error and cant start under device manager. Some times i can right click disable and re enable and it works. Some times i have to reboot the VM a couple of times until it starts. Once its started i can shut down and restart/reboot the VM as often as i want without it happening again until I reboot the host again.

 

I think if i can understand the config above and do a bit of fine tuning so that i'm 100% confident in the VM i'll be able to retire my physical HTPC and save a bit of space and power!

 

I'm also really looking forward to the release of the Unvm's!

 

Link to comment

Hi Jonp,

          My windows 8 VM is running ok but i think it could be better so I've just been doing a bit of a stare and compare between your xml and mine and I've found some differences.

 

I'm also looking forward to answers of your questions (I have that same controller section as you), and also these.

 

I'm answering my own questions disregard this one, id is a unique integer identifier for the running guest machine. Inactive machines have no id value.

 

The removal of this line, as I've seen it in all other examples

  • <memballoon model='virtio'/>

Link to comment

I just want to say that (keep in mind this is with my specific hardware), that as promising as GPU passthrough sounds to be, and as optimistic as I want to be, I am still have plenty of issues with it locking up my server completely and therefore forcing a parity check.

I'm 99% sure everything (xml, syslinux, bind in go script) is properly set, just that KVM with passthru hates me is all.

 

I have edited my XML with all suggested settings (even though the VM manger seems to add some stuff back in) removed any and all VNC references, etc... However (for me anyway) it is still VERY unstable.

If I reboot Windows 8.1 (with all updates) it never comes back up and freezes the computer.

 

If I install the newest AMD (beta) drivers without CCC as soon as I approve for it to reboot, it locks up the server. Then after a complete power off/on (to hopefully reset the GPU) Windows 8.1 will not load, it just spins, and spins, and spins forever which basically means I am S.O.L.

 

Prior to adding any type of passthru, everything works perfectly.

I've had a Win7 VM running for months now (no passthru) and I'd say it is mainly rock solid.

 

I'd really love to hear others experiences with this, maybe it's just me (AsRock Z97 Extreme 4 + AMD 5450GPU), however I am guessing others are having similar issues also.

 

 

 

 

Link to comment

I just want to say that (keep in mind this is with my specific hardware), that as promising as GPU passthrough sounds to be, and as optimistic as I want to be, I am still have plenty of issues with it not locking up my server completely and therefore forcing a parity check.

I'm 99% sure everything (xml, syslinux, bind in go script) is properly set, just that KVM with passthru hates me is all.

 

I have edited my XML with all suggested settings (even though the VM manger seems to add some stuff back in) removed any and all VNC references, etc... However (for me anyway) it is still VERY unstable.

If I reboot Windows 8.1 (with all updates) it never comes back up and freezes the computer.

 

If I install the newest AMD (beta) drivers without CCC as soon as I approve for it to reboot, it locks up the server. Then after a complete power off/on (to hopefully reset the GPU) Windows 8.1 will not load, it just spins, and spins, and spins forever which basically means I am S.O.L.

 

Prior to adding any type of passthru, everything works perfectly.

I've had a Win7 VM running for months now (no passthru) and I'd say it is mainly rock solid.

 

I'd really love to hear others experiences with this, maybe it's just me (AsRock Z97 Extreme 4 + AMD 5450GPU), however I am guessing others are having similar issues also.

AMD is still better on xen for windows.  You have to use wddm drivers for KVM and they come with limits.  We are hoping to see this resolved soon. There are other ways to tackle this problem that we will investigate soon.  For now, know these problems don't seem to affect our unELEC VM.

Link to comment

I appreciate the response, and promising path forward.

 

I had always thought that AMD was universally more compatible with pass-thru, however  you certainly know more about this than I.

I really look forward to updates, and the Openelec build that you've been teasing us with for quite some time now..  ::)

Link to comment

If you could please share specifically which drivers that you've used for Windows 8.1 with Nvidia & AMD Gpu's I think it'd be very helpful at this stage.

Thanks

 

For nVIDIA, we are using just latest drivers for Windows 8.1 and have been updating regularly without issue using a GeForce GTX 780.  That's on KVM though.

Link to comment
  • 2 weeks later...

I'm working on trying to get passthru working on a windows7 VM, under KVM, using vmMan plugin.

 

I've added this bit to the syslinux.cfg ...

label unRAID OS
  menu default
  kernel /bzimage
  append pcie_acs_override=multifunction initrd=/bzroot

 

I've seen some mention that some things need to be added to the go file, and other comments that it's not necessary, so I'm unclear on what all I need to do to get passthru working in my VM.

 

This is my current XML file ...

<domain type='kvm'>
  <name>Windows_7</name>
  <uuid>0abc2abb-a14e-8400-9a03-16c32a81fb61</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/cache/VM/Windows_7.qcow2'/>
      <target dev='hda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <interface type='bridge'>
      <mac address='00:16:3e:a7:b7:c7'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

This is what I suspect I need to add to the XML (or at least part of this, it's from my old XEN XML file, and some hardware may have changed)

 

<qemu:commandline>

<qemu:arg value='-device'/>

<qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>

<qemu:arg value='-device'/>

<qemu:arg value='vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>

<qemu:arg value='-device'/>

<qemu:arg value='vfio-pci,host=01:00.1,bus=root.1,addr=00.1'/>

<qemu:arg value='-device'/>

<qemu:arg value='vfio-pci,host=09:00.0,bus=pcie.0'/>

<qemu:arg value='-device'/>

<qemu:arg value='vfio-pci,host=00:14.0,bus=pcie.0'/>

<qemu:arg value='-device'/>

<qemu:arg value='vfio-pci,host=00:1b.0,bus=pcie.0'/>

</qemu:commandline>

 

So,

 

1) do I need to add anything to go file, and if so what

2) is the qemu stuff what I need to add to the XML?  I'll change/verify the specifics of each device, but is that generally what I need?

3) anything else I need to do?

Link to comment

I have this in my go file

/usr/local/sbin/vfio-bind 0000:04:00.0 0000:04:00.1 0000:00:1d.0

 

and this is part of my W8 xml file

 

 <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.1,bus=pcie.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:1d.0,bus=pcie.0'/>
  </qemu:commandline>
</domain>

 

and my complete W8 xml file

 

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>windows8</name>
  <uuid>cc411d70-4463-4db7-bf36-d364c0cdaa9d</uuid>

  <memory unit='GB'>4</memory>
  <currentMemory unit='GB'>4</currentMemory>

  <vcpu placement='static'>2</vcpu>
  <cpu mode='host-passthrough'>
  </cpu>

  <os>
    <type arch='x86_64' machine='q35'>hvm</type>
    <loader>/usr/share/qemu/bios-256k.bin</loader>
    <boot dev='hd'/>
  </os>

<features>
    <acpi/>
    <apic/>
    <pae/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
  </features>

  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='yes'/>
    <timer name='hypervclock' present='yes'/>
  </clock>

  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>

<pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>

  <devices>

    <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/vm_disk/KVM/Windows8/vm811.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/vm_disk/ISO/sv_windows_8_1_enterprise_x64_dvd_2972097.iso'/>
      <target dev='sdc' bus='sata'/>
      <readonly/>
    </disk>

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/vm_disk/ISO/virtio-win-0.1-81.iso'/>
      <target dev='sdd' bus='sata'/>
      <readonly/>
    </disk>

    <interface type='bridge'>
      <mac address='00:42:53:21:52:45'/>
      <source bridge='br0'/>
      <model type='virtio'/>
    </interface>

    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
    </controller>
    <controller type='sata' index='0'>
    </controller>
    <controller type='virtio-serial' index='0'>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
    </controller>

    <input type='mouse' bus='ps2'/>

    <memballoon model='virtio'>
      </memballoon>
    </devices>

<qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.1,bus=pcie.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:1d.0,bus=pcie.0'/>
  </qemu:commandline>
</domain>

 

Link to comment

I have this in my go file

/usr/local/sbin/vfio-bind 0000:04:00.0 0000:04:00.1 0000:00:1d.0

 

Thanks peter.  I've used your XML to modify mine, but I need to get the bit above to 'run' on the server, because the VM is failing to start.

 

Without rebooting the server, how do I get that command 'active' in the server?

 

thanks.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.