VGA Passthrough: Only displaying to DVI output

Hey everyone! I’m scratching my head over this one.

So I have a VGA passthrough setup and it works fine for the most part, I’m just hitting a little snag. My VM was working perfectly the first few times I booted it, and then all of a sudden it’s only displaying to one of my two monitors, only through the DVI port. This is weird because without changing anything to do with graphics (I think) it went from preferring DisplayPort on my much better monitor to only doing DVI on my worse monitor. I had this problem a couple months ago and made a forum post about it here, but life got in the way and I wasn’t able to pursue the issue. Now, with a new CPU and mobo, I am having the issue once again. I tried everything in that forum post that was suggested, and nothing works.

Here's my libvirt config
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
  <name>win10</name>
  <uuid>263d068b-d54b-4849-83a7-ac3fdeae4aea</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">33554432</memory>
  <currentMemory unit="KiB">33554432</currentMemory>
  <vcpu placement="static">16</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-4.1">hvm</type>
    <loader readonly="yes" type="pflash">/usr/share/ovmf/x64/OVMF_CODE.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
      <vendor_id state="on" value="1234567890ab"/>
    </hyperv>
    <kvm>
      <hidden state="on"/>
    </kvm>
    <vmport state="off"/>
    <ioapic driver="kvm"/>
  </features>
  <cpu mode="host-model" check="partial">
    <model fallback="allow"/>
    <topology sockets="1" cores="8" threads="2"/>
    <feature policy="require" name="topoext"/>
  </cpu>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="block" device="disk">
      <driver name="qemu" type="raw" cache="none" io="threads"/>
      <source dev="/dev/disk/by-id/nvme-nvme.c0a9-313930384531454336384631-435431303030503153534438-00000001-part1"/>
      <target dev="vda" bus="virtio"/>
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </disk>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <controller type="pci" index="0" model="pcie-root"/>
    <controller type="pci" index="1" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="1" port="0x8"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="2" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="2" port="0x9"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
    </controller>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0xa"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2"/>
    </controller>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0xb"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x3"/>
    </controller>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0xc"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x4"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0xd"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x5"/>
    </controller>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0xe"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x6"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </controller>
    <interface type="network">
      <mac address="52:54:00:e1:6d:94"/>
      <source network="default"/>
      <model type="e1000e"/>
      <address type="pci" domain="0x0000" bus="0x07" slot="0x00" 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="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
    </channel>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <sound model="ich9">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    </sound>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
      </source>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </hostdev>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x08" slot="0x00" function="0x1"/>
      </source>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    </hostdev>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="1"/>
    </redirdev>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="2"/>
    </redirdev>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:env name="QEMU_AUDIO_DRV" value="pa"/>
    <qemu:env name="QEMU_PA_SERVER" value="/run/user/1000/pulse/native"/>
  </qemu:commandline>
</domain>

PC SPECS:
Mobo: X399 Asrock Taichi
CPU: Threadripper 2950x
RAM: gskill aegis 3000 MHz cl16 64 GB
PSU: 850 w
GPU: GTX 1070
GPU: AMD Vega 56

is any OS in the guest able to use/detect the preferred monitor?
if not, does anything peculiar happen when you try?

I installed Manjaro in a separate vm, using a default config that virt-manager creates (other than piping the GPU and keyboard/mouse in) and it can use the monitor on a fresh install using nouveau drivers. I tried doing the install with nonfree drivers selected and it couldn’t start X, saying that it couldn’t find any screens.

In the windows VM if I use the DVI monitor and then go in Nvidia control panel, it can see the preferred monitor if I unplug it and plug it back in, but it won’t enable it. Windows display settings can’t even see the monitor.

Maybe a hardware issue?

Faulty cable?

1 Like

I’m using the same cable as I was using with the other VM and the monitor and cable work with the host.

I’ve tried the other ports on the GPU and have the same problem in the VM, only DVI works, whereas with the host all of the ports work. I also can verify the GPU performs normally. No weird stuttering or loss of performance to indicate some hardware problem.

Still not sure what the problem is… Anyone have any other ideas?

Are you sure it isn’t a hardware issue that’s showing itself only with more advanced drivers but not with the basic driver. Based on what you are saying, this is OS independent. When you tested the GPU with the host,are you using basic driver or the non-free driver?

I fixed it! My problem was that the CSM module wasn’t on in my BIOS. I enabled it and now the monitor works again. I have no idea why that was the solution

2 Likes

if CSM was the fix, that means at least one compontent of your system doesn’t actually support EFI.

Except that the host boots with UEFI and did it without CSM enabled. Also doesn’t windows 10 require a UEFI to boot? Other than the display problem, the 1070 performed fine. It’s not like I’m exactly running any legacy hardware in the system.

To be clear l, I’m not saying your necessarily wrong. That conclusion makes sense considering that’s what CSM does. It just doesn’t make any sense to me still.

its likely that something has partial EFI support.