[SOLVED] KVM low 2D graphics performance

Questions about virtualization software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

[SOLVED] KVM low 2D graphics performance

Post by powerhouse »

I'm running Windows 10 in a virtual machine using kvm with VGA passthrough (see my tutorial sticky). For the last 6 years I got nearly identical benchmarks when comparing to Windows on bare metal. Now my Windows 2D performance is down to a fraction of what it used to be.

I ran the Passmark 8 benchmark after I perceived some sluggishness in Lightroom. I can't tell when exactly this started, but it could be related either to the Linux Mint upgrade to 19, or the Windows 10 upgrade to 1803. Here the benchmark summary:
Capture-20180815-3.PNG
The red graph represents a benchmark done a year ago, giving the Windows VM 10 threads (5 core a 2 threads). At that time everything was fine.

The blue graph represents a recent benchmark of Windows 10 installed directly on the hardware I'm running (no VM). As you can see, it doesn't suffer from a performance drop in the 2D benchmark!

The yellow graph is a new Windows VM I created using virtlib / virt-manager (the graphical GUI). This represents the best result I got after manually tuning the xml config file.

The green graph is my Windows 10 VM restored from backup onto a new SSD. It is my current system, after I tried all the options I could think of.

As you can see, both the red and the blue benchmarks show no 2D issues. Only the two recent benchmarks show a severe performance drop in 2D graphics, and only there. All the other benchmarks are OK (the green memory benchmark, that is my latest benchmark on the current system, falls a little behind the others). Here the detailed 2D results:
Capture-20180815-3-2d.PNG
The results for Simple Vectors, Image Filters, and Direct 2D are OK. But Complex Vectors, Fonts and Text, and Windows Interface are bad. Finally Image Rendering speed literally sucks!

Here my hardware:
i7 3930k overclocked to 4.2 GHz
24GB RAM, thereof 16GB for the Windows VM using hugepages
Nvidia GTX 970 GPU passed to the Windows VM (VGA passthrough)
Samsung 850 EVO 250GB used for the first test (red graph)
Samsung 860 EVO 1TB used for all other benchmarks

Software:
Red benchmark: Linux Mint 18.3, qemu 2.5, Windows VM: Windows 10 Pro 1703
All other benchmarks: Linux Mint 19, qemu 2.11, Windows VM: Windows 10 Pro 1803
Yellow benchmark: libvirt 4.0.0, virt-manager 1.5.1, the rest same as above


I wonder if you made the same experience, or if this is a configuration problem on my system. Perhaps there is someone out there that has a solution.

Thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: KVM low 2D graphics performance

Post by powerhouse »

Thanks to a member at the reddit r/VFIO group I found the reason for the low 2D graphics performance. It turns out the Spectre vulnerability protection update in Windows didn't play well with 2D graphics.

Since good 2D graphics performance is essential for photo editing under Windows, I disabled the Spectre protection. However, this does expose Windows to the various Spectre vulnerabilities and is normally not recommended. I hope with time someone finds a way to fix it.

Here is a detailed description of the issue and the workaround.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
Locked

Return to “Virtual Machines”