vfio icon indicating copy to clipboard operation
vfio copied to clipboard

Latencymon

Open ppaslan opened this issue 1 year ago • 1 comments

Hi there!

First off, thank you for the amazing script! It has made setting up a Windows gaming VM much easier. However, I'm encountering some latency issues when running LatencyMon on the guest, even when the VM is idling. I'd really appreciate it if you could help me troubleshoot or let me know if you've encountered similar behavior in your setup.

I see small shutters and high latency readings in LatencyMon even when the VM is idle. I was hoping you could test this on your setup or advise on potential improvements.

Initially, I was using Proxmox to set up a Windows gaming VM, but I encountered several issues. When I switched to your script, most things worked perfectly, but I still had some very minor latency problems in LatencyMon. Additionally, on Proxmox, I would have to run the script 30-40 times due to the "Timed out waiting for bound device to appear under...." error.

Switching to ArchLinux improved this somewhat — now, I only have to run the script 2 or 3 times — but the latency issue has actually worsened.

Another issue I noticed (which I didn't check while on Proxmox, so I’m unsure if it was there) is that running the command watch lscpu -e never shows the performance cores I isolated for the VM ramping up in frequency, even when running CPU benchmarks in the guest.

Maybe this is normal when isolating CPUs, but I haven’t found any articles or documentation that states that this is expected behavior. Any insights on this would be appreciated.

My Setup:

Command-Line Arguments

I’m running the script with the following arguments: -m 12G -hugepages -hyperv -nonet -biosvars OVMF_VARS.4m.fd -noVirtio -pinvcpus 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 -win11 -pci 'NVIDIA|A2000|VL805/806|7a70' -run

Grub CMDLine

My current Grub configuration is: loglevel=3 quiet nomodeset intel_iommu=on iommu=pt video=efifb:off default_hugepagesz=1G hugepagesz=1G hugepages=12 isolcpus=0-15 nohz_full=0-15 rcu_nocbs=0-15 rqaffinity=16-31 rcpu_nocb_poll systemd.unified_cgroup_hierarchy=0 SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1

System Information

Host OS: ArchLinux (Headless)
CPU: 13th Gen Intel® Core™ i9-13900K
Motherboard: Z790 AORUS MASTER
RAM: 32GB Kingston KF564C32RS-16 DDR5-6400 CL32 (XMP profile)
GPUs:
    Intel: 13th Gen Core i9-13900K (Host)
    Nvidia: RTX 4090 (Passed through)
NVMe Drives:
    Kingston A2000 1TB (Passed through)
    WD Black SN850X NVMe SSD (Host)
USB: VIA VL805/806 (Passed through)
Other Devices: Onboard Wifi controller (Passed through)

ppaslan avatar Nov 10 '24 13:11 ppaslan

now, I only have to run the script 2 or 3 times

Yeah that's no good. It should work the first time. If you paste the output from times where it goes wrong I could look into why

Another issue I noticed (which I didn't check while on Proxmox, so I’m unsure if it was there) is that running the command watch lscpu -e never shows the performance cores I isolated for the VM ramping up in frequency, even when running CPU benchmarks in the guest.

That's interesting. It might be worth setting them all to performance to ignore frequency scaling to see if it gives better results. vcpu activity should cause the host to ramp up the clock rate of a core/thread-pair. It's either that or lscpu is reading some other value.

Out of curiosity what does vfio/main -cputhreads output? I wonder if Intel are using 0,1 core threads or 0,15 core threads for the Pcores

ipaqmaster avatar May 01 '25 01:05 ipaqmaster