(SOLVED) - Need help with usb controller passthrough


Recommended Posts

I am running unraid 6.2 beta 21 and current have the wireless xbox dongle passed through as a device (simply by checking the checkbox during vm creation). On a fresh boot of the host machine I can load up a game and use the xbox controller fine for a random period of time (sometimes couple of minutes to ten minutes) before the light on the receiver turns off and it is no longer recognised by Windows 10.

 

Other usb devices like my microphone, mouse and keyboard however don't exhibit this behaviour.

 

What I have tried:

 

- Restarting the vm. Doesn't appear to help, requires a full reboot of the host to get it back

- Changing the usb mode when starting the vm; 2.0 (EHCI) / 3.0 (XHCI)

- Tried different usb 2 and 3 ports on the machine

- Disabling / Re-enabling the xbox controller in device manager (says it requires a restart but and cosequently restarting doesn't help resolve the issue)

- Removing and re-inserting usb into same socket (hot-plug doesn't look like it works)

host_log_after_dropout.png.47a2870e52539bc10cfc10769b8b4021.png

device_manager_after_dropout.png.bd11fc2fcc3887cab398e6077ed77fb6.png

Link to comment

How are you passing the XBOX controller though to the VM?

 

Mine will only work with the whole  USB port/hub passed through to the VM rather than the individual controller.

 

I think this might be my problem. I am just ticking the boxes for the devices passed in when creating the vm. I did see the sticky at the top of the forum about usb controller passthrough. I looked at the date of the first post from jonp though and it was from the middle of last year. I figured with 6.2 beta being out now it wasn't needed but looks like I was wrong.

 

When I get home later tonight I am hoping to have a look at editing the vm config and passing through the usb hub / controller. Will update with any news of how I get on.

Link to comment

I used to have to passthough the whole usb controller aswell, to get my 360 controller working correctly.

 

However using 6.2 beta 21  and  now using ovmf instead of seabios, i find my 360 wireless works fine without having to passthrough the usb contoller.

 

Interesting. Can you elaborate any more on this? Maybe there is something different in your environment because just passing the device through still causes dropouts for me and I am also on 6.2 beta 21 and using ovmf.

Link to comment

Can anybody help with the usb controller passthrough?  On a clean vm installation with vnc the controller shows up correctly for pass through and I was able to install a fresh copy of w10. Once I got into windows I shutdown the system and clicked edit to change vnc back to passing through the video card with associated hdmi audio. I then edited the xml to ensure the manually added usb controller passthrough was set correctly. From this point firing up the vm I just get a blank display. Everything i have tried has not allowed me to pas this usb controller through with gpu passthrough enabled.

 

My wireless xbox dongle is slot '0x1a'.

 

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

 

[VM XML]

<domain type='kvm'>
  <name>Joshua</name>
  <uuid>03841261-50c0-4c28-766d-fefc9d09a6cf</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='3'/>
    <vcpupin vcpu='4' cpuset='4'/>
    <vcpupin vcpu='5' cpuset='5'/>
    <vcpupin vcpu='6' cpuset='6'/>
    <vcpupin vcpu='7' cpuset='7'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/03841261-50c0-4c28-766d-fefc9d09a6cf_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor id='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='4' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/cache/vdisks/PC2/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/ISO/Win10_1511_1_N_English_x64.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/ISO/virtio-win-0.1.112-1.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:7b:d2:b8'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <source mode='connect'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1a' function='0x0'/>
        <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc049'/>
      </source>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Link to comment

Sorry, totally forgot to add these.

 

[PCI Devices]

 

0:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 Processor Family DRAM Controller [8086:0108] (rev 09)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port [8086:0101] (rev 09)
00:01.1 PCI bridge [0604]: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port [8086:0105] (rev 09)
00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)
00:16.0 Communication controller [0780]: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 [8086:1e3a] (rev 04)
00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)
00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)
00:1c.0 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 [8086:1e10] (rev c4)
00:1c.4 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 5 [8086:1e18] (rev c4)
00:1c.5 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev c4)
00:1c.6 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 7 [8086:1e1c] (rev c4)
00:1c.7 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 8 [8086:1e1e] (rev c4)
00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)
00:1f.0 ISA bridge [0601]: Intel Corporation Z77 Express Chipset LPC Controller [8086:1e44] (rev 04)
00:1f.2 RAID bus controller [0104]: Intel Corporation SATA Controller [RAID mode] [8086:2822] (rev 04)
00:1f.3 SMBus [0c05]: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller [8086:1e22] (rev 04)
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
02:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
02:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
04:00.0 USB controller [0c03]: VIA Technologies, Inc. VL80x xHCI USB 3.0 Controller [1106:3432] (rev 03)
05:00.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev 41)
07:00.0 Ethernet controller [0200]: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet [1969:1083] (rev c0)
08:00.0 SATA controller [0106]: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller [1b4b:9172] (rev 11)

 

[iOMMU Groups]

 

/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:00:01.1
/sys/kernel/iommu_groups/1/devices/0000:01:00.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.1
/sys/kernel/iommu_groups/1/devices/0000:02:00.0
/sys/kernel/iommu_groups/1/devices/0000:02:00.1
/sys/kernel/iommu_groups/2/devices/0000:00:14.0
/sys/kernel/iommu_groups/3/devices/0000:00:16.0
/sys/kernel/iommu_groups/4/devices/0000:00:1a.0
/sys/kernel/iommu_groups/5/devices/0000:00:1b.0
/sys/kernel/iommu_groups/6/devices/0000:00:1c.0
/sys/kernel/iommu_groups/7/devices/0000:00:1c.4
/sys/kernel/iommu_groups/8/devices/0000:00:1c.5
/sys/kernel/iommu_groups/8/devices/0000:05:00.0
/sys/kernel/iommu_groups/9/devices/0000:00:1c.6
/sys/kernel/iommu_groups/10/devices/0000:00:1c.7
/sys/kernel/iommu_groups/11/devices/0000:00:1d.0
/sys/kernel/iommu_groups/12/devices/0000:00:1f.0
/sys/kernel/iommu_groups/12/devices/0000:00:1f.2
/sys/kernel/iommu_groups/12/devices/0000:00:1f.3
/sys/kernel/iommu_groups/13/devices/0000:04:00.0
/sys/kernel/iommu_groups/14/devices/0000:07:00.0
/sys/kernel/iommu_groups/15/devices/0000:08:00.0

 

[uSB Devices]

Bus 002 Device 003: ID 046d:c049 Logitech, Inc. G5 Laser Mouse
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 002: ID 2109:0811 VIA Labs, Inc. Hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0556:0001 Asahi Kasei Microsystems Co., Ltd AK5370 I/F A/D Converter
Bus 001 Device 004: ID 1532:010b Razer USA, Ltd 
Bus 001 Device 003: ID 045e:0719 Microsoft Corp. Xbox 360 Wireless Adapter
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 18a5:0243 Verbatim, Ltd 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

 

I have also tried creating a fresh vm and only ticking the logitec g5 mouse device as it is on another controller that is not passed through ( couldn't get it to work when it was plugged into the passed through controller). The mouse would freeze in unraid as soon as unraid loaded even know the vm wasn't even started.

 

I then manually edited the xml and adding the following to pass through the usb controller the other devices were connected too

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

Link to comment

Right.

looking at your iommu groups there is a problem.

/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:00:01.1
/sys/kernel/iommu_groups/1/devices/0000:01:00.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.1
/sys/kernel/iommu_groups/1/devices/0000:02:00.0
/sys/kernel/iommu_groups/1/devices/0000:02:00.1

In group 1 you have both your gpus and a pci bridge. You need to split these up into individual groups. Try enabling acs override  under settings, vm settings. You will have to reboot server after for this to take effect.

Now with any luck your gpus will be in separate groups on their own.

 

Please try this and report back

Link to comment

Right.

looking at your iommu groups there is a problem.

/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:00:01.1
/sys/kernel/iommu_groups/1/devices/0000:01:00.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.1
/sys/kernel/iommu_groups/1/devices/0000:02:00.0
/sys/kernel/iommu_groups/1/devices/0000:02:00.1

In group 1 you have both your gpus and a pci bridge. You need to split these up into individual groups. Try enabling acs override  under settings, vm settings. You will have to reboot server after for this to take effect.

Now with any luck your gpus will be in separate groups on their own.

 

Please try this and report back

 

Thanks for looking into this GridRunner I have been pulling my hair out. I new the two gpus were in the same iommu group but I didn't notice the pci bridge was too. Whilst I realise this currently prevents running to vm's how does it prevent usb controller passthrough from working. I would have thought the usb controller was separate? I guess if the usb controller is in the same iommu group as the pci bridge it interferes with gpu passthrough. Would explain why I have been having a hard time of it.

 

I had actually tried enabling acs override before but it didn't seem to enable properly. When I went to the vm manager and enabled it, it put up a coloured note / message on the page saying to reboot for changes to take effect. So I rebooted the host and came back in and it said the same thing. Tried this a few times. I was beginning to wonder if I had run into a bug in beta 21. I am not aware of anyone reporting an issue with enabling acs override however. I will have another try tonight when I am home from work and report back.

Link to comment

Still having an issue enabling ACS Override in the web gui. It says to reboot for changes to take effect and upon rebooting the machine and going back in to check the vm settings the message is still there saying "You must reboot for changes to take effect". Checking the IOMMU groupings confirms that ACS Override has not been applied.

 

How do I enable this manually through config?

Link to comment

change your syslinux config file file from this part

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

 

to this part

 

label unRAID OS
  menu default
  kernel /bzimage
[b] append pcie_acs_override=downstream initrd=/bzroot[/b]

 

if that doesnt work then try this

  menu default
  kernel /bzimage
  append intel_iommu=on pcie_acs_override=downstream vfio_iommu_type1.allow_unsafe_interrupts=1 initrd=/bzroot,/bzroot-gui

 

you can always check if the syslinux config file has changed by going to the main tab then clicking on flash.

For some reason i have found that edits in the syslinux config has taken 2 or 3 reboots to take effect in the beta 21. I thought it was just me but maybe not?? http://lime-technology.com/forum/index.php?topic=48383.msg464311#msg464311

 

Link to comment

change your syslinux config file file from this part

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

 

to this part

 

label unRAID OS
  menu default
  kernel /bzimage
[b] append pcie_acs_override=downstream initrd=/bzroot[/b]

 

if that doesnt work then try this

  menu default
  kernel /bzimage
  append intel_iommu=on pcie_acs_override=downstream vfio_iommu_type1.allow_unsafe_interrupts=1 initrd=/bzroot,/bzroot-gui

 

you can always check if the syslinux config file has changed by going to the main tab then clicking on flash.

For some reason i have found that edits in the syslinux config has taken 2 or 3 reboots to take effect in the beta 21. I thought it was just me but maybe not?? http://lime-technology.com/forum/index.php?topic=48383.msg464311#msg464311

 

Yes it looks like a bug. I reported the following here: http://lime-technology.com/forum/index.php?topic=46086.msg468267#msg468267

 

I have ACS_Override working now. I will post my new devices and groups.

 

[PCI Devices]

 

00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 Processor Family DRAM Controller [8086:0108] (rev 09)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port [8086:0101] (rev 09)
00:01.1 PCI bridge [0604]: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port [8086:0105] (rev 09)
00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)
00:16.0 Communication controller [0780]: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 [8086:1e3a] (rev 04)
00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)
00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)
00:1c.0 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 [8086:1e10] (rev c4)
00:1c.4 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 5 [8086:1e18] (rev c4)
00:1c.5 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev c4)
00:1c.6 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 7 [8086:1e1c] (rev c4)
00:1c.7 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 8 [8086:1e1e] (rev c4)
00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)
00:1f.0 ISA bridge [0601]: Intel Corporation Z77 Express Chipset LPC Controller [8086:1e44] (rev 04)
00:1f.2 RAID bus controller [0104]: Intel Corporation SATA Controller [RAID mode] [8086:2822] (rev 04)
00:1f.3 SMBus [0c05]: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller [8086:1e22] (rev 04)
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
02:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
02:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
04:00.0 USB controller [0c03]: VIA Technologies, Inc. VL80x xHCI USB 3.0 Controller [1106:3432] (rev 03)
05:00.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev 41)
07:00.0 Ethernet controller [0200]: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet [1969:1083] (rev c0)
08:00.0 SATA controller [0106]: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller [1b4b:9172] (rev 11)

 

[iOMMU Groups]

 

/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/2/devices/0000:00:01.1
/sys/kernel/iommu_groups/3/devices/0000:00:14.0
/sys/kernel/iommu_groups/4/devices/0000:00:16.0
/sys/kernel/iommu_groups/5/devices/0000:00:1a.0
/sys/kernel/iommu_groups/6/devices/0000:00:1b.0
/sys/kernel/iommu_groups/7/devices/0000:00:1c.0
/sys/kernel/iommu_groups/8/devices/0000:00:1c.4
/sys/kernel/iommu_groups/9/devices/0000:00:1c.5
/sys/kernel/iommu_groups/10/devices/0000:00:1c.6
/sys/kernel/iommu_groups/11/devices/0000:00:1c.7
/sys/kernel/iommu_groups/12/devices/0000:00:1d.0
/sys/kernel/iommu_groups/13/devices/0000:00:1f.0
/sys/kernel/iommu_groups/13/devices/0000:00:1f.2
/sys/kernel/iommu_groups/13/devices/0000:00:1f.3
/sys/kernel/iommu_groups/14/devices/0000:01:00.0
/sys/kernel/iommu_groups/14/devices/0000:01:00.1
/sys/kernel/iommu_groups/15/devices/0000:02:00.0
/sys/kernel/iommu_groups/15/devices/0000:02:00.1
/sys/kernel/iommu_groups/16/devices/0000:04:00.0
/sys/kernel/iommu_groups/17/devices/0000:05:00.0
/sys/kernel/iommu_groups/18/devices/0000:07:00.0
/sys/kernel/iommu_groups/19/devices/0000:08:00.0

 

[uSB Devices]

Bus 002 Device 003: ID 046d:c049 Logitech, Inc. G5 Laser Mouse
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 002: ID 2109:0811 VIA Labs, Inc. Hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0556:0001 Asahi Kasei Microsystems Co., Ltd AK5370 I/F A/D Converter
Bus 001 Device 004: ID 1532:010b Razer USA, Ltd 
Bus 001 Device 003: ID 045e:0719 Microsoft Corp. Xbox 360 Wireless Adapter
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 18a5:0243 Verbatim, Ltd 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

So it looks like it is on the same bus,  but split out now which is good. Is it just a matter of manually editing the xml and adding the following?

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

Link to comment

My virtual machine xml looks like this:

 

<domain type='kvm' id='1'>
  <name>Test</name>
  <uuid>605392bd-d34c-46d9-16b3-dc6fffa90c90</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='3'/>
    <vcpupin vcpu='4' cpuset='4'/>
    <vcpupin vcpu='5' cpuset='5'/>
    <vcpupin vcpu='6' cpuset='6'/>
    <vcpupin vcpu='7' cpuset='7'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/605392bd-d34c-46d9-16b3-dc6fffa90c90_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor id='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='4' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/cache/vdisks/PC2/vdisk1.img'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/ISO/Win10_1511_1_N_English_x64.iso'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/ISO/virtio-win-0.1.112-1.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' 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='0x07' 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='0x07' 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='0x07' 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>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:f9:8b:56'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-Test/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
      </source>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1a' function='0x0'/>
      </source>
      <alias name='hostdev3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc049'/>
        <address bus='2' device='3'/>
      </source>
      <alias name='hostdev4'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Still getting a blank screen. I have attached he vm log.

vm_error.jpg.6ea03ef272931b79743d778e20990dbf.jpg

Link to comment

Ok so I have created a fresh virtual machine with vnc graphics and then manually entered the following for usb controller passthrough

 

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

 

This works, and I was able to install windows and then test hotplug capability.

 

I then shutdown the vm and changed vnc to the first video card at 01:00:0 and got a blank screen. Is this on the same bus 1?

 

This time I tried gpu on 02:00:0 and the vm boots into windows fine with usb passthrough working. Is there anything I can do to get a vm working on gpu 1? Does it mean I can't use pcie slot 1 at all if I pass through the controller that appears to be sharing it?

 

Feel like I'm making some progress now, albeit slowly.

Link to comment

So you can pass it through as long as the system uses vnc or gpu 2. Thats strange

 

Have you stubbed the usb before pass through. Looking at the usb devices showing your 360 controller listed it looks like its not stubbed.

This is the controller you want to pass through yes?

00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)

 

Are you sure your unraid flash isnt connected to this. If its not add this to your syslinux conf file

 

label unRAID OS
  menu default
  kernel /bzimage
  append vfio-pci.ids=8086:1e2d pcie_acs_override=downstream initrd=/bzroot

 

the  vfio-pci.ids=8086:1e2d is stubbing that usb controller from unraid. Now it will be in the gui for passthrough, just check it to pass it through

Link to comment

before you try doing what i said in the last post please try adding your passthrough code like this

removing  <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>

 

<hostdev mode='subsystem' type='pci' managed='yes'>

      <driver name='vfio'/>

      <source>

        <address domain='0x0000' bus='0x00' slot='0x1a' function='0x0'/>

      </source>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>

    </hostdev>

 

so it looks like this

 

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

 

Once you save the xml file the correct address part will be automatically inserted

Link to comment

before you try doing what i said in the last post please try adding your passthrough code like this

removing  <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>

 

<hostdev mode='subsystem' type='pci' managed='yes'>

      <driver name='vfio'/>

      <source>

        <address domain='0x0000' bus='0x00' slot='0x1a' function='0x0'/>

      </source>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>

    </hostdev>

 

so it looks like this

 

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

 

Once you save the xml file the correct address part will be automatically inserted

 

Yes when I manually edit it I always remove that part and let it be automatically inserted with the correct address.

Link to comment

So you can pass it through as long as the system uses vnc or gpu 2. Thats strange

 

Have you stubbed the usb before pass through. Looking at the usb devices showing your 360 controller listed it looks like its not stubbed.

 

I haven't stubbed anything no. What does stubbing do?

 

This is the controller you want to pass through yes?

00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)

 

Yes that's the correct usb controller.

 

Are you sure your unraid flash isnt connected to this. If its not add this to your syslinux conf file

 

label unRAID OS
  menu default
  kernel /bzimage
  append vfio-pci.ids=8086:1e2d pcie_acs_override=downstream initrd=/bzroot

 

the  vfio-pci.ids=8086:1e2d is stubbing that usb controller from unraid. Now it will be in the gui for passthrough, just check it to pass it through

 

I don't think so. The unraid usb is on bus 004 from memory.

 

Do you mind just explaining the stubbing from boot? is this an alternative to manually editing the vm xml and adding a hostdev?

 

Thank you very much for your help so far. I'm so close!

Link to comment

Okay, stubbing the device basically blacklists it from being used by unraid system. The host system will not load any drivers etc for it.

Therefore it is only then available for passthrough by the vms. You will notice when you have it stubbed when you plug a usb device into that usb controller the usb device you plugged in will not be listed by unraid as a usb device.

However the whole controller can be passed to the vm.

Once it is stubbed you can then passthrough that device from the gui of unraid (as of 6.2) without having to do manual edits the xml.

 

 

Link to comment

I used to have to passthough the whole usb controller aswell, to get my 360 controller working correctly.

 

However using 6.2 beta 21  and  now using ovmf instead of seabios, i find my 360 wireless works fine without having to passthrough the usb contoller.

 

I have the same setup and it's working as well.

Link to comment

Okay, stubbing the device basically blacklists it from being used by unraid system. The host system will not load any drivers etc for it.

Therefore it is only then available for passthrough by the vms. You will notice when you have it stubbed when you plug a usb device into that usb controller the usb device you plugged in will not be listed by unraid as a usb device.

However the whole controller can be passed to the vm.

Once it is stubbed you can then passthrough that device from the gui of unraid (as of 6.2) without having to do manual edits the xml.

 

Thanks for explaining that Gridrunner. Makes sense. I'm going to play around with that tonight.

 

I used to have to passthough the whole usb controller aswell, to get my 360 controller working correctly.

 

However using 6.2 beta 21  and  now using ovmf instead of seabios, i find my 360 wireless works fine without having to passthrough the usb contoller.

 

I have the same setup and it's working as well.

 

Geez you two are lucky. I had no such luck in beta 21 with OVMF. My 360 controller kept on dropping out and I couldn't wake windows up from sleep state when the monitor turned off (I guess because the mouse and keyboard had disconnected?). Glad to know things are still improving though and slowly getting easier for some.

 

Is this a usb 3 thing? I have my dongle plugged into usb 3 but the controller governing it being passed through to windows looks to be a usb 2 hub. Maybe this is to do with a setting in the  bios?

Link to comment

 

label unRAID OS
  menu default
  kernel /bzimage
  append vfio-pci.ids=8086:1e2d pcie_acs_override=downstream initrd=/bzroot

 

the  vfio-pci.ids=8086:1e2d is stubbing that usb controller from unraid. Now it will be in the gui for passthrough, just check it to pass it through

 

I have stubbed  the controller as above and it does show up for passthrough when editing the vm. I removed  the manually entered entry and then re-saved the vm with the pci stub device to be passed through (still had gpu 2 selected at this point). Appears to lock up the system.Even though my mouse is not on that controller, the screen for the web gui appears to freeze and and I can't move the mouse by changing it into any usb connection. Additionally, the vm display never turns on from gpu 2.

 

So so far I have been able to:

 

- Enable acs_override

- Manually pass through the controller bus by editing the vm

- Pass through and start the vm on gpu 2:00:0

 

This worked flawlessly and I played an hour of the witcher 3 on my xbox controller last night :)

 

Since then I have stubbed the usb controller on boot and tried to start the vm on either gpu and nothing works. Is there anything else wrong with my devices or groups?

 

UPDATE:

 

I think I have found a bug with ovmf and booting the boot media (vdisk). I can consistently reproduce changing the display adapter or other settings, re-setting the vdisk (since that resets due to anotehr bug) and saving. Starting the vm produces a blank screen.

 

Changing the vm to vnc and starting shows that the boot media isn't loaded.

 

Manually loading it via..

 

fs1: <- windows vdisk
cd efi
cd boot
bootx64.efi

 

- Shutdown the vm once it gets to windows logon

- Restart vm to make sure it auto boots back into windows correctly

- Shutdown vm

- Edit vm through the edtior and change vnc device to gpu 2

- Re-set primary boot dropdown to vdisk (due to the bug that clears it)

- Starting the vm now behaves correctly with gpu passthrough and usb controller passthrough via stubbed option. Phew!

 

Now, I'm going to try the entire process again and set the vm  to start on gpu1 and see if passthrough on the first amd gpu will work.

Link to comment

GridRunner I would like to thank you especially for taking the time to follow this through with me. I am going to mark this thread as solved as the initial problem of the xbox controller dropping out, and by extension passing through the usb controller, has been solved.

 

I am now able to successfully stub the usb controller so it doesn't show the devices in unraid and can pass through to a vm. Additionally, I am now able to start the vm on either gpu 1 or gpu 2. I am still having an issue with running these two at the same time but as that is off topic and more related to gpu pass through, I will open a separate thread so this one can be closed.

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.