Sunday, September 19, 2010

VS2010 Performance and Bad Video Drivers/Hardware - Redux

Video Driver Bug

Since Visual Studio 2010 is shipped, we continued to have a small but notable series of problem about performance that we've been able to attribute to bugs in video drivers and GPUs.

The issue first came up back during VS 2010 beta in October of 2009. Old, buggy drivers are the usual cause, some newer drivers and GPUs aren't as good at supporting VS's UI as we'd like.

Fortunately, the software rendering inside WPF is pretty good, so the easy fix here is to force WPF to ignore the GPU and use software rendering (WPF's software rendering is actually slightly faster than GPU based rendering on high end CPU with a mid-range graphics card - your mileage may vary).

But first, if you're seeing slow / broken screen updates you should verify you have the latest display drivers for your system. (See "Guidelines for troubleshooting graphics issues in WPF applications" for more information.)

If that doesn't fix it, then there are three ways to force WPF to use software rendering.

First and preferred, the final RTM version of VS2010 includes a UI for forcing hardware rendering off - for just VS. With VS2010 open, go to Tools | Options, then select Environment | General (as shown below). Then uncheck "Automatically adjust visual experience..." and "Use hardware graphics acceleration..."



Second, you can force software rendering mode for ALL WPF applications (including VS) by changing one registry key:

[HKEY_CURRENT_USER\Software\Microsoft\Avalon.Graphics]

"DisableHWAcceleration"=dword:00000001

Note that this key probably won't exist, and you'll probably need to create it. To turn hardware acceleration back on, just change the "1" to a "0".

Third, you can often adjust the hardware acceleration options from the display control panel. However, we don't recommend this option as it impacts the entire machine, the details vary by manufacturer, and the exact impact of all the different options is untested.

It should work this way.

Source: MSDN blog

No comments:

Post a Comment