All of lore.kernel.org
 help / color / mirror / Atom feed
From: rndbit <rndbit@sysret.net>
To: kvm@vger.kernel.org
Subject: poor performance of passed-through VGA
Date: Tue, 08 Apr 2014 17:01:45 +0300	[thread overview]
Message-ID: <53440149.3080201@sysret.net> (raw)

Hello,
I am one of those early tinkerers with VGA passthrough. This is very exciting feature
and as soon as i saw it i thought to myself that i want that "95% speed of bare metal"
as various sources claimed. So i invested into some harware only to find out that
actual 3d performance is far lower. I am not sure why it is the case so maybe someone
could either clarify if it is known defect or something to be expected. Or if this is
actually a bug and someone someone cared enough to tackle it i would gladly be a
test-monkey.

Hardware:
Motherboard: SABERTOOTH 990FX R2.0 (bios v2104)
CPU: AMD FX(tm)-8350
GPU1 (host): GeForce GTX 550 Ti
GPU2 (guest): Radeon R9 270X
QEMU 1.7.90 (from git)

qemu command line:
> /usr/local/bin/qemu-system-x86_64 \
> -enable-kvm -m 4096 -cpu qemu64 -machine q35,accel=kvm \
> -smp 8,sockets=1,cores=8,threads=1 \
> -drive file=/dev/sdc,if=none,id=virtio-disk0,format=raw,cache=none,aio=native \
> -device virtio-blk-pci,scsi=off,drive=virtio-disk0,id=disk0 \
> -drive file=/dev/sdd,if=none,id=virtio-disk1,format=raw,cache=none,aio=native \
> -device virtio-blk-pci,scsi=off,drive=virtio-disk1,id=disk1 \
> -device e1000,netdev=vnet0,mac=40:01:23:ff:9a:00 -netdev tap,id=vnet0 \
> -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
> -device vfio-pci,host=06:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
> -device vfio-pci,host=00:13.0,bus=pcie.0 \
> -device vfio-pci,host=00:13.2,bus=pcie.0 \
> -bios /home/novist/opt/src/seabios/out/bios.bin \
> -vga none

Kernel: 3.14 with kvm patches for 3.15 (i was hoping they would make a difference but sadly they dont).
Additional kvm options: iommu=1 vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1

> 00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
> 00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
> 06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Curacao XT [Radeon R9 270X]
> 06:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
Actual problem is that GPU seems to be underused. For example in passmark benchmark i
score only 15 FPS in directx9 complex test while on bare metal its 100 FPS. That is
quite a gap. With kernels prior 3.14 it was even worse - i could get only 10 FPS.

Another rather naive test i performed was checking gpu load with process hacker
while playing actual recent game (arma3 in this case). GPU utilization sits at about
20-30%, rarely 40% spikes. And it is lagy of course. Low settings make it somewhat
playable. On bare metal though very high settings run smooth. Its worth noting that
directx10/11 bencmarks of passmark perform much better than directx9 ones.

Here are benchmark results and GPU load graphs:
GPU load: http://imgur.com/M70CnIV
Benchmark: http://imgur.com/IeYh4Zc

As you see while directx11 performs at about acceptable rate (considering others preach
glorious 95% of bare metal performance) directx10 test is quite slower and directx9
performs terribly.

Not sure what other information i could provide. If there is any - i would be happy to
look it up. So any idea where this mythical "95% of bare metal performance" can be found?
Cant wait for some insight from a professional.

P.S. i am also adding 2d benchmark results if anyone cares.
GPU load: http://imgur.com/28x5DN8
Benchmark: http://imgur.com/562PJYl

             reply	other threads:[~2014-04-08 14:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 14:01 rndbit [this message]
2014-04-08 17:00 ` poor performance of passed-through VGA Alex Williamson
2014-04-08 19:24   ` rndbit
2014-04-08 19:47     ` Alex Williamson
2014-04-09 11:43       ` rndbit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53440149.3080201@sysret.net \
    --to=rndbit@sysret.net \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.