Potential Issues with CPU Performance in VM

I recently created a Windows VM for gaming in Linux. I’ve fixed most of the problems but one area where I think there could be an issue is CPU performance. I have an i7 8700 and ran cinebench r20 in the VM and got a single core score slightly above an R7 1700 which seemed very low for this CPU. I then tested the CPU again in Windows on baremetal and the exact scores I got are:

VM - Cinebench
CPU: 2391
CPU (Single Core): 393

BM - Cinebench
CPU: 2703
CPU (Single Core): 446

The CPU multi-core score seems reasonable considering that I’m only using 5C/10T in the VM and the lower single core score. However the single core score itself is ~13.5% faster on bare metal than in the VM, I was expecting a performance drop of 10% at the worst going from bare metal to VM. Is this normal? Is there anything I can do to improve the performance in my VM? I have copied the CPU related data in the XML document for my VM in virt-manager below, thanks in advance for any help you can give me:

<vcpu placement="static">10</vcpu>
    <type arch="x86_64" machine="pc-q35-4.2">hvm</type>
    <loader readonly="yes" type="pflash">/usr/share/ovmf/x64/OVMF_CODE.fd</loader>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
      <vendor_id state="on" value="GenuineIntel"/>
      <hidden state="on"/>
    <vmport state="off"/>
    <ioapic driver="kvm"/>
  <cpu mode="host-model" check="partial">
    <topology sockets="1" cores="5" threads="2"/>

You’re not using hugepages.

Use them and you’ll be within 5% of your bare metal score.

Thanks so much for your help, I really appreciate it. I’ll look into that now.

1 Like