Getting "unknown pci source type" trying to pass 1070 to VM


Recommended Posts

Hey all, recently decided to finally try to virtualize my win10 box and got it booting off the physical ssd it was installed on. Next, I tried to pass my GTX 1070 to the VM using the techpowerup bios. Removed the header and saved it to a vbios folder on my domains share. I'm getting a " internal error: unknown pci source type 'rom' " message trying to add the vbios to the XML

 

Here is said XML:

Any ideas?

 

<domain type='kvm'>
  <name>Main - Win 10</name>
  <uuid>d58ff019-19d6-86db-7820-906f459a4a6c</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>10485760</memory>
  <currentMemory unit='KiB'>10485760</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='3'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/d58ff019-19d6-86db-7820-906f459a4a6c_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='4' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <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='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/virtio-win.iso'/>
      <target dev='hdb' bus='sata'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/disk/by-id/ata-Crucial_CT250MX200SSD1_154410F307EB'/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:d5:09:a6'/>
      <source bridge='virbr0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </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='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <rom file='/mnt/user/domains/vbios/EVGA1070.rom'/>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc537'/>
      </source>
      <address type='usb' bus='0' port='1'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x04d9'/>
        <product id='0x0171'/>
      </source>
      <address type='usb' bus='0' port='2'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x1b1c'/>
        <product id='0x0c09'/>
      </source>
      <address type='usb' bus='0' port='3'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Link to comment

1. Which Device is your GPU? I see two PCI devices passed through. Generally the first one is the GPU if you are passing through GPU audio as well.

2. The rom line is in wrong place, even if that is the GPU the line is in the wrong place. But I also think you are passing the Rom to the Audio card not the GPU.

3. Although  I have made the change to the second PCI device here, I actually think you require the line in the First PCI device not the second.

 

 

Summary
1. You have two devices listed and need to be sure which is your GPU, or pass it through to both and hope for the best!
2.  The line goes after source, but before address and hostdev. It does not go  After source Before Address/Address/Hostdev.
3. I  actually think you only need to apply the line to the first PCI device but have shown the line added to both devices below.

 

 

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
--- (3)  Line Added  ---
        <rom file='/mnt/user/domains/vbios/EVGA1070.rom'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
  
<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
  --- (2)Line removed ---
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
      </source>
  --- (2)Line added ---
        <rom file='/mnt/user/domains/vbios/EVGA1070.rom'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>

Edited by Tuftuf
Link to comment
  • 1 year later...

On the newer unRAID version you can now add the vbios through the vm webui. Much easier.  ?

 

921197682_ScreenShot2018-07-26at11_42_25.png.e6a4b31dbaf7c2e111731ee3a6faa1f8.png

 

 

But for those wanting to manually editing the xml you can identify the which is the 'GPU' part of the graphics card and which is the 'sound' part.

The GPU part will always be

 function='0x0'/>

for example

<address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>

 

and the sound part is

 function='0x1'/>

for example 

<address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>

 

So the ROM file always goes with the GPU part, not the sound part. so XML would look like this

 

   <hostdev mode='subsystem' type='pci' managed='yes'>
         <driver name='vfio'/>
         <source>
           <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
         </source>
		 <rom file='/mnt/user/domains/vbios/EVGA1070.rom'/>
         <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
       </hostdev>
       

 

Notice the first address line is the physical address on the host (unRAID server) and the second address is the virtual address in the vm.

The rom file always goes with the virtual address part.  (The OP had mistakenly put his rom file above the physical address as opposed to the virtual address and also on the sound part of the xml)

sound part doesn't need a rom file and would look like this

 

<hostdev mode='subsystem' type='pci' managed='yes'>
         <driver name='vfio'/>
         <source>
           <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
         </source>
         <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
       </hostdev>

 

Edited by gridrunner
Link to comment
  • 2 months later...

I encountered the exact same problem today and I find the solution. I found when I unplug my mouse and keyboard and try to edit VM settings it shows the error message. So I just went into the XML view and found the lines for usb passthrough settings and deleted them. Then everything just works.

  • Like 1
Link to comment
  • 2 weeks later...
On 10/7/2018 at 1:52 AM, w41g87 said:

I encountered the exact same problem today and I find the solution. I found when I unplug my mouse and keyboard and try to edit VM settings it shows the error message. So I just went into the XML view and found the lines for usb passthrough settings and deleted them. Then everything just works.

Thanks for the tip, all my VMs stopped loading recently and it turned out to be usb passthrough in the xml.

Link to comment
  • 3 months later...

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.