Avalon Hardware Acceleration & Video Driver Compat
Hello. Seema Ramchandani here, PM of the Avalon 2d & 3D graphics team.
Many people have asked me about what is this celebrated feature called “Hardware Acceleration”. In this post, “hardware acceleration” refers to harnessing the GPU to render, leaving the CPU free for other calculations.
In Beta 2, Avalon attempts to hardware accelerate rendering on machines with video drivers newer than November 2004. Video drivers are implemented and made available by the video card manufacturers.
Our (my team’s and my) foremost goal is to ensure a stable and performant experience for as large portion of our users as possible. I’ve personally uncovered a few driver bugs in testing Avalon, and we want to make sure that the Avalon experience is not just performant but stable as well. Looking at the machines in my parent’s home, I know that a large portion of users have the same drivers that shipped with the computer. Some of our users with 2 year old video cards may not get hardware acceleration, but they will get a stable experience.
In Avalon, we offload the rendering costs of many features to the video driver, but we first check the date of your video driver and what it can handle. We run a basic rating of the driver from 0-2 and store the value as RenderingCapability.Tier. What Avalon hardware accelerates does not change between XPDM and WDDM, it changes based on how we rate the actual video card: does the card support PixelShader 2.0, have X Mb of RAM, etc…
Check out the SDK article: Graphics Rendering Tiers[1]. Due to the memory virtualization features of WDDM, we do not have a VRAM requirement for WDDM drivers.
POR for Hardware Acceleration
For Beta 2, we accelerate the rendering of Avalon graphics on GPUs with:
- WDDM drivers of all dates
- XPDM drivers more recent than November 2004, regardless of the OS.
For RTM, we might change the Hardware acceleration story, and I will update this posting. Changes would be in response to analysis of crash reports from our Beta release.
What are XPDM and WDDM? Their differences?
- XPDM: The Windows XP Display Driver Model.
- WDDM: The Windows Vista Display Driver Model. [Microsoft.com]: WDDM is a significant evolution of the graphics driver infrastructure and will not be backwards compatible with XPDM drivers.
The WDDM video driver model is only available on Vista machines; XPDM video driver model is available for both Vista, XP, and Server 2003 machines.
The DirectX team and the video card manufacturers have worked hard to bring the WDDM model to fruition, which brings a more reliable and stable graphics environment. For example:
- WDDM virtualizes their video memory: with this feature, your Avalon app is less likely to run out of video memory and fallback to software.
- A larger portion of the WDDM driver code is run in user mode rather than kernel mode (as opposed to XPDM); if the driver crashes in the kernel, the machine blue screens.
3D Anti-Aliasing Story
Avalon only offers 3D-Antialiasing on WDDM drivers. WDDM offers a more stable model and video memory management, both of which are more desirable when using 3DAA.
Avalon 3DAA stresses video drivers in a way that, up to the release of the Windows Driver Kit, has not been heavily tested before. When it came between our XP users’ computers bluescreen or seeing aliased 3d, we chose aliased 3d. More to come on this topic later.
Why do we enforce a driver date check on XPDM drivers?
Standard DX GPU usage, before Avalon, was largely graphics-heavy games. In our testing, we uncovered bugs in older, XPDM drivers that were not seen by users. Most video driver bugs are never detected by the user, but interacting with some can result in rendering artifacts and/or crashing of the video driver.
A kernel level crash is bad news. We do not want users to blue screen.
In November 2004, Microsoft released a new version of the driver testing guidelines; the drivers written after this date offer better stability. Avalon will use the hardware acceleration pipeline for these drivers and will fall back to software rendering for drivers that do not meet this date.
- Most machines released after November 2004 will have an acceptable driver out of the box
- Users can also update their drivers by visiting the video card manufacturer’s website.
How do I find the date of my video card driver?
In a cmd shell, run “dxdiag” and go to the Display tab. Some Vista users will find that their video drivers have not been published yet. J
I think my video driver has a bug, how can I tell?
When you see rendering artifacts of an Avalon application, the bug might be in several layers of the Avalon, DirectX, video driver rendering chain. The first debugging step to take is to see if the bug repros without your video driver involved; try turning off Avalon hardware acceleration[2] and compare the rendering with and without hardware acceleration enabled.
If you see a difference, first visit your video card manufacturer’s website and downloading the latest video drivers for your card. If you still see a rendering difference between your Avalon app with and without hardware acceleration, please report the bug via Microsoft’s ladybug tool and attach:
- Your driver information[3]
- Description of expected and actual rendering
- Simple application that repros the behavior (xaml-only is preferred)
- Screenshots of both behaviors, if possible.
Links of Interest
- Greg Schechter on WDDM & DWM
https://blogs.msdn.com/greg_schechter/archive/2006/04/02/566767.aspx
- Windows Driver Kit
https://www.microsoft.com/whdc/DevTools/default.mspx
- Submitting a bug report to Avalon
https://lab.msdn.microsoft.com/productfeedback/default.aspx
- PCI Express FAQ off of Microsoft.com
https://www.microsoft.com/whdc/device/display/PCIe_graphics.mspx
[1] https://windowssdk.msdn.microsoft.com/en-us/library/ms742196.aspx
[2] To disable HW acceleration for Avalon on a machine, add the following to your registry: [HKEY_CURRENT_USER\Software\Microsoft\Avalon.Graphics]
"DisableHWAcceleration"=dword:00000001
To re-set HW acceleration, delete the above registry key or replace the above with a 0 value:
[HKEY_CURRENT_USER\Software\Microsoft\Avalon.Graphics]
"DisableHWAcceleration"=dword:00000000
[3] Run “dxdiag /t” in a cmd window. Save the outputted file “dxdiag.txt” to the bug; this file has the information of your video card manufacturer, the name of your card, the driver date, and the driver version number.
Comments
- Anonymous
June 05, 2006
PingBack from http://code.sg/blog/?p=15 - Anonymous
June 05, 2006
The way to know if you are getting HW acceleration is still Perforator .. [that ships w/ the WinFX SDK]... - Anonymous
June 07, 2006
Seema is a program manager on my team focusing on 2d & 3d graphics in Avalon. She’s started her blog... - Anonymous
June 07, 2006
"Бульбашки Аэро" доступны только на драйверах не раньше ноября 2004 года. - Anonymous
July 20, 2006
Seema has a good write up of our hardware acceleration story which answers questions like: why might...