tags:

views:

3374

answers:

7

I am trying to get more processing power out of my grid.

I am using all cpus/cores, is it possible to utilize the GPU with C#.

Anyone know any libraries or got any sample code?

A: 

Managed DirectX somehow, might work

Greg Dean
+4  A: 

Could I recommend XNA Game Studio as a possible avenue for exploration? It is obviously geared up for writing games, but gives you managed access to your graphics card and much better access to capability enumeration functions and shader development than was previously available in, say, Managed DirectX. There are also ways of combining WinForms and XNA into hybrid applications:

http://www.ziggyware.com/news.php?readmore=866

You'll have to put some effort into learning shader programming (XNA supports HLSL), but this may be a simpler approach than learning a vendor-specific solution such as nVidia's CUDA. The advantage is that you can program in a 100% managed environment. Here are some HLSL links:

http://www.ziggyware.com/weblinks.php?cat_id=9

The GPGPU site is also a recommended destination for general purpose GPU programming:

http://gpgpu.org/

Best of luck!

Dave R.
+14  A: 

Microsoft Research Accelerator is a .NET GP GPU library. The paper is at ftp://ftp.research.microsoft.com/pub/tr/TR-2005-184.pdf.

Mark Cidade
+9  A: 

I found Brahma... It also has a GPGPU provider that allows methods to run on the GPU... Thanks for the question... Learnt something new today. :)

Vyas Bharghava
A: 

WPF also uses the GPU and you can add custom shaders using HLSL.

Mark Cidade
+1  A: 

If your GPUs are all the same brand, you might be able to get GPGPU support from the vendor, either through Nvidia's CUDA or ATI's Stream. AFAIK, they provide DLLs, which you could use through P/Invoke.

Coderer
A: 

In addition to Brahma, take a look at C$ (pronounced "C Bucks"). From their CodePlex site:

The aim of [C$] is creating a unified language and system for seamless parallel programming on modern GPU's and CPU's.

It's based on C#, evaluated lazily, and targets multiple accelerator models:

Currently the list of intended architectures includes GPU, Multi-core CPU, Multi-GPU (SLI, CrossFire), and Multi-GPU + Multi-CPU Hybrid Architecture.

David Cuccia