Unable to pass through primary AMD GPU


Recommended Posts

Hello everyone,

I am a new and inexperienced user of unraid and I am trying to pass through my primary (and only) AMD GPU

I am using Legacy not UEFI
The vbios is made/extracted/dumped by using this actual card.
If anyone has any suggestion i will gladly try them. A solution would make my day and make me very gratefull.

 

System hardware:

MB: Gigabyte aorus x570 pro wifi ITX
CPU: Ryzen 7 2700

GPU: Radeon Sapphire HD7950

 

VM log:

Quote

ErrorWarningSystemArrayLogin


-uuid 3a72533f-3cd1-3cfb-472f-f158cbddb7ee \
-display none \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=31,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=localtime \
-no-hpet \
-no-shutdown \
-boot strict=on \
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x7.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x7 \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x7.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x7.0x2 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 \
-blockdev '{"driver":"file","filename":"/mnt/user/domains/Windows 10/vdisk1.img","node-name":"libvirt-3-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"raw","file":"libvirt-3-storage"}' \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=libvirt-3-format,id=virtio-disk2,bootindex=1,write-cache=on \
-blockdev '{"driver":"file","filename":"/mnt/user/isos/Win10_20H2_v2_EnglishInternational_x64.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw","file":"libvirt-2-storage"}' \
-device ide-cd,bus=ide.0,unit=0,drive=libvirt-2-format,id=ide0-0-0,bootindex=2 \
-blockdev '{"driver":"file","filename":"/mnt/user/isos/virtio-win-0.1.190-1.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"}' \
-device ide-cd,bus=ide.0,unit=1,drive=libvirt-1-format,id=ide0-0-1 \
-netdev tap,fd=33,id=hostnet0 \
-device virtio-net,netdev=hostnet0,id=net0,mac=52:54:00:4d:c3:3b,bus=pci.0,addr=0x2 \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev socket,id=charchannel0,fd=34,server,nowait \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-device usb-tablet,id=input0,bus=usb.0,port=1 \
-device ich9-intel-hda,id=sound0,bus=pci.0,addr=0x8 \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
-device 'vfio-pci,host=0000:09:00.0,id=hostdev0,bus=pci.0,addr=0x5,romfile=/mnt/user/isos/vbios/Sapphire HD7950 Tahiti.rom' \
-device vfio-pci,host=0000:09:00.1,id=hostdev1,bus=pci.0,addr=0x6 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
2021-04-08 23:53:11.127+0000: Domain id=1 is tainted: high-privileges
2021-04-08 23:53:11.127+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)

 

XML file:

Quote

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm'>
  <name>Windows 10</name>
  <uuid>3a72533f-3cd1-3cfb-472f-f158cbddb7ee</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>5242880</memory>
  <currentMemory unit='KiB'>5242880</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>14</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='1'/>
    <vcpupin vcpu='1' cpuset='9'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='10'/>
    <vcpupin vcpu='4' cpuset='3'/>
    <vcpupin vcpu='5' cpuset='11'/>
    <vcpupin vcpu='6' cpuset='4'/>
    <vcpupin vcpu='7' cpuset='12'/>
    <vcpupin vcpu='8' cpuset='5'/>
    <vcpupin vcpu='9' cpuset='13'/>
    <vcpupin vcpu='10' cpuset='6'/>
    <vcpupin vcpu='11' cpuset='14'/>
    <vcpupin vcpu='12' cpuset='7'/>
    <vcpupin vcpu='13' cpuset='15'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-5.1'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/3a72533f-3cd1-3cfb-472f-f158cbddb7ee_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' check='none' migratable='on'>
    <topology sockets='1' dies='1' cores='7' threads='2'/>
    <cache mode='passthrough'/>
    <feature policy='require' name='topoext'/>
  </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='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/Windows 10/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/Win10_20H2_v2_EnglishInternational_x64.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.190-1.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='0x03' 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:4d:c3:3b'/>
      <source bridge='br0'/>
      <model type='virtio-net'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 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='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <sound model='ich9'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </sound>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
      </source>
      <rom file='/mnt/user/isos/vbios/Sapphire HD7950 Tahiti.rom'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x09' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
</domain>

 

System devices ( Sorry for the bad readability)

RopmCV5.jpg

Edited by Creativity404
Added system hardware
Link to comment
27 minutes ago, John_M said:

Diagnostics would be more useful than screenshots. What happens if you bind both items in IOMMU group 22 to the VFIO driver?

 

Thank you for replying! The system does not boot when i bind them.
similar to this persons post:

Sorry i am very new to unraid and I did not know I could make a diagnostics report, i have found the function and made one.

If i can help you or anyone else help me understand/diagnose my problem better in any way please let me know. i don't mean to be a person who just says: "it doesn't work plz fix it FOR me" I have googled and searched the forum but havent found an answer or a similar problem.

apollo-diagnostics-20210417-0057.zip

Link to comment
26 minutes ago, John_M said:

You have both the amdgpu and radeon driver modules enabled and installed. You can't pass through a GPU that's bound to a Linux driver. You need to revert to the default condition of having them blacklisted to stand any chance of using the GPU in a VM.

 

Ah, i was under the impression of the exact opposite 😅 thank you

Now it says it has failed to mmap
2021-04-16 23:47:47.321+0000: Domain id=1 is tainted: high-privileges
2021-04-16 23:47:47.321+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)
2021-04-16T23:47:48.073497Z qemu-system-x86_64: -device vfio-pci,host=0000:0a:00.0,id=hostdev0,bus=pci.0,addr=0x5,romfile=/mnt/disk1/isos/vbios/HD7950.rom: Failed to mmap 0000:0a:00.0 BAR 0. Performance may be slow

 

I have looked this up and fixed it with a script that runs at first array start:

echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

 

Now failed to MMAP has dissapeared but i am once more stuck on the same:

2021-04-17 00:01:54.095+0000: Domain id=1 is tainted: high-privileges
2021-04-17 00:01:54.095+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)

Should i make a new diagnostic?
And would the enabled drive rmodules be the reason as to why i couldnt bind the card?
i will try to bind the GPU now, maybe it will work then

Link to comment
20 minutes ago, Creativity404 said:

Ah, i was under the impression of the exact opposite 😅 thank you

Now it says it has failed to mmap
2021-04-16 23:47:47.321+0000: Domain id=1 is tainted: high-privileges
2021-04-16 23:47:47.321+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)
2021-04-16T23:47:48.073497Z qemu-system-x86_64: -device vfio-pci,host=0000:0a:00.0,id=hostdev0,bus=pci.0,addr=0x5,romfile=/mnt/disk1/isos/vbios/HD7950.rom: Failed to mmap 0000:0a:00.0 BAR 0. Performance may be slow

 

I have looked this up and fixed it with a script that runs at first array start:

echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

 

Now failed to MMAP has dissapeared but i am once more stuck on the same:

2021-04-17 00:01:54.095+0000: Domain id=1 is tainted: high-privileges
2021-04-17 00:01:54.095+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)

Should i make a new diagnostic?
And would the enabled drive rmodules be the reason as to why i couldnt bind the card?
i will try to bind the GPU now, maybe it will work then

Should i make a new diagnostic?
And would the enabled drive rmodules be the reason as to why i couldnt bind the card?
i will try to bind the GPU now, maybe it will work then

 

Now i am able to bind the GPU and succesfully boot, but still stuck on:

2021-04-17 00:01:54.095+0000: Domain id=1 is tainted: high-privileges
2021-04-17 00:01:54.095+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)

 

 

apollo-diagnostics-20210417-0225.zip

Link to comment
14 hours ago, Creativity404 said:

Should i make a new diagnostic?
And would the enabled drive rmodules be the reason as to why i couldnt bind the card?
i will try to bind the GPU now, maybe it will work then

 

Now i am able to bind the GPU and succesfully boot, but still stuck on:

2021-04-17 00:01:54.095+0000: Domain id=1 is tainted: high-privileges
2021-04-17 00:01:54.095+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)

 

 

apollo-diagnostics-20210417-0225.zip 80.21 kB · 1 download

I don't know if this helps you any, but my vm always has that at the bottom if the log and yet it works fine. I read somewhere here that those aren't really errors.

Link to comment
4 hours ago, joecool169 said:

I don't know if this helps you any, but my vm always has that at the bottom if the log and yet it works fine. I read somewhere here that those aren't really errors.

Sadly they are not just false errors, when i pass through the GPU i cant remote it with splashtop and can't ping it either

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.