Announcement

Collapse
No announcement yet.

Low 2D graphics performance in passed through Windows 10 VM

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Low 2D graphics performance in passed through Windows 10 VM

    I've been running Windows as a virtual machine with VGA passthrough for the past 6 years, always with top notch Windows performance. Recently around April or May I noticed a sluggishness in Lightroom (Windows). Running Passmark 8 I discovered a sharp drop in 2D graphics performance. All other results are in line with previous results.



    The above graphs are as follows:

    Red graph - old benchmark from July 2017 running Windows 10 (1703) as a VM with 10 threads (5 core a 2 threads). At that time everything was fine.

    Blue graph - recent benchmark of Windows 10 (1803) installed directly on the hardware (no VM). As you can see, it doesn't suffer from a performance drop in the 2D benchmark!

    Yellow graph - new Windows 10 (1803) VM created using virtlib / virt-manager. This represents the best result I got after manually tuning the xml config file.

    Green graph - Windows 10 (1803) VM restored from backup onto a new SSD. This is my current system.


    Here the 2D graphics benchmark details:




    Using kvm with pci/vga passthrough, I have always gotten about the same performance results as if I was running Windows directly on the hardware. But now this doesn't work anymore.

    Since I use Windows solely for photo processing, 2D performance actually matters to me quite a lot.

    Here the 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

    On the Linux host I issued the following command to make Passmark happy:

    Code:
    echo "options kvm ignore_msrs=1" >> /etc/modprobe.d/kvm.conf
    I really like to solve this issue. Unfortunately there are many variables here. The following happened around the time of the 2D performance drop:

    1. I upgraded (installed) Linux Mint to 19 (Ubuntu 18.04) and thus also upgraded the kvm hypervisor / qemu.
    2. Windows 10 upgraded to version 1803.
    3. I updated the Nvidia drivers.
    4. Removed 2 faulty DRAMs - have got now just 24GB RAM.


    So far I've tried the following find the culprit:

    1. Downgraded the Nvidia driver, back to an old version from last year - doesn't make a difference.
    2. Checked and readjusted hugepages - nope.
    3. Tried various hypervisor configuration options.
    4. Adjusted the power options to performance.
    5. Edited registry to enable MSI (message signaled interrupts) for my GTX970 graphics card and some PCI devices I pass through.
    6. Updated the vfio drivers (disk, network)
    7. Installed the qemufwcfg driver, though I'm not using the feature.

    I haven't tried yet removing the Hyper-V enlightenments, nor enabling nested virtualization in the qemu script.

    Any ideas on what the source of the problem is? Or where to look for.

  • #2
    We don't do any testing on QEMU VMs and don't have any equivalent setup to compare against.

    That's an interesting note about "ignore_msrs" settings however. It should help out other people get PerformanceTest running in qemu. So thanks for that.

    But there are a *lot* or variables. Different Linux versions, different virtualisation software, different Windows patch releases, etc...
    Likely there are other hidden differences as well. Windows now silently pushes device driver updates. There was also the microcode updates for CPU vulnerabilities.

    So we don't know what the cause is.

    I have to make the obvious comment however. Why put yourself through this pain? Why run Windows in Linux if performance & compatibility is important?

    Comment


    • #3
      David, thanks for the reply. I think I actually found the ignore_msrs somewhere on this forum, but it's been a while.

      Here comes the good news: I found the culprit. It's the Spectre protection under Windows. When I turn that off, 2D graphics benchmarks are back to normal. In all aspects the Windows VM performs like a bare metal installation. Here the benchmark after disabling Spectre:

      Click image for larger version

Name:	Capture-20180817-4-spectre-disabled-0x714.png?resize=768%2C663&ssl=1.png
Views:	954
Size:	61.8 KB
ID:	42731

      Legend:
      Red graph - Windows 10 (1803) installed on bare metal, with Spectre protection enabled
      Blue graph - Windows 10 (1803) as VM on Linux, with Spectre protection enabled
      Yellow graph - Windows 10 (1803) as VM on Linux, with Spectre protection disabled

      Below are the 2D benchmarks:

      Click image for larger version

Name:	Capture-20180817-4-spectre-disabled-0x714-2d.png?resize=768%2C852&ssl=1.png
Views:	953
Size:	80.4 KB
ID:	42732


      I begin to wonder if the Windows bare metal installation indeed had the Spectre updates installed, respectively the Intel microcode.

      Any idea of what could have happened here?

      Comment


      • #4
        Originally posted by David (PassMark) View Post
        ...That's an interesting note about "ignore_msrs" settings however. It should help out other people get PerformanceTest running in qemu. So thanks for that.
        You are welcome

        Originally posted by David (PassMark) View Post
        ...Windows now silently pushes device driver updates. There was also the microcode updates for CPU vulnerabilities.
        It looks like this could be the reason for the 2D performance dive. By doing its changes in secrecy, Microsoft is often doing more damage to the user than good.

        Originally posted by David (PassMark) View Post
        I have to make the obvious comment however. Why put yourself through this pain? Why run Windows in Linux if performance & compatibility is important?
        I'm using Windows for one purpose only - to process photos in Adobe Lightroom and related products. (While the tools under Linux get better by the day, they are still not as good as the commercial variants.) All my other stuff runs on Linux.

        I've been running Windows as a VM on Linux for the past 6 years and never had any troubles. This is actually the first time my Windows VM showed a performance drop.

        But there is another reason, which you kind of hinted yourself. Microsoft does things that can break compatibility. Most Microsoft products are compatible to themselves only, and that compatibility may end any day. I don't want to take the risk of loosing data. So when I process photos, they are later stored in multiple places all accessible from my Linux host.

        Since I'm using LVM (logical volumes) as the underlying storage to Windows, I can easily snapshot, backup, copy or migrate Windows, even while I work in Windows. I could carry on, but I guess it's a matter of what you are used to.

        Comment


        • #5
          Just for information, I filed a bug report here: https://bugs.launchpad.net/qemu/+bug/1788665

          Comment

          Working...
          X