.NET Data-Parallel Library that Targets GPUs
28 July 2007 in Microsoft & ProgrammingDid you know you can use the power of the GPU to process data in .NET?
A new Microsoft research project, called Accelator, exposes a .NET library for performing parallel data processing using a computer’s GPU. The library translates the data-parallel operations on-the-fly to optimized GPU pixel shader code and API calls.
Accelerator is a .NET 2.0 DLL that requires DirectX 9 (included with Windows XP SP2) and a graphics card that supports Pixel Shader 2.0 or above. Graphics cards without hardware vertex processing, common on cheaper laptops, do not appear to work.
Accelerator is released under a non-commercial Shared Source license agreement. This means that while a developer can look at the source code, special permission is needed to actually use it in a production environment. Also, the source is not actually included in the installer or on the project’s wiki page.
The current build can be downloaded from Microsoft Research.
There are some issues you have to understand to fully take benefit from this:
- Parallel computational intensity: Your algorithm must require enough parallel computation to overcome the overhead involved in transmission of data to the GPU and use of several layers of software including Managed DirectX.
- Limited need for precision: A GPU can only deliver 32 bit floating point precision. The floating point model on GPUs is not quite compliant with IEEE standards and results can vary from one card to another. The model issues (rounding in particular) are improving.
- Regular (or bounded) memory access patterns: The GPU memory systems are optimized to exploit locality in images. Though a Gather primitive is provided and can be used effectively, algorithms that require a lot of irregular memory references tend to do less well.
- No Multi-GPU support: The current implementation only uses one GPU but future versions should target multi-core GPUs.
Like you do for games, you should keep both the graphic card drivers and the DirectX updated to take the most of the library.
How is this useful?
I can think of many situations where the computation power available in current GPUs can speedup data processing.
Folding@home is a really good example. In this project, the software is used in computers from all around the word to create a distributed computing grid that allows every computer to help in the research of protein folding/misfolding and related diseases. A implementation exists of this software that allows users with top graphic cards (PS3 owners for instance) take benefit from that hardware and help out.
Where to start?
You can start by downloading the msi package (requires the DirectX Runtime) and installing it. Afterwards, you can find a online short intro here or dig into the documentation and samples available on your installation folder.
The main beauty of this library, is that allows the programmer to use its normal imperative high-level programming language while keeping all aspects of the GPU hidden.
From the project white-paper you can read:
The speeds of the Accelerator versions are typically within 50% of the speeds of hand-written pixel shader code. Some benchmarks significantly outperform C versions on a CPU: they are up to 18 times faster than C code running on a CPU.
Search
Pages
Top Posts
- 15 Visual Studio .NET Add-Ins you won't live without
- Using SQLite in .NET
- How to get started with Silverlight Streaming
- Avoid chaos, don't let bugs take your project away
- Best-Ever Ad from Microsoft
Categories
- All
- Random tidbits
- Links
- Windows
- Fun
- Portuguese
- WebDev
- Programming
- Blogging
- Personal Experience
- Microsoft
- Tech
- OS
- Linux
- Security
- TV
- Software
- Databases
- Hardware
- WPF
Leave a Comment