High CPU usage when KVM Windows guest plays audioCPU usage of KVMKVM reports strange CPU usage peaks (bash...

What to do with someone that cheated their way through university and a PhD program?

A Paper Record is What I Hamper

Why did Rep. Omar conclude her criticism of US troops with the phrase "NotTodaySatan"?

How to pronounce 'c++' in Spanish

As an international instructor, should I openly talk about my accent?

Do I need to watch Ant-Man and the Wasp and Captain Marvel before watching Avengers: Endgame?

Unknown code in script

All ASCII characters with a given bit count

What does a straight horizontal line above a few notes, after a changed tempo mean?

Mistake in years of experience in resume?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

Multiple options vs single option UI

Restricting the options of a lookup field, based on the value of another lookup field?

Combinatorics problem, right solution?

Is there really no use for MD5 anymore?

Can a Bard use the Spell Glyph option of the Glyph of Warding spell and cast a known spell into the glyph?

Drawing a german abacus as in the books of Adam Ries

What is this word supposed to be?

A faster way to compute the largest prime factor

What *exactly* is electrical current, voltage, and resistance?

What is purpose of DB Browser(dbbrowser.aspx) under admin tool?

How do I produce this Greek letter koppa: Ϟ in pdfLaTeX?

Find the identical rows in a matrix

Retract an already submitted recommendation letter (written for an undergrad student)



High CPU usage when KVM Windows guest plays audio


CPU usage of KVMKVM reports strange CPU usage peaks (bash infinite recursion)How to access KVM windows guest biosHost CPU temperature within KVM guestqemu KVM audio not working on guest OSXubuntu 16.04.1 high CPU usage when writing to SSDsystemd-udevd high cpu usageKVM Windows guest batteryHigh cpu steal on Core 0 of KVMCPU usage increases on all guests if 1 guest has high usage (QEMU-KVM)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2















I'm running a Windows 10 virtual machine as my daily driver, it's running on top of ubuntu server 16.04.
GPU and USB expansion card passthrough works just fine but I'm experiencing maxed out host CPU (shows up as "system" CPU usage but it is under qemu in htop) when the guest plays ANY audio, regardless if it's to the hypervisor provided ich9 sound card, passed-through onboard sound card (it is in it's own IOMMU group!) or the sound card that's built in the GPU.



The passed onboard sound card is built into the Z97 chipset.



Here is the VM xml file:



<domain type='kvm' id='1' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>Windowz</name>
<uuid>d7c7a1da-2083-49a0-a968-6f28ca9c914e</uuid>
<memory unit='KiB'>20971520</memory>
<currentMemory unit='KiB'>20971520</currentMemory>
<vcpu placement='static'>4</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-xenial'>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='4' threads='1'/>
</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>restart</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='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<backingStore/>
<target dev='sda' bus='sata'/>
<readonly/>
<boot order='2'/>
<alias name='sata0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<backingStore/>
<target dev='sdb' bus='sata'/>
<readonly/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdd'/>
<backingStore/>
<target dev='vdc' bus='virtio'/>
<alias name='virtio-disk2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/nvme0n1'/>
<backingStore/>
<target dev='vdd' bus='virtio'/>
<boot order='1'/>
<alias name='virtio-disk3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdb'/>
<backingStore/>
<target dev='vde' bus='virtio'/>
<alias name='virtio-disk4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdc'/>
<backingStore/>
<target dev='vdf' bus='virtio'/>
<alias name='virtio-disk5'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</disk>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='sata' index='0'>
<alias name='sata0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<controller type='virtio-serial' index='0'>
<alias name='virtio-serial0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</controller>
<controller type='usb' index='0' model='nec-xhci'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
<interface type='user'>
<mac address='52:54:00:5d:ea:ef'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
<alias name='channel0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='no' listen='0.0.0.0'>
<listen type='address' address='0.0.0.0'/>
</graphics>
<sound model='ich9'>
<alias name='sound0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
</source>
<alias name='hostdev0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
</source>
<alias name='hostdev1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</source>
<alias name='hostdev2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
</source>
<alias name='hostdev3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
</hostdev>
<redirdev bus='usb' type='spicevmc'>
<alias name='redir0'/>
<address type='usb' bus='0' port='1'/>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
<alias name='redir1'/>
<address type='usb' bus='0' port='2'/>
</redirdev>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
</memballoon>
</devices>
<qemu:commandline>
<qemu:arg value='-redir'/>
<qemu:arg value='tcp:1339::1337'/>
<qemu:arg value='-redir'/>
<qemu:arg value='tcp:3819::3819'/>
<qemu:arg value='-redir'/>
<qemu:arg value='tcp:29176::29176'/>
</qemu:commandline>
</domain>









share|improve this question














bumped to the homepage by Community 34 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    2















    I'm running a Windows 10 virtual machine as my daily driver, it's running on top of ubuntu server 16.04.
    GPU and USB expansion card passthrough works just fine but I'm experiencing maxed out host CPU (shows up as "system" CPU usage but it is under qemu in htop) when the guest plays ANY audio, regardless if it's to the hypervisor provided ich9 sound card, passed-through onboard sound card (it is in it's own IOMMU group!) or the sound card that's built in the GPU.



    The passed onboard sound card is built into the Z97 chipset.



    Here is the VM xml file:



    <domain type='kvm' id='1' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
    <name>Windowz</name>
    <uuid>d7c7a1da-2083-49a0-a968-6f28ca9c914e</uuid>
    <memory unit='KiB'>20971520</memory>
    <currentMemory unit='KiB'>20971520</currentMemory>
    <vcpu placement='static'>4</vcpu>
    <resource>
    <partition>/machine</partition>
    </resource>
    <os>
    <type arch='x86_64' machine='pc-i440fx-xenial'>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='4' threads='1'/>
    </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>restart</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='file' device='cdrom'>
    <driver name='qemu' type='raw'/>
    <backingStore/>
    <target dev='sda' bus='sata'/>
    <readonly/>
    <boot order='2'/>
    <alias name='sata0-0-0'/>
    <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
    <driver name='qemu' type='raw'/>
    <backingStore/>
    <target dev='sdb' bus='sata'/>
    <readonly/>
    <alias name='sata0-0-1'/>
    <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <disk type='block' device='disk'>
    <driver name='qemu' type='raw' cache='none' io='native'/>
    <source dev='/dev/sdd'/>
    <backingStore/>
    <target dev='vdc' bus='virtio'/>
    <alias name='virtio-disk2'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
    <driver name='qemu' type='raw' cache='none' io='native'/>
    <source dev='/dev/nvme0n1'/>
    <backingStore/>
    <target dev='vdd' bus='virtio'/>
    <boot order='1'/>
    <alias name='virtio-disk3'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
    <driver name='qemu' type='raw' cache='none' io='native'/>
    <source dev='/dev/sdb'/>
    <backingStore/>
    <target dev='vde' bus='virtio'/>
    <alias name='virtio-disk4'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
    <driver name='qemu' type='raw' cache='none' io='native'/>
    <source dev='/dev/sdc'/>
    <backingStore/>
    <target dev='vdf' bus='virtio'/>
    <alias name='virtio-disk5'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'>
    <alias name='pci.0'/>
    </controller>
    <controller type='sata' index='0'>
    <alias name='sata0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
    <alias name='virtio-serial0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='nec-xhci'>
    <alias name='usb'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <interface type='user'>
    <mac address='52:54:00:5d:ea:ef'/>
    <model type='virtio'/>
    <alias name='net0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <channel type='spicevmc'>
    <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
    <alias name='channel0'/>
    <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='no' listen='0.0.0.0'>
    <listen type='address' address='0.0.0.0'/>
    </graphics>
    <sound model='ich9'>
    <alias name='sound0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
    <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
    <alias name='video0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
    <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </source>
    <alias name='hostdev0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
    <address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
    </source>
    <alias name='hostdev1'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
    <address domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </source>
    <alias name='hostdev2'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
    <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
    </source>
    <alias name='hostdev3'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
    </hostdev>
    <redirdev bus='usb' type='spicevmc'>
    <alias name='redir0'/>
    <address type='usb' bus='0' port='1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
    <alias name='redir1'/>
    <address type='usb' bus='0' port='2'/>
    </redirdev>
    <memballoon model='virtio'>
    <alias name='balloon0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
    </memballoon>
    </devices>
    <qemu:commandline>
    <qemu:arg value='-redir'/>
    <qemu:arg value='tcp:1339::1337'/>
    <qemu:arg value='-redir'/>
    <qemu:arg value='tcp:3819::3819'/>
    <qemu:arg value='-redir'/>
    <qemu:arg value='tcp:29176::29176'/>
    </qemu:commandline>
    </domain>









    share|improve this question














    bumped to the homepage by Community 34 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      2












      2








      2








      I'm running a Windows 10 virtual machine as my daily driver, it's running on top of ubuntu server 16.04.
      GPU and USB expansion card passthrough works just fine but I'm experiencing maxed out host CPU (shows up as "system" CPU usage but it is under qemu in htop) when the guest plays ANY audio, regardless if it's to the hypervisor provided ich9 sound card, passed-through onboard sound card (it is in it's own IOMMU group!) or the sound card that's built in the GPU.



      The passed onboard sound card is built into the Z97 chipset.



      Here is the VM xml file:



      <domain type='kvm' id='1' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
      <name>Windowz</name>
      <uuid>d7c7a1da-2083-49a0-a968-6f28ca9c914e</uuid>
      <memory unit='KiB'>20971520</memory>
      <currentMemory unit='KiB'>20971520</currentMemory>
      <vcpu placement='static'>4</vcpu>
      <resource>
      <partition>/machine</partition>
      </resource>
      <os>
      <type arch='x86_64' machine='pc-i440fx-xenial'>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='4' threads='1'/>
      </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>restart</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='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <boot order='2'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
      </disk>
      <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <backingStore/>
      <target dev='sdb' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
      </disk>
      <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sdd'/>
      <backingStore/>
      <target dev='vdc' bus='virtio'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
      </disk>
      <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/nvme0n1'/>
      <backingStore/>
      <target dev='vdd' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
      </disk>
      <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sdb'/>
      <backingStore/>
      <target dev='vde' bus='virtio'/>
      <alias name='virtio-disk4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
      </disk>
      <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sdc'/>
      <backingStore/>
      <target dev='vdf' bus='virtio'/>
      <alias name='virtio-disk5'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
      </disk>
      <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
      </controller>
      <controller type='sata' index='0'>
      <alias name='sata0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      </controller>
      <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      </controller>
      <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
      </controller>
      <interface type='user'>
      <mac address='52:54:00:5d:ea:ef'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
      </interface>
      <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
      </channel>
      <input type='mouse' bus='ps2'/>
      <input type='keyboard' bus='ps2'/>
      <graphics type='vnc' port='5900' autoport='no' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
      </graphics>
      <sound model='ich9'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
      </sound>
      <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
      </video>
      <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
      <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
      </hostdev>
      <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
      <address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
      </hostdev>
      <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
      <address domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
      </hostdev>
      <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
      <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
      </source>
      <alias name='hostdev3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
      </hostdev>
      <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
      <address type='usb' bus='0' port='1'/>
      </redirdev>
      <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
      <address type='usb' bus='0' port='2'/>
      </redirdev>
      <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
      </memballoon>
      </devices>
      <qemu:commandline>
      <qemu:arg value='-redir'/>
      <qemu:arg value='tcp:1339::1337'/>
      <qemu:arg value='-redir'/>
      <qemu:arg value='tcp:3819::3819'/>
      <qemu:arg value='-redir'/>
      <qemu:arg value='tcp:29176::29176'/>
      </qemu:commandline>
      </domain>









      share|improve this question














      I'm running a Windows 10 virtual machine as my daily driver, it's running on top of ubuntu server 16.04.
      GPU and USB expansion card passthrough works just fine but I'm experiencing maxed out host CPU (shows up as "system" CPU usage but it is under qemu in htop) when the guest plays ANY audio, regardless if it's to the hypervisor provided ich9 sound card, passed-through onboard sound card (it is in it's own IOMMU group!) or the sound card that's built in the GPU.



      The passed onboard sound card is built into the Z97 chipset.



      Here is the VM xml file:



      <domain type='kvm' id='1' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
      <name>Windowz</name>
      <uuid>d7c7a1da-2083-49a0-a968-6f28ca9c914e</uuid>
      <memory unit='KiB'>20971520</memory>
      <currentMemory unit='KiB'>20971520</currentMemory>
      <vcpu placement='static'>4</vcpu>
      <resource>
      <partition>/machine</partition>
      </resource>
      <os>
      <type arch='x86_64' machine='pc-i440fx-xenial'>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='4' threads='1'/>
      </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>restart</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='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <boot order='2'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
      </disk>
      <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <backingStore/>
      <target dev='sdb' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
      </disk>
      <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sdd'/>
      <backingStore/>
      <target dev='vdc' bus='virtio'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
      </disk>
      <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/nvme0n1'/>
      <backingStore/>
      <target dev='vdd' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
      </disk>
      <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sdb'/>
      <backingStore/>
      <target dev='vde' bus='virtio'/>
      <alias name='virtio-disk4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
      </disk>
      <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sdc'/>
      <backingStore/>
      <target dev='vdf' bus='virtio'/>
      <alias name='virtio-disk5'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
      </disk>
      <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
      </controller>
      <controller type='sata' index='0'>
      <alias name='sata0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      </controller>
      <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      </controller>
      <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
      </controller>
      <interface type='user'>
      <mac address='52:54:00:5d:ea:ef'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
      </interface>
      <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
      </channel>
      <input type='mouse' bus='ps2'/>
      <input type='keyboard' bus='ps2'/>
      <graphics type='vnc' port='5900' autoport='no' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
      </graphics>
      <sound model='ich9'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
      </sound>
      <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
      </video>
      <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
      <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
      </hostdev>
      <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
      <address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
      </hostdev>
      <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
      <address domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
      </hostdev>
      <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
      <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
      </source>
      <alias name='hostdev3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
      </hostdev>
      <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
      <address type='usb' bus='0' port='1'/>
      </redirdev>
      <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
      <address type='usb' bus='0' port='2'/>
      </redirdev>
      <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
      </memballoon>
      </devices>
      <qemu:commandline>
      <qemu:arg value='-redir'/>
      <qemu:arg value='tcp:1339::1337'/>
      <qemu:arg value='-redir'/>
      <qemu:arg value='tcp:3819::3819'/>
      <qemu:arg value='-redir'/>
      <qemu:arg value='tcp:29176::29176'/>
      </qemu:commandline>
      </domain>






      audio virtual-machine kvm cpu-usage pci-passthrough






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 14 '17 at 11:02









      NemesNemes

      112




      112





      bumped to the homepage by Community 34 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 34 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Managed to find the answer, for anyone having the same issue. This post about unraid explains it all, updated my kernel from the stock version that comes with ubuntu 16.04 and issue is resolved.






          share|improve this answer
























          • What was the answer?

            – Michael Hampton
            Jul 13 '18 at 18:17












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f364964%2fhigh-cpu-usage-when-kvm-windows-guest-plays-audio%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Managed to find the answer, for anyone having the same issue. This post about unraid explains it all, updated my kernel from the stock version that comes with ubuntu 16.04 and issue is resolved.






          share|improve this answer
























          • What was the answer?

            – Michael Hampton
            Jul 13 '18 at 18:17
















          0














          Managed to find the answer, for anyone having the same issue. This post about unraid explains it all, updated my kernel from the stock version that comes with ubuntu 16.04 and issue is resolved.






          share|improve this answer
























          • What was the answer?

            – Michael Hampton
            Jul 13 '18 at 18:17














          0












          0








          0







          Managed to find the answer, for anyone having the same issue. This post about unraid explains it all, updated my kernel from the stock version that comes with ubuntu 16.04 and issue is resolved.






          share|improve this answer













          Managed to find the answer, for anyone having the same issue. This post about unraid explains it all, updated my kernel from the stock version that comes with ubuntu 16.04 and issue is resolved.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 14 '17 at 18:48









          NemesNemes

          112




          112













          • What was the answer?

            – Michael Hampton
            Jul 13 '18 at 18:17



















          • What was the answer?

            – Michael Hampton
            Jul 13 '18 at 18:17

















          What was the answer?

          – Michael Hampton
          Jul 13 '18 at 18:17





          What was the answer?

          – Michael Hampton
          Jul 13 '18 at 18:17


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f364964%2fhigh-cpu-usage-when-kvm-windows-guest-plays-audio%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...