Windows 10 nvidia gpu passthrough issues (code 43)


Recommended Posts

Good day all and my apologies upfront if this isn't the correct place to post this or if I missed a post that could have resolved my issue, but I need some help. 

I am just trying to install a Windows 10 VM with passthrough of my nvidia gtx 980TI. I have even go as far as buying a second cheap gpu and moving my gpu a slot down, this helped.

Here is a list of things I have tried(most set within the GUI:

  • Machine/BIOS
    • i440fc-4.2/OVMF
    • Q35-4.2/OVMF
    • i440fc-4.2/SeaBIOS
    • Q35-4.2/SeaBIOS
  • Hyper-V: No (tried yes, but failed horribly)
  • Installing windows with/without the gpu being passed through and with VNC being primary and the gpu being secondary.
  • Nvidia Sound Card passed through
  • Adding and not adding a ROM bios
    • ROM bios from website and "fixed" per spaceinvader's video
    • ROM bios dumped from the GPU itself
    • and variations of the rom bios on each machine/BIOS pairing
  • I have also tried various xml edits
    • setting kvm to off
    • couple others the just failed to apply or I just didn't understand what I should do.
  • single cpu or several

 

All of this has lead to failure each time and despair is starting to set in. I seem to have the best luck with i440fc/OVMF, hyper-v:no, using the ROM I downloaded and then fixed per the video, haveing the nvidia sound card passing through, VNC as primary and gpu as secondary (doesn't seem to matter if I add it right away or wait until install is done).

I have tested passthrough with ubuntu and it seems to work fine. Also passthrough works for the first part of windows 10 install if the gpu is primary, but fails after the first reboot.

 

When I install the drivers via windows update, it just reboots and doesn't appear to install. when I use the nvidia installer it installs and the gpu is named correctly, but it has a code 43. I have included my current vm xml and my unraid diag file. I would greatly appreciate any help with this I have been fighting with it for 6 days now and really don't want to go away from unraid. Thanks in advance!

 

Quote

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm'>
  <name>1</name>
  <uuid>556bfb8c-d589-1bd8-bcc9-faeb0e9fc5dd</uuid>
  <description>i440fx; ovmf; hyper-no; rom:fixed; added sound</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/556bfb8c-d589-1bd8-bcc9-faeb0e9fc5dd_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='1' threads='1'/>
  </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>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/1/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/Windows.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/isos/virtio-win-0.1.173-2.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <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='0x04' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <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'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:5f:c0:a7'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='3'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
      </source>
      <rom file='/mnt/user/isos/MSI.GTX980Ti.6144.150424_Fixed.rom'/>
      <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='0x03' slot='0x00' function='0x1'/>
      </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='0xc32b'/>
      </source>
      <address type='usb' bus='0' port='1'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x1532'/>
        <product id='0x0067'/>
      </source>
      <address type='usb' bus='0' port='2'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
</domain>

 

beast-diagnostics-20200311-2211.zip

Link to comment

@thamuz If you use a VNC GPU and a GPU passthrough at the same time, the virtual VNC GPU will always become primary and the passed through physical GPU will produce a code 43. For me it worked out best to first install Windows with VNC only, install the drivers from virtio iso, make sure network is working and finally setup RDP or other software like Anydesk or Teamviewer to remote manage the VM.

 

Next step is to shutdown the VM, remove VNC and add the GPU and it's audio part. Before starting the VM you have to connect a monitor to the GPU. If not, the GPU won't initialize fully or you can end up in scenarios where it hangs during boot. If you see only one core with 100% load and it won't change after a couple minutes, reduze the core count of the VM to only 1 core and try again to boot the VM.

 

Minimize the devices you wanna pass through to a minimum. Try it first with only the GPU, NO USB devices like keyboard or mouse, NO USB cards, NO physical network nics. Make sure the GPU is working and add the other devices later, one by one.

  • Like 2
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.