[vfio-users] GPU performance degradation using KVM and Nvidia

Alex Williamson alex.l.williamson at gmail.com
Sat Aug 29 16:01:23 UTC 2015


On Sat, Aug 29, 2015 at 9:43 AM, Tobias B. <honeypot.carbage at aechelon.de>
wrote:

> Hello,
>
> when I use KVM in combination with a Nvidia GPU I get far lower fps values
> than expected. Sometimes even 60% lower than native performance. I don't
> use Hugepages and I pin my vCPUs according to the real pCPUs, like 1-3,5-7.
> Physical core #0 is assigned to the host and #1,#2,#3 entirely to guest.
> But sometimes the guest stutters, when the host is busy doing cpu intensive
> tasks on it's cores


What else would you expect to happen?  If the host needs CPU and you
haven't prioritized the QEMU threads or used isolcpus to completely remove
host processes from those cores, then the host is going to share those
cores and the guest performance will suffer.  If you want to sacrifice host
performance for the guest, boot with isolcpus=1-3,5-7 nohz_full=1-3,5-7


>   <vcpu placement='static' cpuset='1-3,5-7'>6</vcpu>
>

You should be pinning each vcpu, ex:

  <vcpu placement='static'>6</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='1'/>
    <vcpupin vcpu='1' cpuset='2'/>
    <vcpupin vcpu='2' cpuset='3'/>
    <vcpupin vcpu='3' cpuset='5'/>
    <vcpupin vcpu='4' cpuset='6'/>
    <vcpupin vcpu='5' cpuset='7'/>
  </cputune>


>     <disk type='file' device='disk'>
>       <driver name='qemu' type='qcow2' cache='none' io='native'/>
>       <source file='/home/tobias/Dokumente/test.qcow2'/>
>       <target dev='vda' bus='virtio'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
> function='0x0'/>
>     </disk>
>

qcow for your disk could also be contributing to VM performance issues.


>   <qemu:commandline>
>     <qemu:arg value='-device'/>
>     <qemu:arg value='vfio-pci,host=02:00.0,multifunction=on,x-vga=on'/>
>     <qemu:arg value='-device'/>
>     <qemu:arg value='vfio-pci,host=02:00.1'/>
>   </qemu:commandline>
>

*gag*, I explain in part 5 of my guide how to apply x-vga=on without these
awful <qemu:arg> options that hide the assigned device from libvirt.  BTW,
you're multifunction=on option isn't doing much here since you're not
giving the device an explicit VM address.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20150829/9120e5fb/attachment.htm>


More information about the vfio-users mailing list