[vfio-users] problem with hugepages and sound

Okky Hendriansyah okky at nostratech.com
Thu Nov 5 01:11:56 UTC 2015


On November 5, 2015 at 03:15:47, Janusz (januszmk6 at gmail.com) wrote:
Hi, 
I have two questions, 
Sometimes I have some short freezes and fps drops in GTA 5, so I wanted 
to try hugepages if it would give me better perfornance, but in fact it 
gave me -10 fps and drops to 20-30 fps (while without it I have 60 with 
drops to 40). Did anyone experiecned worst performance with hugepages? 
maybe I am doing something wrong? 
my script: https://bpaste.net/show/9089719cbef8 
Hi Janusz,

Have you tried allocating and mounting the hugepages early at boot? As far as I know, hugepages would be more beneficial if it has contiguous space and we can guarantee it if it is allocated as early as possible. I think there’re 2 ways to do that:

1. Passing hugepages=N parameter to kernel command (defaults to 2 MB page size)

2. Passing options vm.nr_hugepages = N to sysctl config

Currently I use the first option. I don’t know how to correctly verify the performance boost after enabling hugepages other than feels a bit responsive  overall. 

I also tried to use transparent hugepages (transparent_hugepages=always) since sometimes I need to launch a VirtualBox image for my work so I need as much free memory as possible. The Windows 10 VM was quite stable using it. Though Alex explicitely did not recommend using transparent hugepages for GPU passthrough VM, so I revert back to using traditional hugepages. http://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-4-our-first.html

I also tried using 1 GB page size for hugepage (default_hugepagesz=1G hugepagesz=1G hugepages=16) but I noticed a very annoying flickering on the display. Reverting back to use 2 MB page size solved the issue.



Second question, I know this is vfio group but I don't know where else 
would be better to ask, becauseeverywhere where I asked, no one know how 
to fix it. I am using pulseaudio and I have some audio glitches, some 
crackles, don't know exactly how to describe it... It looks like VM is 
affecting my audio even before OVMF loads (starting VM) and it happens 
the whole time when I get some sound from VM. anyone know what can cause 
this? I tried different soundhw, sometimes I didn't get any disortion in 
the sound, but then the sound was behind something like 1 second. I have 
the same frequency in pulsaudio set like in windows settings. I even 
bought usb sound card, to passthrough it and redirect this sound from VM 
into my main sound card - poor quality. also tried streaming from 
windows by linco, ssh and pacat - got some delays, port of pulseaudio 
for windows - didn't managed to make it work... I know there is one more 
alternative - Jackd, but maybe someone have idea how to fix it before I 
start looking in jackd configuration... 
I also tried without pulseaudio on host, just alsa, and didn't helped 

My hw: 
msi z170a m7, i7 6700k, r9 290 


Thanks 
I experienced a noticable but random lagging on the audio when I use PulseAudio as the audio backend for the VM. At that time I used the HDA device with additional PulseAudio sample environment variables on the QEMU script. Now I’m using Alsa as the audio backend and using AC97 sound on the QEMU. It didn’t autodetected on my Windows 10 VM, but I googled for it and I found the driver and it is working very stable. The audio is crystal clear and no lag whatsover. I think this is the driver that I use: http://www.driverscape.com/download/intel%28r%29-82801db-dbm-ac--97-audio-controller Although some people said that there’s no driver for AC97 in 64-bit, mine works flawlessly and my Windows 10 is a 64-bit VM. 

I did not search for Realtek AC97 at first, since I noticed that from http://www.linux-kvm.org/page/Sound AC97 is an Intel 82801AA AC97, so I googled for “Intel 82801AA AC97 windows” and since the first link (from Intel) didn’t work for me, I used the second one (driverspace.com).



Best regards,

Okky Hendriansyah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20151105/162af4eb/attachment.htm>


More information about the vfio-users mailing list