Jump to content

VM black screen after GPU pass through


Unriad

Recommended Posts

Hello! I have been upgrading my server to allot for Virtual Machines. My virtual machine works flawlessly until I try to pass through a GPU. My GPU is an RTX2060 KO Ultra, I’ve already taken the header off of the Vbios, and the virtual machine still powers on and works even with the GPU passed through (remote in from splash top that I downloaded during the VNC phase)

I’ve looked through some other threads on this forum and haven’t found a solution applicable to my case. I’m sorry if this is a dumb question, I’m 14 and I’ve had the server for about 2 years now and Ive Started experimenting with virtualization


I’m sure y’all need more Info so if you need something I’ll give it to ya!

 

thanks in advance!

Caleb

Link to comment

I did try another output, I’ve tried DP and DVI, for some reason Splashtop isn’t responding anymore even when I put it to start on start up. I did go back to vnc and found that Nvidia Control Panel had installed, I didn’t install that so I’m wondering if that means that it found my gpu?

Link to comment
15 minutes ago, Unriad said:

I did not instal the VirtIO graphics drivers

Sorry, but it sounds as a non sense to me :)

You do not install virtio drivers for the gpu, but amd or nvidia native drivers in the vm.

Make also sure you passthrough all the components of the gpu, not only the video.

Put them in a multifunction device, if you search in this forum category, you will find several discussion about how to do it.

Edited by ghost82
Link to comment

Since spalshtop isn’t working on startup I can’t install the drivers though, when I try to install drivers through VNC it says I can’t cause the GPU isn’t present, but when I pass the gpu through, Splashtop doesn’t work so I don’t have a way to install the drivers. There are some Graphics drivers in the VirtIO disk but I haven’t installed them, other than that I only have the Microsoft basic display adapter drivers, but like I said, I can’t access the vm when the gpu is passed through cause Splashtop isn’t connecting properly, anything I’m missing here?

Link to comment
7 minutes ago, ghost82 said:

Sorry, but it sounds as a non sense to me :)

You do not install virtio drivers for the gpu, but amd or nvidia native drivers in the vm.

Make also sure you passthrough all the components of the gpu, not only the video.

Put them in a multifunction device, if you search in this forum category, you will find several discussion about how to do it.

I’ll try that rq

Link to comment

i just realized I can VNC and use a graphics card pass through at the same time but it freezes when I try to install red hat drivers and nvidia drivers say that the gpu isn’t present. Also it seems that my ACS override settings have already put the gpu and sound component on the same slot but with different functions so I think multifunction isn’t a problem

Link to comment
15 minutes ago, Unriad said:

i just realized I can VNC and use a graphics card pass through at the same time

As far as I know it's not possible.

15 minutes ago, Unriad said:

Also it seems that my ACS override settings have already put the gpu and sound component on the same slot but with different functions

The acs setting has nothing to do with it, post you diagnostic file.

Link to comment
28 minutes ago, Unriad said:

What else can I try to fix the black screen?

 

1 minute ago, Unriad said:

Okay thank you! Also btw mine does not have a USB port 

mmm yes it has!Look here:

04:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU104 [GeForce RTX 2060] [10de:1e89] (rev a1)
	Subsystem: eVga.com. Corp. Device [3842:2066]
	Kernel driver in use: vfio-pci
04:00.1 Audio device [0403]: NVIDIA Corporation TU104 HD Audio Controller [10de:10f8] (rev a1)
	Subsystem: eVga.com. Corp. Device [3842:2066]
	Kernel driver in use: vfio-pci
04:00.2 USB controller [0c03]: NVIDIA Corporation TU104 USB 3.1 Host Controller [10de:1ad8] (rev a1)
	Subsystem: eVga.com. Corp. Device [3842:2066]
	Kernel driver in use: xhci_hcd
04:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU104 USB Type-C UCSI Controller [10de:1ad9] (rev a1)
	Subsystem: eVga.com. Corp. Device [3842:2066]

 

See devices 04:00.2 and 04:00.3

 

Try this:

 

1. in unraid, where you put check marks for vfio, put a check also on 04:00.2 and 04:00.3.

2. Replace the whole xml of your vm with this:

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit 664a4b46-aef6-b3a2-190d-bc0f77478019
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>Windows 10</name>
  <uuid>664a4b46-aef6-b3a2-190d-bc0f77478019</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>12</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='1'/>
    <vcpupin vcpu='1' cpuset='13'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='14'/>
    <vcpupin vcpu='4' cpuset='3'/>
    <vcpupin vcpu='5' cpuset='15'/>
    <vcpupin vcpu='6' cpuset='4'/>
    <vcpupin vcpu='7' cpuset='16'/>
    <vcpupin vcpu='8' cpuset='5'/>
    <vcpupin vcpu='9' cpuset='17'/>
    <vcpupin vcpu='10' cpuset='6'/>
    <vcpupin vcpu='11' cpuset='18'/>
  </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/664a4b46-aef6-b3a2-190d-bc0f77478019_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='6' 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/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.190-1.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <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>
    <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>
    <interface type='bridge'>
      <mac address='52:54:00:99:8b:c3'/>
      <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'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
      <rom file='mnt/user/isos/Vbios/rtx2060koultra.dump'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x2'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x3'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x3'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x093a'/>
        <product id='0x2530'/>
      </source>
      <address type='usb' bus='0' port='2'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x258a'/>
        <product id='0x1006'/>
      </source>
      <address type='usb' bus='0' port='3'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
</domain>

 

3. Reboot unraid and try to boot the vm

 

 

In your logs lots of lines with this:

2021-09-11T16:33:26.270915Z qemu-system-x86_64: vfio_region_write(0000:04:00.0:region1+0x19d2b8, 0x0,8) failed: Device or resource busy

 

I hope it's because you missed the usb parts, let me know.

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.

×
×
  • Create New...