Привет, ЛОР.
Запилил себе таки виртуалку для поигрулек, с семёрочкой максимальной и проброшенной видеокартой, да вот проблема - с процем что-то неладное.
Суть: в игрушках на открытых локациях FPS падает до нуля. Даже GTA IV, которая в вайне у меня летает, неиграбельна. В помещениях всё плавно и красиво.
Камень: AMD FX8350
Видео: Radeon R9 270X
На хосте - Gentoo ~amd64, гость - Windows 7 x64 SP1
qemu-2.0.0
Так как видеокарта проброшена и тормозов вызывать не должна, начал грешить на камень, и не ошибся. Скачал писькомерялку geekbench, затестил, и вот что получил:
Single core: 1922 у меня против 2132 в чарте писькомерялки. Multi core: 3553 против 11063, отставание аж на 7510 попугаев!
Виртуалку конфигурил через virt-manager, конфиг:
<domain type='kvm' id='8'>
<name>qwerty_nosound</name>
<uuid>d616d9cd-aa9d-564a-7999-704787e5ea6c</uuid>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>8</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-2.0'>hvm</type>
<boot dev='hd'/>
<bootmenu enable='no'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu mode='host-passthrough'>
</cpu>
<clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none' io='native'/>
<source file='/home/neverloved/work/qemu_windows/windows.img'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<shareable/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none' io='native'/>
<source file='/home/neverloved/work/qemu_windows/windows_games.img'/>
<backingStore/>
<target dev='vdb' bus='virtio'/>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
</disk>
<controller type='usb' index='0'>
<alias name='usb0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='ide' index='0'>
<alias name='ide0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='virtio-serial' index='0'>
<alias name='virtio-serial0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<controller type='sata' index='0'>
<alias name='sata0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</controller>
<filesystem type='mount' accessmode='mapped'>
<source dir='/home/neverloved'/>
<target dir='share'/>
<alias name='fs0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
</filesystem>
<interface type='bridge'>
<mac address='52:54:00:34:a4:74'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/3'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/3'>
<source path='/dev/pts/3'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<sound model='ac97'>
<alias name='sound0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='qxl' ram='65536' vram='65536' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
</source>
<alias name='hostdev0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</source>
<alias name='hostdev1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>
</source>
<alias name='hostdev2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x00' slot='0x12' function='0x2'/>
</source>
<alias name='hostdev3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
</hostdev>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
<seclabel type='none'/>
</domain>
virt-manager запускает qemu в таком виде:
/usr/bin/qemu-system-x86_64
-name qwerty_nosound
-S
-machine pc-i440fx-2.0,accel=kvm,usb=off
-cpu host
-m 4096
-realtime mlock=off
-smp 8,sockets=8,cores=1,threads=1
-uuid d616d9cd-aa9d-564a-7999-704787e5ea6c
-no-user-config
-nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/qwerty_nosound.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control
-rtc base=localtime
-no-shutdown
-boot menu=off,strict=on
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-device ahci,id=ahci0,bus=pci.0,addr=0x7
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5
-drive file=/home/neverloved/work/qemu_windows/windows.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,aio=native
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0xe,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-drive file=/home/neverloved/work/qemu_windows/windows_games.img,if=none,id=drive-virtio-disk1,format=qcow2,cache=none,aio=native
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0xd,drive=drive-virtio-disk1,id=virtio-disk1
-fsdev local,security_model=mapped,id=fsdev-fs0,path=/home/neverloved
-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=share,bus=pci.0,addr=0xc
-netdev tap,fd=19,id=hostnet0
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:34:a4:74,bus=pci.0,addr=0x3
-chardev pty,id=charserial0
-device isa-serial,chardev=charserial0,id=serial0
-vnc 127.0.0.1:0
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2
-device AC97,id=sound0,bus=pci.0,addr=0x4
-device vfio-pci,host=03:00.1,id=hostdev0,bus=pci.0,addr=0x8
-device vfio-pci,host=03:00.0,id=hostdev1,bus=pci.0,addr=0x9
-device vfio-pci,host=00:12.0,id=hostdev2,bus=pci.0,addr=0xa
-device vfio-pci,host=00:12.2,id=hostdev3,bus=pci.0,addr=0xb
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
Собственно, вопрос: что делать? Как поднять производительность CPU в виртуалке? ЛОР, помоги!