5

I would like to know if anyone has an example CUDA C# .Net project that works with VS 2010. I am running all 64 bit and CUDA 4.0.

I tried the following:

GPU .Net - failure, their application won't install due to proxy license issue

Cudafy - failure, samples would not run because of error message 'vsvars32.bat is missing' although I am targeting x64 (I think this must be an issue with either Cudafy code or nvcc.exe'

GASS .Net - failure, they have a .dll and a manual, but no sample project (that I could find) and their manual has no walkthrough (jumps straight in to technical features, it's not a primer)

Having no luck with VS2010, I switched to VS2008 and VC++:

http://llpanorama.wordpress.com/2010/06/18/cuda-gets-easier/ ...however his example falls flat because the cuda.rules file is no longer in cuda 4.0 making impossible to complete his walkthrough (at least with 4.0).

I also tried a myriad of blog examples, forums, and other google related look-ups. So far, all attempts have resulted in failure. However, I am able to execute the sample libraries that came with the SDK. These are written for VS2010 and VC++. I want to get this working with C#.

sapbucket
  • 6,795
  • 15
  • 57
  • 94

3 Answers3

3

CUDA.NET has not been maintained for quite some time and no longer works with the latest CUDA versions (primarily due to 64-bit pointers and the introduction of new _v2 suffixed functions not being picked up by dllimport). We tried contacting the company behind it and never got any replies. Since there are no license restrictions we updated the source and it is embedded in CUDAfy.NET. This is an open source project (LPGPL) that builds on CUDA.NET and simplifies its use further. CUDAfy website There are also a few tutorials on codeproject including: Using Cudafy for GPGPU Programming in .NET

Nick
  • 31
  • 1
2

I didn't find much, but there is documentation on it:

CUDA.NET Documentation

Also, there's this question and answer here on SO:

Hello-world for CUDA.Net

Community
  • 1
  • 1
Tim
  • 28,212
  • 8
  • 63
  • 76
1

GASS.Net has examples in 2.3.7 release. There is some problems with running these projects, but they can be solved with two steps: first you have to add -arch=sm_xx to post-build event, where xx is your compute capability. The second is properly configured system path variables, i have something like this:

  • LIB C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB
  • LIBPATH C:\Windows\Microsoft.NET\Framework\v3.5;C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB
  • CUDA_LIB_PATH %CUDA_PATH%\lib\x64
  • CUDA_PATH C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\
  • CUDA_BIN_PATH %CUDA_PATH%\bin
  • CUDA_INC_PATH %CUDA_PATH%\include
  • CUDA_PATH_V4_0 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\
  • INCLUDE C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE
  • Path C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v3.5;C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCPackages
  • VCINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
  • VS100COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
  • VS90COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\
  • VSINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0
Insomnious
  • 801
  • 7
  • 7