[vfio-users] Nvidia Code 43 on Fedora 24 host and Windows 10 guest.

Dawid Osuchowski tulphoon at openmailbox.org
Tue Oct 4 17:43:58 UTC 2016


Hello! I'm trying to do a PCI passthrough of my GPU to Windows 10 guest
machine using libvirt and vfio-pci. I've followed Alex Williamson's
guide from vfio-blog
http://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-3-host.html
and it still doesn't work as i'm getting Code 43 on my MSI nVidia GTX
660 graphics card. Dumping all necessary info below (if you need me to
supply more, i'll be happy to do it):

lspci-nnv output:

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK106
[GeForce GTX 660] [10de:11c0] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:2877]
    Flags: fast devsel, IRQ 16
    Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
    Memory at e0000000 (64-bit, prefetchable) [size=128M]
    Memory at e8000000 (64-bit, prefetchable) [size=32M]
    I/O ports at e000 [size=128]
    Expansion ROM at f7000000 [disabled] [size=512K]
    Capabilities: <access denied>
    Kernel driver in use: vfio-pci
    Kernel modules: nouveau

01:00.1 Audio device [0403]: NVIDIA Corporation GK106 HDMI Audio
Controller [10de:0e0b] (rev a1)
    Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:2877]
    Flags: fast devsel, IRQ 17
    Memory at f7080000 (32-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: vfio-pci
    Kernel modules: snd_hda_intel


IOMMU groups:

IOMMU group 0
    00:00.0 Host bridge [0600]: Intel Corporation 4th Gen Core Processor
DRAM Controller [8086:0c00] (rev 06)
IOMMU group 1
    00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v3/4th Gen
Core Processor PCI Express x16 Controller [8086:0c01] (rev 06)
    01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK106
[GeForce GTX 660] [10de:11c0] (rev a1)
    01:00.1 Audio device [0403]: NVIDIA Corporation GK106 HDMI Audio
Controller [10de:0e0b] (rev a1)
IOMMU group 2
    00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon
E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller
[8086:0412] (rev 06)
IOMMU group 3
    00:03.0 Audio device [0403]: Intel Corporation Xeon E3-1200 v3/4th
Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
IOMMU group 4
    00:14.0 USB controller [0c03]: Intel Corporation 8 Series/C220
Series Chipset Family USB xHCI [8086:8c31] (rev 05)
IOMMU group 5
    00:16.0 Communication controller [0780]: Intel Corporation 8
Series/C220 Series Chipset Family MEI Controller #1 [8086:8c3a] (rev 04)
IOMMU group 6
    00:1a.0 USB controller [0c03]: Intel Corporation 8 Series/C220
Series Chipset Family USB EHCI #2 [8086:8c2d] (rev 05)
IOMMU group 7
    00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series
Chipset High Definition Audio Controller [8086:8c20] (rev 05)
IOMMU group 8
    00:1c.0 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series
Chipset Family PCI Express Root Port #1 [8086:8c10] (rev d5)
IOMMU group 9
    00:1c.1 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series
Chipset Family PCI Express Root Port #2 [8086:8c12] (rev d5)
IOMMU group 10
    00:1c.3 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge
[8086:244e] (rev d5)
    04:00.0 PCI bridge [0604]: ASMedia Technology Inc. ASM1083/1085 PCIe
to PCI Bridge [1b21:1080] (rev 03)
IOMMU group 11
    00:1d.0 USB controller [0c03]: Intel Corporation 8 Series/C220
Series Chipset Family USB EHCI #1 [8086:8c26] (rev 05)
IOMMU group 12
    00:1f.0 ISA bridge [0601]: Intel Corporation B85 Express LPC
Controller [8086:8c50] (rev 05)
    00:1f.2 SATA controller [0106]: Intel Corporation 8 Series/C220
Series Chipset Family 6-port SATA Controller 1 [AHCI mode] [8086:8c02]
(rev 05)
    00:1f.3 SMBus [0c05]: Intel Corporation 8 Series/C220 Series Chipset
Family SMBus Controller [8086:8c22] (rev 05)
IOMMU group 13
    03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd.
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168]
(rev 06)


GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root
rd.luks.uuid=luks-6049a0a8-8515-4a02-9543-2ff6dd8b7472
rd.lvm.lv=fedora/swap rhgb quiet intel_iommu=on iommu=pt
rd.driver.pre=vfio-pci"


XML config of the VM:

<domain type='kvm'>
  <name>win10</name>
  <uuid>0b69b3f8-0f5b-4a7f-9311-d315c5e1c632</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static' current='2'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.6'>hvm</type>
    <loader readonly='yes'
type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='KeenlyKVM'/>
    </hyperv>
    <kvm>
      <hidden state='on'/>
    </kvm>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <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-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/home/tulphoon/kvm/win10.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <interface type='network'>
      <mac address='52:54:00:5d:6d:f2'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <rom bar='on' file='/opt/strip.rom'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07'
function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04'
function='0x0'/>
    </memballoon>
  </devices>
</domain>


content of /etc/modprobe.d/local.conf:

options vfio-pci
ids=1002:ffffffff:ffffffff:ffffffff:00030000:ffff00ff,1002:ffffffff:ffffffff:ffffffff:00040300:ffffffff,10de:ffffffff:ffffffff:ffffffff:00030000:ffff00ff,10de:ffffffff:ffffffff:ffffffff:00040300:ffffffff

install vfio-pci /sbin/vfio-pci-override-vga.sh
options vfio-pci disable_vga=1
blacklist nouveau nvidia


output from EfiRom -d /opt/strip.rom
Image 1 -- Offset 0x0
  ROM header contents
    Signature              0xAA55
    PCIR offset            0x0190
    Signature               PCIR
    Vendor ID               0x10DE
    Device ID               0x11C0
    Length                  0x0018
    Revision                0x0000
    DeviceListOffset        0x00
    Class Code              0x030000
    Image size              0xF600
    Code revision:          0x0001
    MaxRuntimeImageLength   0x00
    ConfigUtilityCodeHeaderOffset 0x8B2E
    DMTFCLPEntryPointOffset 0x2EC0
    Indicator               0x00
    Code type               0x00
Image 2 -- Offset 0xF600
  ROM header contents
    Signature              0xAA55
    PCIR offset            0x001C
    Signature               PCIR
    Vendor ID               0x10DE
    Device ID               0x11C0
    Length                  0x001C
    Revision                0x0003
    DeviceListOffset        0x00
    Class Code              0x030000
    Image size              0x10E00
    Code revision:          0x0000
    MaxRuntimeImageLength   0x00
    ConfigUtilityCodeHeaderOffset 0x00
    DMTFCLPEntryPointOffset 0x00
    Indicator               0x80   (last image)
    Code type               0x03   (EFI image)
  EFI ROM header contents
    EFI Signature          0x0EF1
    Compression Type       0x0001 (compressed)
    Machine type           0x8664 (unknown)
    Subsystem              0x000B (EFI boot service driver)
    EFI image offset       0x004C (@0xF64C)


Package versions:

libvirt: 1.3.3.2

QEMU: 2.6.2

virt-manager: 1.4.0

kernel: 4.6.7-300.fc24.x86_64

system: Fedora 24




More information about the vfio-users mailing list