3D Graphics performace issues with GPU pass through?


Recommended Posts

I've setup a working VM with GPU pass through. All seems well other than I'm seeing a significant reduction in 3D performance in the VM compared to a bare metal install of the OS on the same machine.

 

3D mark is down ~1100 points.

 

I'm using a Gigabyte 990FXA-UD5, FX6300 and Radeon R270.

 

As far as I can tell I have everything set as it should be. I've tried setting up another VM with the Bios set to OVMF to no avail.

 

The contents of my XML are below, any input would be most appreciated as I anticipating near bare metal performance.

 

<domain type='kvm' id='6' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

  <name>SSDVM</name>

  <uuid>c0440d25-0b1d-3360-bfbb-2e73d2ac5eca</uuid>

  <metadata>

    <vmtemplate name="Custom" icon="windows.png" os="windows"/>

  </metadata>

  <memory unit='KiB'>6815744</memory>

  <currentMemory unit='KiB'>6815744</currentMemory>

  <memoryBacking>

    <nosharepages/>

    <locked/>

  </memoryBacking>

  <vcpu placement='static'>5</vcpu>

  <cputune>

    <vcpupin vcpu='0' cpuset='0'/>

    <vcpupin vcpu='1' cpuset='1'/>

    <vcpupin vcpu='2' cpuset='2'/>

    <vcpupin vcpu='3' cpuset='3'/>

    <vcpupin vcpu='4' cpuset='4'/>

  </cputune>

  <resource>

    <partition>/machine</partition>

  </resource>

  <os>

    <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>

  </os>

  <features>

    <acpi/>

    <apic/>

    <hyperv>

      <relaxed state='on'/>

      <vapic state='on'/>

      <spinlocks state='on' retries='8191'/>

    </hyperv>

  </features>

  <cpu mode='host-passthrough'>

    <topology sockets='1' cores='5' 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/bin/qemu-system-x86_64</emulator>

    <disk type='file' device='disk'>

      <driver name='qemu' type='raw' cache='writeback'/>

      <source file='/mnt/cache/SSDVM/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/IsoShare2/windows8_1(2).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/IsoShare2/virtio-win-0.1.96.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'>

      <alias name='usb0'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>

    </controller>

    <controller type='pci' index='0' model='pci-root'>

      <alias name='pci.0'/>

    </controller>

    <controller type='ide' index='0'>

      <alias name='ide0'/>

      <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:00:9d:23'/>

      <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 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/SSDVM.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>

    <hostdev mode='subsystem' type='usb' managed='yes'>

      <source>

        <vendor id='0x046d'/>

        <product id='0xc01d'/>

        <address bus='4' device='4'/>

      </source>

      <alias name='hostdev0'/>

    </hostdev>

    <hostdev mode='subsystem' type='usb' managed='yes'>

      <source>

        <vendor id='0x046a'/>

        <product id='0x0021'/>

        <address bus='4' device='3'/>

      </source>

      <alias name='hostdev1'/>

    </hostdev>

    <hostdev mode='subsystem' type='usb' managed='yes'>

      <source>

        <vendor id='0x045e'/>

        <product id='0x028e'/>

        <address bus='4' device='2'/>

      </source>

      <alias name='hostdev2'/>

    </hostdev>

    <memballoon model='virtio'>

      <alias name='balloon0'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

    </memballoon>

  </devices>

  <qemu:commandline>

    <qemu:arg value='-device'/>

    <qemu:arg value='ioh3420,bus=pci.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=root.1,addr=00.0,multifunction=on,x-vga=on'/>

    <qemu:arg value='-device'/>

    <qemu:arg value='vfio-pci,host=00:14.2,bus=root.1,addr=01.0'/>

  </qemu:commandline>

</domain>

 

Link to comment

Hmmm. Five CPU cores should be enough. I'm still learning myself, so I can't help much in the way of troubleshooting, but I can tell you my experience with 3D Mark Extreme:

 

* Bare Metal: 6 cores/12 threads i7-4930K, 16GB RAM, Win 8.1 on SSD, GTX 970: graphics score 5497, physics score 14276, combined score 2457, overall score: 5329.

* VM: 2 cores/4 threads i7-4930K, 8GB RAM, Win 8.1 on HDD, GTX 970:  graphics score 5575, physics score 6029, combined score 2447, overall score: 4993.

 

It's within margin of error, except for the physics score which is 2 CPU cores vs 6. What are your exact results?

Link to comment

Yes, I thought the number of cores / memory should have been enough not thave resulted in a significant reduction in performance.

 

On the bare metal install of w7 the overall score is 5254 on the Unraid VM it's 4069 a difference of 1185.

 

Which is way more than I would have expected?

Link to comment

Okay, so we've established that Windows 7 vs 8.1 is one variable. I'd argue that the test results are moot just based on that. What other variables do you have in your setup? I assume we're testing with the same motherboard, CPU, and memory, but I'd prefer not to make assumptions. Are you using the exact same AMD driver?

Link to comment

Indeed the OS is different but I wouldn't have thought it would make that much difference. The hardware is all the same I will check the driver versions later.

 

The VM manages <30fps in project cars where as the be bare metal install of w7 is 50 - 60 (all the same quality settings).

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.