Jump to content

unRAID GPU Passthrough throws IOMMU errors

Hello everyone,

 

I'm pretty new to unRAID and VMs. I installed unRAID on an old (but beefy) PC of mine that i used to host servers on (TS3, MC, SE, etc.) in order to convert it into a family NAS as well as use its VM capabilities to run a windows 10 to host my servers. I plugged in 4 4TB drives (1 is parity) and a 128 gig SSD for cache and the NAS runs like a charm. Now onto VMs. I cannot get it to work with passthorugh devices. If i set the VM to use dedicated GPU or the motherboard's sound card, it gives IOMMU errors (below) and doesn't start. If i select VNC as graphics and no sound at all, it runs fine. I tried useing PCIe ACS override but no luck with it either. From what i could gather from extensive google-ing, it seems like proper VT-d support on the chipset i'm using is pretty hit/miss :/ . Machine Specs: Asus P6X58D Premium | Xeon X5650 | 12GB DDR3 RAM | GTX 1050 | RX 480 | 4x4TB NAS drives | 128GB SSD for cache | 120GB SSD for VM vDisks. GTX 1050 is in the top PCIe slot to be used by unRAID. I'm trying to passthrough the RX 480 to the VM (second PCIe Slot).

 

Any idea how i can fix this without getting a new mobo because that's kind of not possible atm (and my friends are w8ing for my servers :D )?

 

IOMMU report:

 

 
Spoiler

 


IOMMU group 0
	[8086:3405] 00:00.0 Host bridge: Intel Corporation 5520/5500/X58 I/O Hub to ESI Port (rev 13)
IOMMU group 1
	[8086:3408] 00:01.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 1 (rev 13)
IOMMU group 2
	[8086:3409] 00:02.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 2 (rev 13)
IOMMU group 3
	[8086:340a] 00:03.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 3 (rev 13)
IOMMU group 4
	[8086:340e] 00:07.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 7 (rev 13)
IOMMU group 5
	[8086:342e] 00:14.0 PIC: Intel Corporation 7500/5520/5500/X58 I/O Hub System Management Registers (rev 13)
	[8086:3422] 00:14.1 PIC: Intel Corporation 7500/5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers (rev 13)
	[8086:3423] 00:14.2 PIC: Intel Corporation 7500/5520/5500/X58 I/O Hub Control Status and RAS Registers (rev 13)
	[8086:3438] 00:14.3 PIC: Intel Corporation 7500/5520/5500/X58 I/O Hub Throttle Registers (rev 13)
IOMMU group 6
	[8086:3a37] 00:1a.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
	[8086:3a38] 00:1a.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5
	[8086:3a39] 00:1a.2 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
	[8086:3a3c] 00:1a.7 USB controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
IOMMU group 7
	[8086:3a3e] 00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
IOMMU group 8
	[8086:3a40] 00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 1
	[8086:3a44] 00:1c.2 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 3
	[8086:3a4a] 00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 6
	[11ab:4364] 05:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12)
	[11ab:4364] 06:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12)
IOMMU group 9
	[8086:3a34] 00:1d.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
	[8086:3a35] 00:1d.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
	[8086:3a36] 00:1d.2 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
	[8086:3a3a] 00:1d.7 USB controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1
IOMMU group 10
	[8086:244e] 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)
	[1106:3044] 08:02.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev c0)
IOMMU group 11
	[8086:3a16] 00:1f.0 ISA bridge: Intel Corporation 82801JIR (ICH10R) LPC Interface Controller
	[8086:3a22] 00:1f.2 SATA controller: Intel Corporation 82801JI (ICH10 Family) SATA AHCI Controller
	[8086:3a30] 00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller
IOMMU group 12
	[1b4b:9123] 01:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9123 PCIe SATA 6.0 Gb/s controller (rev 10)
IOMMU group 13
	[1033:0194] 02:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)
IOMMU group 14
	[10de:1c81] 03:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050] (rev a1)
	[10de:0fb9] 03:00.1 Audio device: NVIDIA Corporation Device 0fb9 (rev a1)
IOMMU group 15
	[1002:67df] 04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480] (rev c7)
	[1002:aaf0] 04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device aaf0
IOMMU group 16
	[8086:2c70] ff:00.0 Host bridge: Intel Corporation Xeon 5600 Series QuickPath Architecture Generic Non-core Registers (rev 02)
	[8086:2d81] ff:00.1 Host bridge: Intel Corporation Xeon 5600 Series QuickPath Architecture System Address Decoder (rev 02)
IOMMU group 17
	[8086:2d90] ff:02.0 Host bridge: Intel Corporation Xeon 5600 Series QPI Link 0 (rev 02)
	[8086:2d91] ff:02.1 Host bridge: Intel Corporation Xeon 5600 Series QPI Physical 0 (rev 02)
	[8086:2d92] ff:02.2 Host bridge: Intel Corporation Xeon 5600 Series Mirror Port Link 0 (rev 02)
	[8086:2d93] ff:02.3 Host bridge: Intel Corporation Xeon 5600 Series Mirror Port Link 1 (rev 02)
	[8086:2d94] ff:02.4 Host bridge: Intel Corporation Xeon 5600 Series QPI Link 1 (rev 02)
	[8086:2d95] ff:02.5 Host bridge: Intel Corporation Xeon 5600 Series QPI Physical 1 (rev 02)
IOMMU group 18
	[8086:2d98] ff:03.0 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Registers (rev 02)
	[8086:2d99] ff:03.1 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Target Address Decoder (rev 02)
	[8086:2d9a] ff:03.2 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller RAS Registers (rev 02)
	[8086:2d9c] ff:03.4 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Test Registers (rev 02)
IOMMU group 19
	[8086:2da0] ff:04.0 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 0 Control (rev 02)
	[8086:2da1] ff:04.1 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 0 Address (rev 02)
	[8086:2da2] ff:04.2 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 0 Rank (rev 02)
	[8086:2da3] ff:04.3 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 0 Thermal Control (rev 02)
IOMMU group 20
	[8086:2da8] ff:05.0 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 1 Control (rev 02)
	[8086:2da9] ff:05.1 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 1 Address (rev 02)
	[8086:2daa] ff:05.2 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 1 Rank (rev 02)
	[8086:2dab] ff:05.3 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 1 Thermal Control (rev 02)
IOMMU group 21
	[8086:2db0] ff:06.0 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 2 Control (rev 02)
	[8086:2db1] ff:06.1 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 2 Address (rev 02)
	[8086:2db2] ff:06.2 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 2 Rank (rev 02)
	[8086:2db3] ff:06.3 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 2 Thermal Control (rev 02)


 

 

 

Error log from trying to launch a VM:

 

Spoiler

2017-04-27 16:01:30.249+0000: starting up libvirt version: 2.4.0, qemu version: 2.7.1, hostname: HomeNAS
LC_ALL=C PATH=/bin:/sbin:/usr/bin:/usr/sbin HOME=/ QEMU_AUDIO_DRV=none /usr/local/sbin/qemu -name 'guest=Windows 10,debug-threads=on' -S -object 'secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-Windows 10/master-key.aes' -machine pc-i440fx-2.7,accel=kvm,usb=off,dump-guest-core=off,mem-merge=off -cpu host,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vendor_id=none -drive file=/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd,if=pflash,format=raw,unit=0,readonly=on -drive file=/etc/libvirt/qemu/nvram/9763e8eb-2b5a-476f-9175-233c612de194_VARS-pure-efi.fd,if=pflash,format=raw,unit=1 -m 4096 -realtime mlock=off -smp 4,sockets=1,cores=2,threads=2 -uuid 9763e8eb-2b5a-476f-9175-233c612de194 -display none -no-user-config -nodefaults -chardev 'socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-4-Windows 10/monitor.sock,server,nowait' -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-hpet -no-shutdown -boot strict=on -device nec-ws 10/org.qemu.guest_agent.0,server,nowait' -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -device vfio-pci,host=04:00.0,id=hostdev0,bus=pci.0,addr=0x6 -device vfio-pci,host=00:1b.0,id=hostdev1,bus=pci.0,addr=0x8 -device usb-host,hostbus=7,hostaddr=3,id=hostdev2,bus=usb.0,port=1 -device usb-host,hostbus=7,hostaddr=2,id=hostdev3,bus=usb.0,port=2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x9 -msg timestamp=on
Domain id=4 is tainted: high-privileges
Domain id=4 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)
2017-04-27T16:01:30.366602Z qemu-system-x86_64: -device vfio-pci,host=04:00.0,id=hostdev0,bus=pci.0,addr=0x6: vfio: failed to set iommu for container: Operation not permitted
2017-04-27T16:01:30.366635Z qemu-system-x86_64: -device vfio-pci,host=04:00.0,id=hostdev0,bus=pci.0,addr=0x6: vfio: failed to setup container for group 15
2017-04-27T16:01:30.366641Z qemu-system-x86_64: -device vfio-pci,host=04:00.0,id=hostdev0,bus=pci.0,addr=0x6: vfio: failed to get group 15
2017-04-27T16:01:30.366657Z qemu-system-x86_64: -device vfio-pci,host=04:00.0,id=hostdev0,bus=pci.0,addr=0x6: Device initialization failed

 

I posted this on reddit and unRAID's own forums which seem to be deserted on the KVM topic. Since posting this i tried some things:

Moving GPUs around PCIe slots = no luck.

PCIe ACS Override = no luck.

PCIe ACS Override + vfio_iommu_type1.allow_unsafe_interrupts=1 in syslinux.cfg allows the VM to start but causes the following:

With the RX480 as the passthrough device, it renders bright green squares on the screen for a few seconds after VM startup and then shows the "press any key to boot", again in green. If i press a key and send it to boot it starts loading windows, again with inproer green rendering and then crashes and the entire unRAID server hangs up.

With the GTX1050 as a passthrough, it fires up the OVMF UEFI emulated bios after starting the VM. When i leave it and proceed to boot the windows installer, it start loading and hangs up again like with the RX480 (subsequently crashing the whole unRAID server a few seconds later as well), but the GTX1050 renders properly - no green artifacts and whatnot.

Both of these didn't leave anything in the logs for me to investigate thou.

 

You are my last hope LTT forum people. I'm really liking unRAID as a NAS, I just need to get these VMs to work properly.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, SCHISCHKA said:

i suggest go through the arch wiki. Its got more information than any tutorial. It also has a hardware list. Can you please put the stuff you copied from terminal output into a "spoiler" box? its hard to read.

https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF

I came across this before but couldn't find anything helpful :(

Link to comment
Share on other sites

Link to post
Share on other sites

 

1 hour ago, alexfsr said:

With the GTX1050 as a passthrough, it fires up the OVMF UEFI emulated bios after starting the VM. When i leave it and proceed to boot the windows installer, it start loading and hangs up again like with the RX480 (subsequently crashing the whole unRAID server a few seconds later as well), but the GTX1050 renders properly - no green artifacts and whatnot.

so what happens if you install windows through VNC (and maybe install GPU drivers), then reboot it with VGA passthrough? sounds like passthrough is working but its a windows problem. download the iso again? does it work flawlessly with a linux live cd?

             ☼

ψ ︿_____︿_ψ_   

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, SCHISCHKA said:

 

so what happens if you install windows through VNC (and maybe install GPU drivers), then reboot it with VGA passthrough? sounds like passthrough is working but its a windows problem. download the iso again? does it work flawlessly with a linux live cd?

Booting the VM with VNC as vga adapter and no audio boots fine with default config (no acs override). I haven't tried installing it with VNC and loading the drivers (which iirc won't work since driver installers check for gpu presence?). Haven't tried booting linux live cd as a VM.

The problem is with KVM/QEMU. It can't access PCIe devices properly for some reason. If i don't have the acs override and vfio_iommu_type1.allow_unsafe_interrupts=1 in the syslinux.cfg, VMs don't start at all. This eddit to the cfg (the unsafe interrupts=1) basically forces KVM/QEMU to ingore the problem and boot anyways from what i could gather. But since the underlying problem is still there, it boots broken (crashing / improper rendering). The improper rendering with the RX480 leads me to believe the VM can't communicate with the GPU properly (hence the weird green squares/text), although the GTX1050 doesn't have this problem and it boots seemingly fine, it just crashes the entire unRAID server when it starts loading the windows installation.

Link to comment
Share on other sites

Link to post
Share on other sites

47 minutes ago, alexfsr said:

(which iirc won't work since driver installers check for gpu presence?)

iv never actually tried to install drivers without hardware, thats why i put it in brackets and said maybe.

48 minutes ago, alexfsr said:

If i don't have the acs override and vfio_iommu_type1.allow_unsafe_interrupts=1 in the syslinux.cfg, VMs don't start at all.

thats what your supposed to do. I thought its purpose was to block the host from using the PCI group, i.e. ignore any interrupts coming from it.

49 minutes ago, alexfsr said:

The improper rendering with the RX480 leads me to believe the VM can't communicate with the GPU properly (hence the weird green squares/text), although the GTX1050 doesn't have this problem and it boots seemingly fine, it just crashes the entire unRAID server when it starts loading the windows installation.

Some GPUs don't work I know that much. Your cards are pretty new so there won't be much documented.

 

 

             ☼

ψ ︿_____︿_ψ_   

Link to comment
Share on other sites

Link to post
Share on other sites

On 4/29/2017 at 4:05 AM, SCHISCHKA said:

iv never actually tried to install drivers without hardware, thats why i put it in brackets and said maybe.

thats what your supposed to do. I thought its purpose was to block the host from using the PCI group, i.e. ignore any interrupts coming from it.

Some GPUs don't work I know that much. Your cards are pretty new so there won't be much documented.

 

 

So i'm basically stranded here... Bummer

Link to comment
Share on other sites

Link to post
Share on other sites

Set your VM to use a single core, assign max 8GB of memory, set Hyper-V to "No", set machine type to the latest i440fx version, use OVMF, set VNC as the only graphical adapter.

Install Windows 10. (you won't be able to install your nvidia drivers, that's fine).

Reboot to make sure it reboots fine.

Set your CPUs and Memory back to what you need, remove the VNC adapter and replace it with your nvidia card. Make sure you also pass through the NVidia Audio.

Boot the VM.

Success ?

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...
On 5/4/2017 at 7:46 PM, Ti133700N said:

Set your VM to use a single core, assign max 8GB of memory, set Hyper-V to "No", set machine type to the latest i440fx version, use OVMF, set VNC as the only graphical adapter.

Install Windows 10. (you won't be able to install your nvidia drivers, that's fine).

Reboot to make sure it reboots fine.

Set your CPUs and Memory back to what you need, remove the VNC adapter and replace it with your nvidia card. Make sure you also pass through the NVidia Audio.

Boot the VM.

Success ?

After 4 painful hours i got a Win 10 running with 2 core and their 2 threads with 4 gigs of RAM, VNC as graphics adapter and no sound of any sort. It runs fine (the 4 hours i spent installing drivers and stuff because my mouse derped in VNC everytime and i had to do it all only with a keyboard). I'm scared to try to edit it to passthrough the gpu now because the unRAID server is now actively used for storage and so far all my attempts with the gpu passthrough ended with the entire unRAID system hanging up. But i have to try i guess.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×