Issues with Video Performance on Hyper-V Hosts
This little “issue” on one of my Hyper-V hosts had been giving me a headache for a while; for some unknown reason, the Hyper-V host began to have issues when displaying specific screens. It wasn’t happening on my Dell servers, just on a couple of self-built “no-name” servers. Since these servers were used by our QA department, people sometimes logged on to them straight from the servers’ console, and the display issues drove them nuts. So I decided to investigate further.
After a bit of Googling I found this KB:
Video performance may decrease when a Windows Server 2008-based computer has the Hyper-V role enabled and an accelerated display adapter installed:
Reading the KB, it turns out that this issue occurs when a device driver or other kernel mode component makes frequent memory allocations by using the PAGE_WRITECOMBINE protection flag set while the hypervisor is running. When the kernel memory manager allocates memory by using the WRITECOMBINE attribute, the kernel memory manager must flush the Translation Lookaside Buffer (TLB) and the cache for the specific page. However, when the Hyper-V role is enabled, the TLB is virtualized by the hypervisor.
What is “Inside Microsoft Teams”?
“Inside Microsoft Teams” is a webcast series, now in Season 4 for IT pros hosted by Microsoft Product Manager, Stephen Rose. Stephen & his guests comprised of customers, partners, and real-world experts share best practices of planning, deploying, adopting, managing, and securing Teams. You can watch any episode at your convenience, find resources, blogs, reviews of accessories certified for Teams, bonus clips, and information regarding upcoming live broadcasts. Our next episode, “Polaris Inc., and Microsoft Teams- Reinventing how we work and play” will be airing on Oct. 28th from 10-11am PST.
Therefore, every TLB flush sends an intercept into the hypervisor. This intercept instructs the hypervisor to flush the virtual TLB. This is an expensive operation that introduces a fixed overhead cost to virtualization. Usually, this is an infrequent event in supported virtualization scenarios. However, some video graphics drivers may cause this operation to occur very frequently during certain operations. This significantly magnifies the overhead in the hypervisor.
It turns out that this “issue” usually happens with self-built servers, and not with known brand servers such as HP Proliant or Dell PowerEdge. Also, this is usually reported when the Hyper-V hosts are using ATI display adapters.
So, what should you do to fix this “issue” which shouldn’t have been there in the first place? Well currently, when you enable the Hyper-V role in Windows Server 2008, do not install the drivers for high performance accelerated graphics adapters. This behavior will not occur when you use the Vga.sys or Vgapnp.sys generic video drivers that are included with Windows Server 2008.
To revert to the generic video driver, you can uninstall any high performance vendor-specific video driver.
To uninstall the video adapter driver, open Server Manager and navigate to Diagnostics > Device Manager.
Expand Display Adapters, right-click on your high performance vendor-specific video driver, and select Uninstall.
BTW, this shouldn’t happen on servers that are running Server Core installation of Hyper-V.