Hyperthreading on older Xeons

lukewp

New Member
May 4, 2020
5
0
1
36
I've searched the forum and Google but can't find an answer to my odd use case.

I use a HP Z800 for gaming (currently dual X5570's fitted but have a pair of X5670's to go in), it's not going to be the fastest machine around but I can live with the CPU limitations as I don't really play the latest and greatest games. It'll take quite a heafty graphics card before these Xeons become a severe bottleneck. Currently use a GTX1050 and it's constantly at 95%+ utilization, and that's a fairly reasonable mid-range card. CPU's are sitting at 15-20% with no single core anywhere near 100%.

I plan on starting a game streaming channel and have used Proxmox to virtualize the gaming and streaming machines as having 6/12 decade old cores has a lot of unused CPU resources but no way to use them all.

I have found most games are fine with Hyperthreading enabled and all 16 cores assigned to the VM, except one. The Unity engine (or rather this specific version of it) has an issue with hyperthreading and it kills performance. If I disable HT, I get a slight drop in performance in some games, but also other uses (compiling code for example).

My question is does KVM present CPU's in the same physical layout as a bare metal OS would see them? For example if cores 0, 2, 4 and 8 are the 'real' cores, does that translate to the same in a guest?

I have also found that trying to record gameplay doesn't work properly. I'm using a CPU encoder and some times it's silky smooth, then part way through it just drops frames and develops massive artifacts with no increase in CPU usage, then goes back to normal. My assumption is that the encoder process is being assigned to a thread that's on the same CPU core as the game engine or another intensive process. Normally I'd just use CPU afinity in Windows however I'm unsure if the virtual CPU's align with the physical topology, or even the same NUMA node.

The technical bits behind virtualization are a bit beyond my outdated skill-set and finding relevent information for such old CPU's isn't going well.

I did read about an issue with older HT implementations that led to cache latency if a process is moved from one 'fake' core inside the CPU to another.

I'd just boot straight from the Windows SSD to work it out without KVM being in the way, however the machine has a BIOS and the VM uses UEFI so I can't just boot on bare metal and see if the issues go away.

Thanks for any advice you may have :)
 
My question is does KVM present CPU's in the same physical layout as a bare metal OS would see them? For example if cores 0, 2, 4 and 8 are the 'real' cores, does that translate to the same in a guest?

No, on Linux ht cores and non-ht-cores are both equal and you don't see any difference from a perspective of a process. This and the memory layout (dimms on difference CPUs) is also abstracted. KVM VMs are running processes, so they are scheduled by the scheduler and run somewhere.

You can try to run with NUMA, so that you may have better performance.
 
No, on Linux ht cores and non-ht-cores are both equal and you don't see any difference from a perspective of a process. This and the memory layout (dimms on difference CPUs) is also abstracted. KVM VMs are running processes, so they are scheduled by the scheduler and run somewhere.

You can try to run with NUMA, so that you may have better performance.

I have had NUMA enabled and tried reducing the VM to 8 cores and pinning them to CPU0. What I found is although it seemed to have pinned properly, it was still using the RAM on CPU1. I've enabled MNI so will see how that pans out. I did find a performance increase just by reducing the cores and pinning them to a single socket at the expense of much higher utilisation inside the VM. Pretty much doubled the CPU load as would be expected by halving the available threads.
 
I had to abandon the project as I was getting too much stuttering on USB audio, I guess it was affecting all USB peripherals. The whole machine locked up twice on me in game and I ended up pulling out the Proxmox and bulk data drives and booting directly. I now can't transcode video properly on the fly, however I'll end up using a second machine for recording.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!