[SOLVED] Win10 VM slow on Debian host

Hi

I am just DOCUMENTING my SOLVED problem.
So my VM was slow, very slow with 3D applications.
CPU pinning wasn’t the problem.
The problem was nested virtualization.
The most important setting was the line with svm.
If your VM does not show the correct amount of cores you have to adjust the topology line according to your CPU.
Another bottleneck might be the cpu mode in the first line or the check in the same line.

  <cpu mode="host-passthrough" check="none" migratable="off">
    <topology sockets="1" dies="1" cores="8" threads="2"/>
    <cache mode="passthrough"/>
    <feature policy="require" name="topoext"/>
    <feature policy="disable" name="svm"/>
  </cpu>

Other optimizations would be:

  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>

And:

<hyperv mode="custom">
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
      <vpindex state="on"/>
      <synic state="on"/>
      <stimer state="on"/>
      <reset state="on"/>
    </hyperv>

Only useful for virtual disks otherwise they are unused:

<iothreads>2</iothreads>
<cputune>
    <vcpupin vcpu="0" cpuset="8"/>
    ...
    <emulatorpin cpuset="0,8"/>
    <iothreadpin iothread="2" cpuset="0,8"/>
  </cputune>

Hope it helps somebody :slight_smile:

PS:
Can’t find the discord link for the kvm-support server.
Ask in the looking glass discord for an invite but check if your VM is slow with a monitor or if it is LG.

I suspect that somehow triggers Windows VM to be running on Microsoft Hypervisor. So it becomes VM on VM.

On another day, a guy here told me he purposely do that to achieve good 3D performance in his games running on Windows VM. LOL