Q35-3.0 vs i440fx-3.0 for Windows 10 with GPU in 2019?


Recommended Posts

Hi All,

 

I've had a windows 10 VM running on my machine now for the past couple years.  It has a Ryzen 1700 and a NVIDIA 1070 passed through and has been working...ok...  Recently I've turned it into a render slave for houdini/redshift and have noticed some instability.   Namely, it will crash (and crash unraid) when running heavy CPU/GPU/RAM activities.  One thing that I'm exercising in particular is the amount of data I'm pushing from system ram to the GPU ram.  I'm assuming that this is really heavy on the PCI-E lanes...which made me think.  

 

I'm currently using the 1440-fx-3.0 machine type - originally when I set this up I could not get pass-through working with Q35.  But...from what I understand, Q35 has better support for native PCI-E whereas 1440-fx is doing some kind of emulation.  It would seem that for rendering VIA GPU, unhindered PCIE would be best. 

 

Now we're several versions down the line and I'm wondering if people are using Q35 for windows 10 gaming PC's?  

 

Also, is it possible to convert a VM from one machine type to another without starting fresh?

 

Much thanks,

Rob

  • Like 1
Link to comment

For complete-ness, here is my current XML:

 

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' id='8'>
  <name>Windows 10</name>
  <uuid>15667ac1-2465-fe33-d840-a54b512b265b</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>20971520</memory>
  <currentMemory unit='KiB'>20971520</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>6</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='3'/>
    <vcpupin vcpu='2' cpuset='4'/>
    <vcpupin vcpu='3' cpuset='5'/>
    <vcpupin vcpu='4' cpuset='8'/>
    <vcpupin vcpu='5' cpuset='9'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-3.0'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/15667ac1-2465-fe33-d840-a54b512b265b_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'>
    <topology sockets='1' cores='6' 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='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/Windows 10/vdisk1.img'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <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_10_x64.iso'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <alias name='ide0-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/user/isos/virtio-win-0.1.141-1.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='qemu-xhci' ports='15'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:4e:e0:7e'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <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/domain-8-Windows 10/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>
    <input type='mouse' bus='ps2'>
      <alias name='input0'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input1'/>
    </input>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom file='/mnt/user/isos/Zotac.GTX1070Ti.PATCHED.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='0x2d' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
</domain>

 

Link to comment

Some people reporting better performance on Q35 others don't see any differences. Some people have more success passing a device to a VM with Q35 for others that machine type won't change anything. AMD cards for example with the newest drivers people get a black screen on i440fx and only drivers from end of last year are working, with Q35 there is no issue.

 

I can only speek for me and it feels a bit snappier in games with Q35 on the latest 6.7_RC5 version. I know, RC6 is out already, but I hadn't the time to test a lot. With the RC4 version Limetech indroduced a newer Qemu version whith which you're able now to set the correct link speed of the slot your GPU is plugged in. Earlier Qemu versions the GPU driver reported the wrong link speed and some software behaved odd. For me for example benchmarks like Firestrike always crashed at the beginning where it checks for hardware. With this new patched Qemu and an extra line in the xml the Nvidia system info tool is now reporting the correct link speeds and Firestrike works. 

 

Before you start switching over to Q35 make sure you have a backup of your VM. I always created a new VM with the machine type of my choice and pointed it to the already existing vdisk or pass through the NVME where Windows was already installed on. If you're on the 6.7 RC builds you can check if the Qemu part inserted at the end gives you a better performance. It's adviced to set up the link speed so it matches the speed of the slot the GPU is plugged in. In my case it looks like this at the end of the xml.

  <qemu:commandline>
    <qemu:arg value='-global'/>
    <qemu:arg value='pcie-root-port.speed=8'/>
    <qemu:arg value='-global'/>
    <qemu:arg value='pcie-root-port.width=16'/>
  </qemu:commandline>
</domain>

The topic for the whole PCI-root-port-patch discussion you can find here

 

Link to comment
  • 5 months later...
On 3/27/2019 at 7:54 PM, GHunter said:

FYI. @jonp mentioned in another post about dropping support for Q35 and Windows based VM's. More info here:

 

 

So keep that in mind before switching machine types for your Windows VM's.

Dropping q35 will be a huge issue for me. I finally got my win10 vm working by switching to q35. I spent 3 weeks on this nvidia code 43  issue and I just got it working. I'm gonna be super mad if they drop q35!

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.