KVM (内核虚拟机)Ubuntu18.04MSIMPG x570游戏+ Ryzen 5 3600 Nvidia RTX 2070超级
我正在使用GPU通过,这个设置的目的是给我在游戏中的最佳性能,以及保持以Ubuntu作为我的主要平台的能力。这将使我有能力在不使用核武器和铺路的情况下,在更硬的发行版上分发和测试我的技能。
我遇到的问题是,我将主要用于游戏的Windows 10客户没有看到任何超线程正在进行,因为我注意到帧速率下降到比虚拟化之前低到50-70 fps,而大帧下降几乎看起来是小滞后峰值,我知道我会看到性能下降,但我想尽我所能达到最大的性能。
当我使用默认容器qemu时,在更改xml文件中的设置后会出现以下错误:
qemu-system-x86_64: AMD CPU doesn't support hyperthreading. Please configure -smp options properly.当我更新到qemu 4.1.0时,这个错误就消失了,尽管在我的windows来宾中,我可以通过使用命令来确认超线程没有被看到
wmic
CPU GET NumberOfCores,NumberOfLogicalProcessors /Format:List内核和逻辑处理器的数量相匹配,表明Windows将所有线程视为真正的核心。
在过去的几天里,我发现了很多我在网上寻找的文章,试图使一些东西发挥作用,尽管我没有取得任何成功。
我最初遵循了这个指南
在此之后,我的所有进一步编辑要么是解析错误代码43。然后主要是cpu固定。
我的主板有3个独立的sata控制器,所以我有一个sata控制器(2个驱动器,ssd和hdd)直接通过。GPU直接通过,大量USB直接通过。我的主机正在运行一张2GB的Nvidia象限卡。
任何方向都会很有帮助。
XML Config文件
<domain type='kvm'>
<name>Windows10</name>
<uuid>de7e92c8-cde1-4722-a20d-a3c791db265e</uuid>
<memory unit='KiB'>12386304</memory>
<currentMemory unit='KiB'>12386304</currentMemory>
<vcpu placement='static'>8</vcpu>
<iothreads>4</iothreads>
<cputune>
<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'/>
</cputune>
<os>
<type arch='x86_64' machine='pc-i440fx-bionic'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/Windows10_VARS.fd</nvram>
<bootmenu enable='no'/>
</os>
<features>
<acpi/>
<apic/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='8191'/>
<vendor_id state='on' value='1234567890ab'/>
</hyperv>
<kvm>
<hidden state='on'/>
</kvm>
<vmport state='off'/>
</features>
<cpu mode='host-passthrough' check='none'>
<topology sockets='1' cores='4' threads='2'/>
<cache level='3' mode='emulate'/>
<feature policy='require' name='topoext'/>
</cpu>
<clock offset='localtime'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
<timer name='hypervclock' present='yes'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<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'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<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'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='usb' index='0' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
</controller>
<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>
<controller type='usb' index='0' model='ich9-uhci2'>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
<master startport='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
</controller>
<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>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
<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'/>
</interface>
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<input type='tablet' bus='usb'>
<address type='usb' bus='0' port='1'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x2d' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x2d' slot='0x00' function='0x1'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x2d' slot='0x00' function='0x2'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x2d' slot='0x00' function='0x3'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x2a' slot='0x00' function='0x1'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x2a' slot='0x00' function='0x3'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x26' slot='0x00' function='0x0'/>
</source>
<boot order='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
</hostdev>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='2'/>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='3'/>
</redirdev>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</memballoon>
</devices>
</domain>到目前为止,我在一定程度上发现和参考的研究成果如下。
http://mathiashueber.com/cpu-pinning-on-amd-ryzen/#comments
https://www.reddit.com/r/VFIO/comments/9iukj5/whats_best_practice_for_ryzen_1800x_cpu_pinning/这是因为numa已经在auto上了,所以我从xml中删除了模拟器引脚。
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_tuning_and_optimization_guide/sect-Virtualization_Tuning_Optimization_Guide-NUMA-NUMA_and_libvirt#sect-Virtualization_Tuning_Optimization_Guide-NUMA-NUMA_and_libvirt-Using_emulatorpin
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_tuning_and_optimization_guide/sect-virtualization_tuning_optimization_guide-numa-numa_and_libvirt并尝试了Epyc的CPU模型和主机模型,并取得了类似的结果。
发布于 2019-08-25 03:07:45
嗯,我真的绕着我的回答跑了几英里。
正如我最初的指南所说,在构建qemu 3.1部分的底部
When this is done you can later use:
<os>
...
<type arch='x86_64' machine='pc-q35-3.1'>hvm</type>
...
</os>
and
<devices>
...
<emulator>/usr/local/bin/qemu3.1-system-x86_64</emulator>
...
</devices>不过,我不明白这是什么意思,所以当他安装3.1版时,在最后有"3.1“的机器类型非常突出。在互联网上深入挖掘之后,我发现人们说这是要启动的修补版本,它在默认情况下没有应用,也没有在虚拟管理器中列出。我不是在利用q35,而是通过运行
/usr/local/bin/qemu-system-x86_64 -machine help这给了我支持的机器类型,在那里我看到了我的,并使用了相应的4.1。
下一个步骤是指定模拟器。现在我们想要新下载的4.1QEMU-System-x86_64进行仿真。因此,这也需要定义。
如果你注意细节的话,他的这一份指南几乎可以把所有的东西都设置好,我觉得我没有做到。
我希望这能对将来的其他人有所帮助。古德勒克
https://askubuntu.com/questions/1168191
复制相似问题