<div dir="ltr">Milos - <div><br></div><div>What CPU are you using? </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 9, 2016 at 11:43 AM, Milos Kaurin <span dir="ltr"><<a href="mailto:milos.kaurin@gmail.com" target="_blank">milos.kaurin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Yes, this keeps coming up now and again on this list.<br><br></div>My solution was:<br><br></div>1. Buy a dedicated PCIE sound card<br></div>2. Pass it through to the guest<br></div><div>3. Route audio: mobo soundcard > guest soundcard<br><br></div><div>In essence, the always-on guest would handle audio, but I would still have crackles (rarely), especially from the web browsers (host & guest). Games not so much.<br><br></div><div>To fix crackles, I did the following:<br></div><div>1. In the kernel cmdline: Use hugepages, 16x1GB for the guest (16 for the host, 32 total)<br></div><div>2. In the kernel cmdline: Use cpuisol (6 cores for the gues, 2 for the host)<br></div><div>3. In the kernel cmdline: Use nohz_full and rcu_nocbs for the guest cores<br></div><div>4. In the virt XML: Use cputune, hugepages, cpu mode=host-passthrough with the correct topology<br>5. In the virt XML: iothreadpin and emulatorpin for the 2 host CPUs<br></div><div>6. In the virt XML: Use virtio wherever possible (net, block devices)<br><br></div><div>I think I covered everything. If anyone else has any other tips, please let me know.<br><br><br><br></div><div>Appenix<br><br><br></div><div>My /etc/default/grub: <br><br>GRUB_CMDLINE_LINUX="rhgb quiet intel_iommu=on iommu=pt kvm.ignore_msrs=1 rd.driver.pre=vfio-pci hugepagesz=1G default_hugepagesz=1G hugepages=16 nohz_full=1,2,3,5,6,7 rcu_nocbs=1,2,3,5,6,7 isolcpus=1,2,3,5,6,7"<br><br><br><br></div><div>My XML:<br><br><domain type='kvm'><br>  <name>Win10</name><br>  <uuid>4bb72e5b-c886-425f-8280-b69755ebf054</uuid><br>  <memory unit='KiB'>16777216</memory><br>  <currentMemory unit='KiB'>16777216</currentMemory><br>  <memoryBacking><br>    <hugepages/><br>  </memoryBacking><br>  <vcpu placement='static'>6</vcpu><br>  <iothreads>2</iothreads><br>  <cputune><br>    <vcpupin vcpu='0' cpuset='1'/><br>    <vcpupin vcpu='1' cpuset='5'/><br>    <vcpupin vcpu='2' cpuset='2'/><br>    <vcpupin vcpu='3' cpuset='6'/><br>    <vcpupin vcpu='4' cpuset='3'/><br>    <vcpupin vcpu='5' cpuset='7'/><br>    <emulatorpin cpuset='0,4'/><br>    <iothreadpin iothread='1' cpuset='0'/><br>    <iothreadpin iothread='2' cpuset='4'/><br>  </cputune><br>  <os><br>    <type arch='x86_64' machine='pc-i440fx-2.4'>hvm</type><br>    <loader readonly='yes' type='pflash'>/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd</loader><br>    <nvram>/var/lib/libvirt/qemu/nvram/Win10_VARS.fd</nvram><br>  </os><br>  <features><br>    <acpi/><br>    <apic/><br>    <kvm><br>      <hidden state='on'/><br>    </kvm><br>    <vmport state='off'/><br>  </features><br>  <cpu mode='host-passthrough'><br>    <topology sockets='1' cores='3' threads='2'/><br>  </cpu><br>  <clock offset='localtime'><br>    <timer name='rtc' tickpolicy='catchup'/><br>    <timer name='pit' tickpolicy='delay'/><br>    <timer name='hpet' present='no'/><br>  </clock><br>  <on_poweroff>destroy</on_poweroff><br>  <on_reboot>restart</on_reboot><br>  <on_crash>restart</on_crash><br>  <pm><br>    <suspend-to-mem enabled='no'/><br>    <suspend-to-disk enabled='no'/><br>  </pm><br>  <devices><br>    <emulator>/usr/bin/qemu-kvm</emulator><br>    <disk type='block' device='disk'><br>      <driver name='qemu' type='raw' cache='none' io='native'/><br>      <source dev='/dev/sdb'/><br>      <target dev='vda' bus='virtio'/><br>      <boot order='2'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/><br>    </disk><br>    <controller type='pci' index='0' model='pci-root'/><br>    <controller type='scsi' index='0' model='virtio-scsi'><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/><br>    </controller><br>    <controller type='usb' index='0' model='none'/><br>    <interface type='bridge'><br>      <mac address='52:54:00:3e:c8:03'/><br>      <source bridge='br0'/><br>      <model type='virtio'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/><br>    </interface><br>    <hostdev mode='subsystem' type='pci' managed='yes'><br>      <source><br>        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/><br>      </source><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/><br>    </hostdev><br>    <hostdev mode='subsystem' type='pci' managed='yes'><br>      <source><br>        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/><br>      </source><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/><br>    </hostdev><br>    <hostdev mode='subsystem' type='pci' managed='yes'><br>      <source><br>        <address domain='0x0000' bus='0x05' slot='0x00' function='0x0'/><br>      </source><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/><br>    </hostdev><br>    <hostdev mode='subsystem' type='pci' managed='yes'><br>      <source><br>        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/><br>      </source><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/><br>    </hostdev><br>    <memballoon model='none'/><br>  </devices><br></domain><br><br></div><div><br></div><br>​</div>
<br>_______________________________________________<br>
vfio-users mailing list<br>
<a href="mailto:vfio-users@redhat.com">vfio-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/vfio-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/vfio-users</a><br>
<br></blockquote></div><br></div>