Jump to content

[Solved] Need help with Graphics card passthrough


jgs2n

Recommended Posts

I had a windows VM running without issue and wanted to see if i could pass through the gfx.  I installed the gfx Nvidia 970 and selected it but get the dreaded vfio error below

 

i-8dCpCF2-M.jpg

 

Here are my iommu groups.  Any help appreciated.  Thanks

 

i-3p2mQx5-M.jpg

 

 

Link to comment

Thanks for the reply.  That helped.  I was able to update the windwos vm and boot.  I  installed nvidia driver in windows. 

 

However in device manager the display adapter is not working.  I get

 

Windows has stopped this device because it has reported problems. (Code 43)

 

Any troubleshooting advice. 

Link to comment

Thanks but no luck.  VNC was disabled.  I am unable to connect to the virtual machine when I disable hyper-v

What do you mean by connecting to the VM when you disable Hyper-v? That you can not connect with vnc or you do not get any output from the graphics card?

Link to comment

Any other advice?  The only way the VM starts is with Hyper-V set to yes.  But with it set to yes, I get the dreaded code 43 error. 

 

Have tried i440fx and Q35.  I have edited xml for vm to supply gpu ROM manually.  Maybe just not possible with my hardware??

Link to comment

Tried windows 7 without success. 

 

Xml is below.

 

<domain type='kvm' id='81' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>Windows 7</name>
  <uuid>ca58a6fb-8750-0461-633d-956178808afa</uuid>
  <metadata>
    <vmtemplate name="Custom" icon="windows7.png" os="windows7"/>
  </metadata>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='5'/>
    <vcpupin vcpu='2' cpuset='6'/>
    <vcpupin vcpu='3' cpuset='7'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.3'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu>
    <topology sockets='1' cores='4' 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/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/cache/Windows Virtual Machine/Windows 7/vdisk1.img'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='mnt/cache/Windows Virtual Machine/Windows 7/GRMCPRXFREO_EN_DVD.ISO'/>
      <backingStore/>
      <target dev='hda' bus='sata'/>
      <readonly/>
      <boot order='2'/>
      <alias name='sata0-0-0'/>
      <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/cache/Windows Virtual Machine/Windows 10/virtio-win-0.1.96.iso'/>
      <backingStore/>
      <target dev='hdb' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:9d:9a:1e'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/Windows 7.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=2,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.0,bus=pcie.0,multifunction=on,x-vga=on'/>
  </qemu:commandline>
</domain>

xml.txt

xml.txt

Link to comment

Any other advice?  The only way the VM starts is with Hyper-V set to yes.  But with it set to yes, I get the dreaded code 43 error. 

 

Have tried i440fx and Q35.  I have edited xml for vm to supply gpu ROM manually.  Maybe just not possible with my hardware??

How do you know if you get code 43 error if the VM don't start?

Let's take it from the start.

What happens if you create a new Win 10 VM and pass through only the nvidia card (also audio), no VNC? Does it start and do you get output to your monitor?

The VM manager should take care of disabling hyper-V automatically if you use an nvidia card.

Which version of Unraid are you running?

Link to comment

How do you know if you get code 43 error if the VM don't start?

 

When I first installed the graphics card I had a virtual machine running with hyper-V on and got the code 43 error.  When I turned hyper-v off, the vm started.  Then I installed nvidia drivers and on reboot, the machine would not start.

 

Going to borrow a different card from a friend and try different hardware.

 

Thanks.

Link to comment

For follow up, I discovered my issue by reading a different thread (see below).  Setting the bios to onboard let the VM use the PCIE as described.  This is amazing!

 

Quote from: stratus on August 19, 2015, 08:19:57 AM

I checked the BIOS as well and the closest option is choosing the default graphics, which was set to PCIE

 

Bingo...  That's your problem.  Change this option to use the on-board graphics.  This will then allow unRAID to output it's console to on-board and use the PCIE GPU for the VM.

 

I probably need to add this to the wiki...

 

 

Link to comment

For follow up, I discovered my issue by reading a different thread (see below).  Setting the bios to onboard let the VM use the PCIE as described.  This is amazing!

 

Quote from: stratus on August 19, 2015, 08:19:57 AM

I checked the BIOS as well and the closest option is choosing the default graphics, which was set to PCIE

 

Bingo...  That's your problem.  Change this option to use the on-board graphics.  This will then allow unRAID to output it's console to on-board and use the PCIE GPU for the VM.

 

I probably need to add this to the wiki...

 

Well when two different people both didn't know this, it means I've failed to cover all the bases in the wiki properly...

 

banginghead1.jpg

 

Guess I'll need to update it again!

Link to comment

For follow up, I discovered my issue by reading a different thread (see below).  Setting the bios to onboard let the VM use the PCIE as described.  This is amazing!

 

Quote from: stratus on August 19, 2015, 08:19:57 AM

I checked the BIOS as well and the closest option is choosing the default graphics, which was set to PCIE

 

Bingo...  That's your problem.  Change this option to use the on-board graphics.  This will then allow unRAID to output it's console to on-board and use the PCIE GPU for the VM.

 

I probably need to add this to the wiki...

 

Well when two different people both didn't know this, it means I've failed to cover all the bases in the wiki properly...

 

banginghead1.jpg

 

Guess I'll need to update it again!

3rd... But I figured that one out on my own :) MSI Z87M-G43 had in named "OBG CONFIGURATION" I think

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...