KVM (Kernel Virtual Machine) Ubuntu 18.04 MSI MPG x570 Gaming Plus Ryzen 5 3600 Nvidia RTX 2070 Super

I am utilizing GPU passthrough, the purpose of this setup is to give me optimal performance in gaming, as well as maintaining the ability to have Ubuntu as my main platform. This will give me the ability to distro-hop and test out my skills on harder distros without nuking and paving.

The issue I have ran in to that I am having troubles with, is that my Windows 10 guest that I will be primarily using for gaming is not seeing any hyperthreading going on, I'm looking in to this because I've noticed frame rate drops as low as 50-70 fps than prior to virtualizing and big frame drops that almost appear as mini lag spikes, I know I will see performance loss but I want to do all that I can for maximum performance.

When I was utilizing the default container qemu, I was getting errors after changing settings in the xml file that said

qemu-system-x86_64: AMD CPU doesn't support hyperthreading. Please configure -smp options properly.

This error went away when I updated to qemu 4.1.0, although in my windows guest I can confirm hyperthreading is not being seen by utilizing the commands

CPU GET NumberOfCores,NumberOfLogicalProcessors /Format:List

Number of cores and logical processors match, indicating Windows sees all threads as real cores.

I found numerous articles I've been chasing online for the past couple days attempting to make something work, although I have not had any success.

I initially followed this guide

After that all my further edits have either been to resolve error code 43. and then cpu pinning mostly.

My motherboard has 3 seperate sata controllers, so I have one of the sata controllers (2 drives, ssd and hdd) passed directly through. The GPU is passed directly through, numerous USB are passed directly through. My host is running a 2GB Nvidia Quadro card.

Any direction would be greatly helpful.

XML Config file

<domain type='kvm'>
  <memory unit='KiB'>12386304</memory>
  <currentMemory unit='KiB'>12386304</currentMemory>
  <vcpu placement='static'>8</vcpu>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='5'/>
    <vcpupin vcpu='2' cpuset='6'/>
    <vcpupin vcpu='3' cpuset='7'/>
    <vcpupin vcpu='4' cpuset='8'/>
    <vcpupin vcpu='5' cpuset='9'/>
    <vcpupin vcpu='6' cpuset='10'/>
    <vcpupin vcpu='7' cpuset='11'/>
    <iothreadpin iothread='1' cpuset='4-5'/>
    <iothreadpin iothread='2' cpuset='6-7'/>
    <iothreadpin iothread='3' cpuset='8-9'/>
    <iothreadpin iothread='4' cpuset='10-11'/>
    <type arch='x86_64' machine='pc-i440fx-bionic'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
    <bootmenu enable='no'/>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='1234567890ab'/>
      <hidden state='on'/>
    <vmport state='off'/>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='4' threads='2'/>
    <cache level='3' mode='emulate'/>
    <feature policy='require' name='topoext'/>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/terry/Downloads/Win10_1903_V1_English_x64.iso'/>
      <target dev='hdb' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/terry/.kvm/virtio/virtio-win-0.1.141.iso'/>
      <target dev='hdc' bus='ide'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    <interface type='network'>
      <mac address='52:54:00:fb:32:91'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
    <console type='pty'>
      <target type='serial' port='0'/>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
        <address domain='0x0000' bus='0x2a' slot='0x00' function='0x1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
        <address domain='0x0000' bus='0x2a' slot='0x00' function='0x3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
        <address domain='0x0000' bus='0x26' slot='0x00' function='0x0'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='3'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>

Research I have found and referenced to some extent thus far, is below.


This claims since numa is on auto already that emulatorpin is not necessary, so I removed emulatorpin from my xml.



And I have tried with CPU model of Epyc as well as host-model with similar results


Well, I literally ran miles in a circle around my answer.

As my initial guide says at the bottom of building qemu 3.1 section

When this is done you can later use:

  <type arch='x86_64' machine='pc-q35-3.1'>hvm</type>


I didn't understand what this stuff meant though, so the machine type having the "3.1" at the end stood out as he was installing version 3.1, after more digging around the internet I found people saying that's the patched version to boot, it is not applied by default nor listed in virtual manager. I am not utilizing q35, but by running

/usr/local/bin/qemu-system-x86_64 -machine help

This gave me supported machine types, where I saw mine and utilized the 4.1 corresponding.

the next piece of this is specifying the emulator. We now want the new downloaded 4.1 qemu-system-x86_64 to emulate. Therefore this needs to be defined as well.

This one guide of his pretty much gets everything set if you pay attention to detail, which I do not feel I did.

I hope this can help others in the future. Goodluck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.