Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

[ubuntu] VGA Passthrough with KVM - Guest/Host crash during AMD driver install into Guest

$
0
0
tldr; VGA passthrough seems fully functional and stable with either Win7 or Win8.1 UNTIL I attempt to install the AMD video drivers into the Guest OS. Almost immediately the VM will hang and at the same time my Host OS hangs as well. I have to reboot to recover from it.

Software Configuration
Ubuntu 14.04.3
Default unmodified kernel 3.19.0-31-generic
qemu 2.1.2 from the default repo

Hardware Configuration
HP Proliant ML10 socket 1155 Motherboard (732594-001) with onboard Matrox G200EH GPU/IPMI
Intel Xeon E3-1245v2 CPU
24GB Kingston DDR3 ECC Memory
3x LSI 9240-8i Raid Controllers
XFX Radeon 7850 1GB GPU (FX-785A-ZNBR) (No EUFI GOP support)

KVM Configuration
iommu groups
Code:

### Group 0 ###
    00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/Ivy Bridge DRAM Controller (rev 09)
### Group 1 ###
    00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)
    04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Pitcairn PRO [Radeon HD 7850]
    04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
### Group 2 ###
    00:06.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)
    07:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 02)
### Group 3 ###
    00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
### Group 4 ###
    00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
### Group 5 ###
    00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
### Group 6 ###
    00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b5)
### Group 7 ###
    00:1c.7 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8 (rev b5)
### Group 8 ###
    00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
### Group 9 ###
    00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a5)
### Group 10 ###
    00:1f.0 ISA bridge: Intel Corporation C204 Chipset Family LPC Controller (rev 05)
    00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)
### Group 11 ###
    0a:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
### Group 12 ###
    02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
### Group 13 ###
    0d:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
### Group 14 ###
    01:00.0 System peripheral: Hewlett-Packard Company Integrated Lights-Out Standard Slave Instrumentation & System Support (rev 05)
    01:00.1 VGA compatible controller: Matrox Electronics Systems Ltd. MGA G200EH
    01:00.2 System peripheral: Hewlett-Packard Company Integrated Lights-Out Standard Management Processor Support and Messaging (rev 05)
    01:00.4 USB controller: Hewlett-Packard Company Integrated Lights-Out Standard Virtual USB Controller (rev 02)

/etc/modules #Has the following appended
Code:

pci_stub
vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_intel

/etc/default/grub #Has the following appended
Code:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1"


lspci -nn | grep AMD
Code:

04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Pitcairn PRO [Radeon HD 7850] [1002:6819]
04:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] [1002:aab0]



/etc/initramfs-tools/modules #Contains the following
Code:

pci_stub ids=1002:6819,1002:aab0


dmesg | greppci-stub #Displays the following
Code:

[    0.569662] pci-stub: add 1002:6819 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    0.569674] pci-stub 0000:04:00.0: claimed by stub
[    0.569682] pci-stub: add 1002:AAB0 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    0.569690] pci-stub 0000:04:00.1: claimed by stub



VM startup script and config
Code:

#!/bin/bash
 
logFile=$(basename $0).log
 
#Define each of our pci-stub devices
pcistub[0]=0000:04:00.0
pcistub[1]=0000:04:00.1
 
vfiobind() {
    dev="$1"
        vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
        device=$(cat /sys/bus/pci/devices/$dev/device)
        if [ -e /sys/bus/pci/devices/$dev/driver ]; then
                echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
        fi
        echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
 
}
 
modprobe vfio-pci
 
i=0
while [[ $i -lt ${#pcistub[*]} ]]
do
vfiobind ${pcistub[$i]}
((i+=1))
done
 
nohup qemu-system-x86_64 -enable-kvm -M q35 -m 8094 -cpu host \
-smp 4,sockets=1,cores=2,threads=2 \
-bios /usr/share/qemu/bios.bin \
-device virtio-scsi-pci,id=scsi \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on,romfile=/usr/local/bin/XFX.HD7850.1024.120508.rom -nographic \
-device vfio-pci,host=04:00.1,bus=root.1,addr=00.1 \
-usb -usbdevice host:045e:00db -usbdevice host:045e:0039 \
-drive file=/dev/sdk,id=disk,format=raw,if=none -device scsi-hd,drive=disk \
-drive file=/mpool00/Uploads/Windows8.1ProNx64.iso,id=isocd -device ide-cd,bus=ide.0,drive=isocd \
-drive file=/mpool00/Uploads/virtio-win-0.1.102.iso,id=virtiocd,if=none -device ide-cd,bus=ide.1,drive=virtiocd \
-net bridge,br=br0 -net nic,macaddr=52:54:00:81:08:ab,model=virtio \
-boot menu=on \
-vga none >> $logFile 2>&1 &
 
exit 0



Issue Description
My VM properly launches, passes through my VGA card, USB keyboard and Mouse, Audio from the VGA card, network adapter is configured, mounts all ISO's and my disk. I can install the virtio nic and scsi drivers during windows install and fully install windows. I can load windows and access the internet and my local network. When I download the latest AMD drivers, I can begin the install but the following happens.

WIndows 8.1
As soon as the driver is installed and the machine tries to apply it, both the Guest and Host OS lock up. I must reboot them to recover. After this, the VM will randomly lock up on me even though the driver isn't applied to the GPU.

Windows 7
After the driver install it asks me to reboot. Upon reboot, once the graphics driver is initialized both the Guest and Host OS lockup. I must reboot them to recover; however the OS will never fully load for me after this point. (Safe mode may work, but I have not tried it)


It is my understanding that since the GPU is successfully passing through, I don't need the ACS or i915 patches. I think I don't need the i915 patch because i'm not using Intel integraded graphics for the host but and onboard Matrox GPU, which is kind of like a discrete adapter. I don't think I need ACS because my GPU passes through initially without a problem. My only concern is the PCI Root Bus that is shown in the same IOMMU Group.

Does anyone have any ideas? Is there a way to see a kernel dump or errors for this? I'm not sure where to even start honestly.




Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>