CUDA c#。net示例项目?VS2010

时间:2022-01-19 21:37:04

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.

我想知道是否有人有使用VS 2010的CUDA c# . net项目的例子。我正在运行64位和CUDA 4.0。

I tried the following:

我试着以下:

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

GPU。net失败,由于代理许可证的问题,他们的应用程序不会安装

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'

Cudafy—由于错误消息vsvars32,示例无法运行。bat没有出现“尽管我的目标是x64(我认为这肯定是Cudafy代码或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)

GASS。net -失败,他们有一个。dll和一个手册,但是没有示例项目(我可以找到),而且他们的手册也没有详细介绍(直接跳转到技术特性,它不是入门)

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

由于对VS2010没有什么好感,我改用VS2008和vs++:

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).

http://llpanorama.wordpress.com/2010/06/18/cuda-gets-easier/…然而,他的例子失败了,因为cuda.rules文件已经不在cuda 4.0中,因此不可能完成他的演练(至少是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#.

我还尝试了大量的博客示例、论坛和其他谷歌相关的查找。到目前为止,所有的尝试都以失败告终。但是,我可以执行SDK附带的示例库。这些是为VS2010和vc++编写的。我想让c#起作用。

3 个解决方案

#1


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

CUDA。NET在相当长的一段时间内都没有得到维护,并且不再使用最新的CUDA版本(主要是由于64位指针和没有由dllimport接收的新_v2后缀函数的引入)。我们试图联系背后的公司,但没有得到任何回复。由于没有许可证限制,我们更新了源代码,并嵌入到CUDAfy.NET中。这是一个基于CUDA的开源项目(LPGPL)。NET简化了它的使用。CUDAfy网站也有一些关于codeproject的教程,其中包括:在。net中使用CUDAfy进行GPGPU编程。

#2


2  

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

我没有发现太多,但是有文件证明:

CUDA.NET Documentation

CUDA。网络文档

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

同样,这里有一个问题和答案

Hello-world for CUDA.Net

hello world为CUDA.Net

#3


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:

盖斯。Net在2.3.7版本中有示例。运行这些项目存在一些问题,但是它们可以通过两个步骤来解决:首先,您必须将-arch=sm_xx添加到后构建事件中,其中xx是您的计算能力。第二个是正确配置的系统路径变量,我有如下内容:

  • LIB C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB
  • Visual Studio 9.0 \ LIB C:\Program Files (x86)\Microsoft 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
  • LIBPATH C:\Windows\ Microsoft.NET \ Framework \ v3.5;C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727;C:\程序文件(x86)\ Microsoft Visual Studio 9.0 \ VC \ LIB
  • CUDA_LIB_PATH %CUDA_PATH%\lib\x64
  • CUDA_LIB_PATH % CUDA_PATH % \ lib \ x64
  • CUDA_PATH C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\
  • CUDA_PATH C:\Program Files\NVIDIA GPU计算工具包\ CUDA \ v4.0 \
  • CUDA_BIN_PATH %CUDA_PATH%\bin
  • CUDA_BIN_PATH % CUDA_PATH % \ bin
  • CUDA_INC_PATH %CUDA_PATH%\include
  • CUDA_INC_PATH % CUDA_PATH % \包括
  • CUDA_PATH_V4_0 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\
  • CUDA_PATH_V4_0 C:\Program Files\NVIDIA GPU计算工具包\ CUDA \ v4.0 \
  • INCLUDE C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE
  • 包括C:\Program Files (x86)\Microsoft Visual Studio 9.0 \ VC \包括
  • 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
  • 路径C:\Program Files\NVIDIA GPU计算工具包\ CUDA \ v4.0 \ bin \;% SystemRoot % \ system32系统;% SystemRoot %,% SystemRoot % \ system32系统\ Wbem;% SystemRoot % \ system32系统\ WindowsPowerShell \ v1.0 \;C:\ Program Files \ Microsoft SQL Server \(x86)100 \ Binn \ \工具;C:\ Program Files \ Microsoft SQL Server \ 100 \ Binn \ \工具;C:\ Program Files \ Microsoft SQL Server \ 100 \ DTS \ Binn \;C:\程序文件(x86)\ 9.0 \ Common7 \ Microsoft Visual Studio IDE;C:\程序文件(x86)\ Microsoft Visual Studio 9.0 \ VC \ bin,C:\ Program Files \ Microsoft Visual(x86)
  • VCINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
  • VCINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0 \ VC
  • VS100COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
  • VS100COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 10.0 \ Common7 \ \工具
  • VS90COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\
  • VS90COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 9.0 \ Common7 \ \工具
  • VSINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0
  • VSINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0

#1


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

CUDA。NET在相当长的一段时间内都没有得到维护,并且不再使用最新的CUDA版本(主要是由于64位指针和没有由dllimport接收的新_v2后缀函数的引入)。我们试图联系背后的公司,但没有得到任何回复。由于没有许可证限制,我们更新了源代码,并嵌入到CUDAfy.NET中。这是一个基于CUDA的开源项目(LPGPL)。NET简化了它的使用。CUDAfy网站也有一些关于codeproject的教程,其中包括:在。net中使用CUDAfy进行GPGPU编程。

#2


2  

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

我没有发现太多,但是有文件证明:

CUDA.NET Documentation

CUDA。网络文档

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

同样,这里有一个问题和答案

Hello-world for CUDA.Net

hello world为CUDA.Net

#3


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:

盖斯。Net在2.3.7版本中有示例。运行这些项目存在一些问题,但是它们可以通过两个步骤来解决:首先,您必须将-arch=sm_xx添加到后构建事件中,其中xx是您的计算能力。第二个是正确配置的系统路径变量,我有如下内容:

  • LIB C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB
  • Visual Studio 9.0 \ LIB C:\Program Files (x86)\Microsoft 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
  • LIBPATH C:\Windows\ Microsoft.NET \ Framework \ v3.5;C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727;C:\程序文件(x86)\ Microsoft Visual Studio 9.0 \ VC \ LIB
  • CUDA_LIB_PATH %CUDA_PATH%\lib\x64
  • CUDA_LIB_PATH % CUDA_PATH % \ lib \ x64
  • CUDA_PATH C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\
  • CUDA_PATH C:\Program Files\NVIDIA GPU计算工具包\ CUDA \ v4.0 \
  • CUDA_BIN_PATH %CUDA_PATH%\bin
  • CUDA_BIN_PATH % CUDA_PATH % \ bin
  • CUDA_INC_PATH %CUDA_PATH%\include
  • CUDA_INC_PATH % CUDA_PATH % \包括
  • CUDA_PATH_V4_0 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\
  • CUDA_PATH_V4_0 C:\Program Files\NVIDIA GPU计算工具包\ CUDA \ v4.0 \
  • INCLUDE C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE
  • 包括C:\Program Files (x86)\Microsoft Visual Studio 9.0 \ VC \包括
  • 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
  • 路径C:\Program Files\NVIDIA GPU计算工具包\ CUDA \ v4.0 \ bin \;% SystemRoot % \ system32系统;% SystemRoot %,% SystemRoot % \ system32系统\ Wbem;% SystemRoot % \ system32系统\ WindowsPowerShell \ v1.0 \;C:\ Program Files \ Microsoft SQL Server \(x86)100 \ Binn \ \工具;C:\ Program Files \ Microsoft SQL Server \ 100 \ Binn \ \工具;C:\ Program Files \ Microsoft SQL Server \ 100 \ DTS \ Binn \;C:\程序文件(x86)\ 9.0 \ Common7 \ Microsoft Visual Studio IDE;C:\程序文件(x86)\ Microsoft Visual Studio 9.0 \ VC \ bin,C:\ Program Files \ Microsoft Visual(x86)
  • VCINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
  • VCINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0 \ VC
  • VS100COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
  • VS100COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 10.0 \ Common7 \ \工具
  • VS90COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\
  • VS90COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 9.0 \ Common7 \ \工具
  • VSINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0
  • VSINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio 9.0