简体   繁体   English

在非CUDA计算机上运行CUDA程序

[英]Running CUDA programs on non CUDA machines

I am trying to run CUDA codes on my computer. 我正在尝试在计算机上运行CUDA代码。 I dont have a Nvidia graphics card. 我没有Nvidia显卡。 I just want to try to emulate it to check if my code is correct and then later check the parallelization results. 我只想尝试对其进行仿真,以检查我的代码是否正确,然后再检查并行化结果。

I installed the CUDA toolkit and the CUDA SDK on my computer. 我在计算机上安装了CUDA工具包和CUDA SDK。 I am trying to set it up with Visual studio 2010. But when I run the sample programs in the SDK the following error comes: 我试图使用Visual Studio 2010进行设置。但是,当我在SDK中运行示例程序时,出现以下错误:

C:\\ProgramData\\NVIDIA Corporation\\NVIDIA GPU Computing SDK 4.0\\C\\src\\eigenvalues\\eigenvalues_vs2010.vcxproj : error : The imported project "C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\BuildCustomizations\\CUDA 4.0.props" was not found. C:\\ ProgramData \\ NVIDIA Corporation \\ NVIDIA GPU Computing SDK 4.0 \\ C \\ src \\ eigenvalues \\ eigenvalues_vs2010.vcxproj:错误:导入的项目“ C:\\ Program Files(x86)\\ MSBuild \\ Microsoft.Cpp \\ v4.0 \\ BuildCustomizations找不到\\ CUDA 4.0.props。 Confirm that the path in the declaration is correct, and that the file exists on disk. 确认声明中的路径正确,并且文件在磁盘上。 C:\\ProgramData\\NVIDIA Corporation\\NVIDIA GPU Computing SDK 4.0\\C\\src\\eigenvalues\\eigenvalues_vs2010.vcxproj C:\\ ProgramData \\ NVIDIA Corporation \\ NVIDIA GPU Computing SDK 4.0 \\ C \\ src \\ eigenvalues \\ eigenvalues_vs2010.vcxproj

C:\\ProgramData\\NVIDIA Corporation\\NVIDIA GPU Computing SDK 4.0\\C\\common\\cutil_vs2010.vcxproj : error : The imported project "C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\BuildCustomizations\\CUDA 4.0.props" was not found. C:\\ ProgramData \\ NVIDIA Corporation \\ NVIDIA GPU Computing SDK 4.0 \\ C \\ common \\ cutil_vs2010.vcxproj:错误:导入的项目“ C:\\ Program Files(x86)\\ MSBuild \\ Microsoft.Cpp \\ v4.0 \\ BuildCustomizations \\ CUDA找不到4.0.props”。 Confirm that the path in the declaration is correct, and that the file exists on disk. 确认声明中的路径正确,并且文件在磁盘上。 C:\\ProgramData\\NVIDIA Corporation\\NVIDIA GPU Computing SDK 4.0\\C\\common\\cutil_vs2010.vcxproj C:\\ ProgramData \\ NVIDIA Corporation \\ NVIDIA GPU Computing SDK 4.0 \\ C \\ common \\ cutil_vs2010.vcxproj

Unable to start program C:\\ProgramData\\NVIDIA Corporation\\NVIDIA GPU Computing SDK 4.0\\shared\\lib\\Win32\\shrUtils32D.lib The specified file is an unrecognized or unsupported binary format. 无法启动程序C:\\ ProgramData \\ NVIDIA Corporation \\ NVIDIA GPU Computing SDK 4.0 \\ shared \\ lib \\ Win32 \\ shrUtils32D.lib指定的文件是无法识别或不支持的二进制格式。

Can some one please help me out with this error. 有人可以帮我解决这个错误。

Check these pages: 检查以下页面:

How to emulate CUDA on windows 如何在Windows上模拟CUDA

GPU Emulator for CUDA programming without the hardware 无需硬件即可进行CUDA编程的GPU仿真器

I myself prefer using openCL. 我自己更喜欢使用openCL。

There are two problems here. 这里有两个问题。

The first two errors that you see are actually the result of Visual Studio not finding the build customization files that your project uses. 您看到的前两个错误实际上是Visual Studio找不到项目使用的生成自定义文件的结果。 These build customizations are handy additions to Visual Studio which allow you to easily add CUDA sources to your projects without having to manually set up build rules to call NVCC. 这些构建自定义项是Visual Studio的便捷添加,使您可以轻松地将CUDA源添加到项目中,而无需手动设置构建规则来调用NVCC。

I don't remember if it was the case for CUDA 4.0, but with 4.1 these were automatically installed with the CUDA Toolkit. 我不记得CUDA 4.0是否是这种情况,但是在4.1中,这些是随CUDA Toolkit自动安装的。 (I remember in some earlier version I set this up manually, so check your documentation to see if that's necessary) Are you sure you installed this toolkit? (我记得在以前的版本中,我是手动设置的,因此请查看您的文档以查看是否必要)。确定要安装此工具包吗? (For CUDA 4.0 in your case) (对于您的情况下的CUDA 4.0)

The last error is actually the result of you not trying to run an executable from within Visual Studio, but a static library. 最后一个错误实际上是您没有尝试从Visual Studio中运行可执行文件而是静态库的结果。 Of course this doesn't work, so it will complain about an unrecognized binary format. 当然这是行不通的,因此它将抱怨无法识别的二进制格式。 If you want to run a particular executable from within Visual Studio, make sure its project is set as the startup project. 如果要从Visual Studio中运行特定的可执行文件,请确保将其项目设置为启动项目。 You can do so by right-clicking on the particular project and selecting "Set as startup project". 您可以通过右键单击特定项目并选择“设置为启动项目”来实现。

However, even if you solve these errors, you still won't be able to run these CUDA examples without a Nvidia graphics card. 但是,即使您解决了这些错误,如果没有Nvidia显卡,您仍将无法运行这些CUDA示例。 The emulator which was part of pre 3.x CUDA releases is no longer a part of CUDA. 作为3.x CUDA之前版本的一部分,该仿真器不再是CUDA的一部分。 A possible solution would be to use Ocelot , but if you're simply starting out, that might be a bit much. 一个可能的解决方案是使用Ocelot ,但是如果您只是开始,那么可能会很多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM