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?
|
most of these answers are quite old, so I thought I'd give an updated summary of where I think each project is:
As I said, I would recommend Cudafy over all the others - if it could run on OpenCL as well as Cuda it would be perfect. EDIT SEP 2013 Cudafy now allows you to compile for both CUDA and OpenCL, so will run the same C# code on on all GPUs. This sounds fantastic, though I haven't tested the OpenCL compiling yet. |
|||||
|
Microsoft Research Accelerator is a .NET GP GPU library. The paper is at ftp://ftp.research.microsoft.com/pub/tr/TR-2005-184.pdf. |
|||
|
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. :) |
|||
|
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: Best of luck! |
||||
|
How about http://www.tidepowerd.com/ GPU.NET ? |
|||||
|
In addition to Brahma, take a look at C$ (pronounced "C Bucks"). From their CodePlex site:
It's based on C#, evaluated lazily, and targets multiple accelerator models:
|
|||
|
Here's another one: CUDAfy. It sounds like GPU.Net, in that something as simple as a method-attribute can cause the entire method to run on the GPU. But unlike GPU.Net, CUDAfy is free and open-source. GPU.Net appears to require no boilerplate code, though (According to their docs, it's "injected automatically by the build-tool"), while CUDAfy does. Here is an example of building an application with CUDAfy. |
||||
|
There's a new Microsoft solution in town - C++ AMP (intro here). Use from C# would be via P/Invoke, as demoed here for desktop apps, and here for (don't-call-it) Metro apps. Edit: I should note that C++ AMP has an open specification, which means it's not necessarily just for the MS compiler, or just for Windows. |
|||
|
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. |
|||
|
Managed DirectX somehow, might work |
|||
|
WPF also uses the GPU and you can add custom shaders using HLSL.
|
|||||||||
|