在 Windows 上安装 CUDA

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4710245/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:59:46  来源:igfitidea点击:

CUDA installation on Windows

windowscudanvidia

提问by bespectacled

I installed CUDA Toolkit 3.2, CUDA SDK and MS Visual Studio 2008 (not necessarily in this order) on my Windows 7 that does not have an nvidia graphics card. But when I try running my CUDA code, the CUDA keywords are'nt identified. I am a beginner. Pls tell me what I am doing wrong here.

我在没有 nvidia 显卡的 Windows 7 上安装了 CUDA Toolkit 3.2、CUDA SDK 和 MS Visual Studio 2008(不一定按此顺序)。但是当我尝试运行我的 CUDA 代码时,没有识别 CUDA 关键字。我是初学者。请告诉我我在这里做错了什么。

Thanks

谢谢

采纳答案by Maxence SCHMITT

If you don't have a NVIDIA card, you can still use the emulator but you need to install the SDK and the toolkit. Try to fix your problem by adding in your Visual Studio project settings the include and library path of CUDA.

如果您没有NVIDIA卡,您仍然可以使用模拟器,但需要安装SDK和工具包。尝试通过在 Visual Studio 项目设置中添加 CUDA 的包含和库路径来解决您的问题。

回答by ChrisV

Are you building using nvcc? If not, Visual C++ will choke on the CUDA-specific syntax.

您是否正在使用 nvcc 进行构建?否则,Visual C++ 将因 CUDA 特定的语法而窒息。

回答by Tom

You should be able to build the SDK samples with your setup, but you won't be able to run since you do not have a CUDA capable GPU. Emulation is no longer supported, so you have a couple of options available:

您应该能够使用您的设置构建 SDK 示例,但您将无法运行,因为您没有支持 CUDA 的 GPU。不再支持仿真,因此您有几个可用选项:

Check out this stackoverflow postfor details of syntax highlighting and more in VS2008.

查看此 stackoverflow 帖子,了解 VS2008 中语法突出显示等的详细信息。

Incidentally, if you installed the Toolkit before VS2008 then the rules files will not have been copied to the VS directories (clearly, since they didn't exist). You can find them and instructions in the CUDA Toolkit in the extras directory.

顺便说一句,如果您在 VS2008 之前安装了 Toolkit,那么规则文件将不会被复制到 VS 目录中(显然,因为它们不存在)。您可以在 extras 目录的 CUDA Toolkit 中找到它们和说明。

回答by sandeep.ganage

You if are trying to execute cuda programs on non gpu machines, I would suggest you to try mCUDA. It doesn't need GPU or Graphics card for CUDA execution.

如果您想在非 GPU 机器上执行 cuda 程序,我建议您尝试 mCUDA。它不需要 GPU 或图形卡来执行 CUDA。

回答by Hemprasad

The installation of CUDA development tools on a system running the appropriate version

在运行适当版本的系统上安装 CUDA 开发工具

? Verify the system has a CUDA‐enabled GPU and a supported version of OS.

? 验证系统具有启用 CUDA 的 GPU 和受支持的操作系统版本。

    Many [NVIDIA products today contain CUDA‐enabled GPUs][1]. These include: 

         ? NVIDIA GeForce? 8, 9, 200, and 400 series GPUs

         ? NVIDIA Tesla? computing solutions

         ? Many of the NVIDIA Quadro? products

? Verify the NVIDIA driver and the CUDA software.

? 验证 NVIDIA 驱动程序和 CUDA 软件。

? Update the NVIDIA driver.

? 更新 NVIDIA 驱动程序。

? Install the CUDA software.

? 安装 CUDA 软件。

? Verify the the CUDA software linking With VS2008/VS2010

? 验证CUDA软件与VS2008/VS2010对接

For that you can check my Blog Also http://hemprasad.wordpress.com/2012/10/12/cuda-installation-on-vs-2010/

为此,您可以查看我的博客http://hemprasad.wordpress.com/2012/10/12/cuda-installation-on-vs-2010/



Test your installation by compiling and running one of the sample programs in the CUDA software to validate that the hardware and software are running correctly and communicating with each other.

通过编译和运行 CUDA 软件中的示例程序之一来测试您的安装,以验证硬件和软件是否正确运行并相互通信。

回答by peakxu

CUDA is only supported on machines with nVidia video cards. That is likely an issue.

CUDA 仅在配备 nVidia 显卡的机器上受支持。这很可能是一个问题。

Furthermore, you need to install drivers (dev or otherwise) that is new enough to support the CUDA Toolkit version.

此外,您需要安装足够新的驱动程序(开发或其他)以支持 CUDA Toolkit 版本。

Third, what do you mean by the keywords aren't identified? Do you mean there's no syntax highlighting in your IDE? If so, try [this][1]http://codereflect.com/2008/09/04/how-to-enable-syntax-highlighting-for-cuda-files-in-visual-studio-2005/

第三,未识别关键字是什么意思?你的意思是在你的 IDE 中没有语法高亮?如果是这样,请尝试 [this][1]http://codereflect.com/2008/09/04/how-to-enable-syntax-highlighting-for-cuda-files-in-visual-studio-2005/