<p dir="ltr">Oh, and remove that "allow_unsafe_interrupts" snippet, we're telling people not to add it if they weren't told so in dmesg for two or more years but still.</p>
<div class="gmail_quote">On Sep 16, 2015 5:32 PM, "Blank Field" <<a href="mailto:ihatethisfield@gmail.com">ihatethisfield@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">You've gone the right way in running OVMF instead of VGA, as it is broken on your platform.<br>
Code 43: nvidia drivers have a check code that disables the card if it appears to be attached to a VM. Do you have hyper-v enlightenments turned off and kvm cpuid signature also turned off?<br>
Otherwise code 43 is just as bad as code 10: the driver fails to start the device for whatever reason it has.</p>
<div class="gmail_quote">On Sep 16, 2015 5:11 PM, "Mogliii" <<a href="mailto:mogliii@gmx.net" target="_blank">mogliii@gmx.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have been trying to get vga passthrough working for quite some time<br>
now. I even ordered a new graphics card just for that purpose.<br>
<br>
I explain my setup and configuration below.<br>
<br>
My current problem: I can install Windows 8.1 with uefi (gpt partition<br>
layout) and using virt-manager. Then, I shutdown the VM, remove the<br>
spice and graphics, and add the pcie MSI GTX 750 Ti Gaming (it has a<br>
legacy and uefi bios; uefi bios selected by physical switch). When I<br>
then boot-up the VM, I see the OVMF bios on the physical screen attached<br>
to the GTX750 Ti (sometimes I get graphics glitches i.e. all white) and<br>
Windows 8.1 boots into 800x600. I see that a Nvidia GTX750Ti is<br>
recognized in the device manager. After installing driver (I tried<br>
335.23, 340.52, 341.44 and most recent) the gpu is shown with yellow<br>
exclamation mark with error code 43 and I have to restart. After<br>
restart, I see again the bios and the boot splash, but then the screen<br>
goes into power save mode because it does not get any signal just when<br>
the login screen is supposed to appear.<br>
I can login via vnc and see that the gpu has error code 43.<br>
De-installing the driver and restarting I will go back to a 800x600<br>
desktop on my physical screen.<br>
<br>
Any help with my setup would be immensely appreciated. I have another<br>
spare ASUS HD6570, but it does not have uefi bios. I am not sure if I<br>
would need i915 patch in that case? Does that patch only apply to Intel<br>
CPUs?<br>
<br>
Is the 00:02.2 pci device the problem?<br>
<br>
I would really appreciate any hint as I currently exhausted all options<br>
I see and I would like to avoid spending more money on video cards that<br>
I'm not sure I can even use.<br>
<br>
==========================<br>
SETUP<br>
=========<br>
<br>
[[[ 1. Physical setup<br>
Asus A88x-PRO<br>
AMD A10-7850K (on-board GPU used for linux host with radeon driver<br>
(fglrx not installed))<br>
12 GB memory<br>
MSI GTX 750 Ti Gaming (bios can be switched between legacy/uefi by<br>
hardware switch; using uefi)<br>
<br>
GPU is installed in middle pcie 16x slot (black, not golden) due to<br>
iommu grouping (see below)<br>
<br>
<br>
[[[ 2. OS<br>
UBuntu 15.04 64 bit, unpatched<br>
$ uname -a<br>
Linux host 3.19.0-28-generic #30-Ubuntu SMP Mon Aug 31 15:52:51 UTC 2015<br>
x86_64 x86_64 x86_64 GNU/Linux<br>
<br>
<br>
[[[ 3. Relevant packages (not sure if these are all)<br>
virt-manager 1:1.2.1-1~getdeb1 (get deb ppa)<br>
qemu 1:2.2+dfsg-5expubuntu9.4<br>
libvirt-bin 1.2.12-0ubuntu14.2<br>
qemu-kvm 1:2.2+dfsg-5expubuntu9.4<br>
<br>
[[[ 4. Bios settings<br>
Set to boot from on board GPU. AMD-V and IOMMU activated. Legacy boot<br>
for ubuntu host<br>
<br>
[[[ 5. iommu grouping (iommu.sh output)<br>
### Group 2 ###<br>
    00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1424<br>
    00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 1425<br>
    01:00.0 VGA compatible controller: NVIDIA Corporation GM107 [GeForce<br>
GTX 750 Ti] (rev a2)<br>
    01:00.1 Audio device: NVIDIA Corporation Device 0fbc (rev a1)<br>
<br>
[[[ 6. pci identifier<br>
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107<br>
[GeForce GTX 750 Ti] [10de:1380] (rev a2)<br>
    Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:3102]<br>
    Kernel driver in use: pci-stub<br>
01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fbc] (rev a1)<br>
    Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:3102]<br>
    Kernel driver in use: pci-stub<br>
<br>
[[[ 7. /proc/cmdline<br>
BOOT_IMAGE=/vmlinuz-3.19.0-28-generic root=/dev/mapper/main-root ro<br>
rootflags=subvol=@ quiet splash nomdmonddf nomdmonisw amd_iommu=on<br>
iommu=pt vfio_iommu_type1.allow_unsafe_interrupts=1<br>
pci-stub.ids=10de:0fbc,10de:1380 vt.handoff=7<br>
<br>
[[[ 8. /etc/initramfs-tools/modules<br>
pci_stub ids=10de:0fbc,10de:1380<br>
<br>
[[[ 9. /etc/modules<br>
lp<br>
rtc<br>
pci_stub<br>
vfio<br>
vfio_iommu_type1<br>
vfio_pci<br>
kvm<br>
kvm_amd<br>
<br>
[[[ 10. # dmseg | grep pci-stub<br>
[    1.263269] pci-stub: add 10DE:0FBC sub=FFFFFFFF:FFFFFFFF<br>
cls=00000000/00000000<br>
[    1.263287] pci-stub 0000:01:00.1: claimed by stub<br>
[    1.263296] pci-stub: add 10DE:1380 sub=FFFFFFFF:FFFFFFFF<br>
cls=00000000/00000000<br>
[    1.263304] pci-stub 0000:01:00.0: claimed by stub<br>
<br>
[[[ 11. /usr/windows.sh (executed before running vm. Afterwards lspci<br>
-nnk shows "vfio-pci" as kernel driver in use for 01:00.0 and 01:00.1)<br>
#!/bin/bash<br>
<br>
configfile=/etc/vfio_pci1.cfg<br>
vfiobind() {<br>
    dev="$1"<br>
        vendor=$(cat /sys/bus/pci/devices/$dev/vendor)<br>
        device=$(cat /sys/bus/pci/devices/$dev/device)<br>
        if [ -e /sys/bus/pci/devices/$dev/driver ]; then<br>
                echo $dev > /sys/bus/pci/devices/$dev/driver/unbind<br>
        fi<br>
        echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id<br>
   }<br>
modprobe vfio-pci<br>
cat $configfile | while read line;do<br>
    echo $line | grep ^# >/dev/null 2>&1 && continue<br>
        vfiobind $line<br>
done<br>
exit 0<br>
<br>
[[[ 12. /etc/vfio_pci1.cfg<br>
0000:01:00.0<br>
0000:01:00.1<br>
<br>
[[[ 13. OVMF-bios<br>
Got from sourceforge<br>
(edk2.git-ovmf-x64-0-20150910.b1206.g5abc2a7.noarch.rpm) and extracted.<br>
Then, made individual copy of OVMF-pure-efi.fd (md5<br>
fbb13f2d4be2f9d72472628f885f5cb4 ) for VM.<br>
<br>
[[[ 14. Created VM in virt-manager using the following configuration<br>
(configuration shown after installation, i.e. no cdroms, but before<br>
attaching pci)<br>
<domain type='kvm'><br>
  <name>win81</name><br>
  <uuid>redacted</uuid><br>
  <memory unit='KiB'>4194304</memory><br>
  <currentMemory unit='KiB'>4194304</currentMemory><br>
  <vcpu placement='static'>2</vcpu><br>
  <os><br>
    <type arch='x86_64' machine='pc-i440fx-utopic'>hvm</type><br>
    <loader type='rom'>/usr/share/ovmf/OVMF-pure-efi_win81.fd</loader><br>
    <boot dev='hd'/><br>
  </os><br>
  <features><br>
    <acpi/><br>
    <apic/><br>
    <pae/><br>
    <kvm><br>
      <hidden state='on'/><br>
    </kvm><br>
  </features><br>
  <cpu mode='host-passthrough'><br>
  </cpu><br>
  <clock offset='localtime'><br>
    <timer name='rtc' tickpolicy='catchup'/><br>
    <timer name='pit' tickpolicy='delay'/><br>
  </clock><br>
  <on_poweroff>destroy</on_poweroff><br>
  <on_reboot>restart</on_reboot><br>
  <on_crash>restart</on_crash><br>
  <pm><br>
    <suspend-to-mem enabled='no'/><br>
    <suspend-to-disk enabled='no'/><br>
  </pm><br>
  <devices><br>
    <emulator>/usr/bin/qemu-system-x86_64</emulator><br>
    <disk type='block' device='disk'><br>
      <driver name='qemu' type='raw' cache='none' io='native'/><br>
      <source dev='/dev/main/Win7xen'/><br>
      <target dev='vda' bus='virtio'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08'<br>
function='0x0'/><br>
    </disk><br>
    <controller type='usb' index='0' model='ich9-ehci1'><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
function='0x7'/><br>
    </controller><br>
    <controller type='usb' index='0' model='ich9-uhci1'><br>
      <master startport='0'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
function='0x0' multifunction='on'/><br>
    </controller><br>
    <controller type='usb' index='0' model='ich9-uhci2'><br>
      <master startport='2'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
function='0x1'/><br>
    </controller><br>
    <controller type='usb' index='0' model='ich9-uhci3'><br>
      <master startport='4'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
function='0x2'/><br>
    </controller><br>
    <controller type='pci' index='0' model='pci-root'/><br>
    <controller type='virtio-serial' index='0'><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'<br>
function='0x0'/><br>
    </controller><br>
    <interface type='bridge'><br>
      <mac address='52:54:00:ab:b6:10'/><br>
      <source bridge='br1'/><br>
      <model type='virtio'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04'<br>
function='0x0'/><br>
    </interface><br>
    <input type='mouse' bus='ps2'/><br>
    <input type='keyboard' bus='ps2'/><br>
    <graphics type='spice' autoport='yes'/><br>
    <video><br>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'<br>
function='0x0'/><br>
    </video><br>
    <hostdev mode='subsystem' type='usb' managed='yes'><br>
      <source><br>
        <vendor id='0x0603'/><br>
        <product id='0x1605'/><br>
      </source><br>
    </hostdev><br>
    <hostdev mode='subsystem' type='usb' managed='yes'><br>
      <source><br>
        <vendor id='0x05ac'/><br>
        <product id='0x1006'/><br>
      </source><br>
    </hostdev><br>
    <hostdev mode='subsystem' type='usb' managed='yes'><br>
      <source><br>
        <vendor id='0x05ac'/><br>
        <product id='0x024f'/><br>
      </source><br>
    </hostdev><br>
    <memballoon model='virtio'><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07'<br>
function='0x0'/><br>
    </memballoon><br>
  </devices><br>
</domain><br>
<br>
[[[ 15. After installation and installation of updates, shut down the VM<br>
<br>
[[[ 16. Attached PCI devices and removed video and display spice. Below<br>
is virsh configuration after attaching pcie passthrough.<br>
<domain type='kvm'><br>
  <name>win81</name><br>
  <uuid>redacted</uuid><br>
  <memory unit='KiB'>4194304</memory><br>
  <currentMemory unit='KiB'>4194304</currentMemory><br>
  <vcpu placement='static'>2</vcpu><br>
  <os><br>
    <type arch='x86_64' machine='pc-i440fx-utopic'>hvm</type><br>
    <loader type='rom'>/usr/share/ovmf/OVMF-pure-efi_win81.fd</loader><br>
    <boot dev='hd'/><br>
  </os><br>
  <features><br>
    <acpi/><br>
    <apic/><br>
    <pae/><br>
    <kvm><br>
      <hidden state='on'/><br>
    </kvm><br>
  </features><br>
  <cpu mode='host-passthrough'><br>
  </cpu><br>
  </clock><br>
  <on_poweroff>destroy</on_poweroff><br>
  <on_reboot>restart</on_reboot><br>
  <on_crash>restart</on_crash><br>
  <pm><br>
    <suspend-to-mem enabled='no'/><br>
    <suspend-to-disk enabled='no'/><br>
  </pm><br>
  <devices><br>
    <emulator>/usr/bin/qemu-system-x86_64</emulator><br>
    <disk type='block' device='disk'><br>
      <driver name='qemu' type='raw' cache='none' io='native'/><br>
      <source dev='/dev/main/Win7xen'/><br>
      <target dev='vda' bus='virtio'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08'<br>
function='0x0'/><br>
    </disk><br>
    <controller type='usb' index='0' model='ich9-ehci1'><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
function='0x7'/><br>
    </controller><br>
    <controller type='usb' index='0' model='ich9-uhci1'><br>
      <master startport='0'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
function='0x0' multifunction='on'/><br>
    </controller><br>
    <controller type='usb' index='0' model='ich9-uhci2'><br>
      <master startport='2'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
function='0x1'/><br>
    </controller><br>
    <controller type='usb' index='0' model='ich9-uhci3'><br>
      <master startport='4'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
function='0x2'/><br>
    </controller><br>
    <controller type='pci' index='0' model='pci-root'/><br>
    <controller type='virtio-serial' index='0'><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'<br>
function='0x0'/><br>
    </controller><br>
    <interface type='bridge'><br>
      <mac address='52:54:00:ab:b6:10'/><br>
      <source bridge='br1'/><br>
      <model type='virtio'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04'<br>
function='0x0'/><br>
    </interface><br>
    <hostdev mode='subsystem' type='usb' managed='yes'><br>
      <source><br>
        <vendor id='0x0603'/><br>
        <product id='0x1605'/><br>
      </source><br>
    </hostdev><br>
    <hostdev mode='subsystem' type='usb' managed='yes'><br>
      <source><br>
        <vendor id='0x05ac'/><br>
        <product id='0x1006'/><br>
      </source><br>
    </hostdev><br>
    <hostdev mode='subsystem' type='usb' managed='yes'><br>
      <source><br>
        <vendor id='0x05ac'/><br>
        <product id='0x024f'/><br>
      </source><br>
    </hostdev><br>
    <hostdev mode='subsystem' type='pci' managed='yes'><br>
      <source><br>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/><br>
      </source><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'<br>
function='0x0'/><br>
    </hostdev><br>
    <hostdev mode='subsystem' type='pci' managed='yes'><br>
      <source><br>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/><br>
      </source><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09'<br>
function='0x0'/><br>
    </hostdev><br>
    <memballoon model='virtio'><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07'<br>
function='0x0'/><br>
    </memballoon><br>
  </devices><br>
</domain><br>
<br>
[[[ 17. What else did I try<br>
- Different nvidia drivers (see top of email)<br>
- Attaching 00:02.2 as well, but cannot do vfio-pci assignement so failed<br>
# virsh nodedev-list --tree<br>
  +- pci_0000_00_02_0<br>
  +- pci_0000_00_02_2<br>
  |   |<br>
  |   +- pci_0000_01_00_0<br>
  |   +- pci_0000_01_00_1<br>
  |<br>
  +- pci_0000_00_03_0<br>
<br>
# lspci -nnk (extract)<br>
00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device<br>
[1022:1424]<br>
00:02.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Device<br>
[1022:1425]<br>
    Kernel driver in use: pcieport<br>
<br>
- Reinstall the whole VM with seabios and using the GTX 750 Ti with<br>
legacy bios (physical switch on card). But no picture was shown on<br>
screen after attaching, not even the bios.<br>
- Tried to use q35 emulation, but not successful. It does not work with<br>
ovmf? I.e. I cannot use the qemu:cmd or ioh3420.<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
vfio-users mailing list<br>
<a href="mailto:vfio-users@redhat.com" target="_blank">vfio-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/vfio-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/vfio-users</a><br>
</blockquote></div>
</blockquote></div>