编译cuda Visual Studio 2008

发布于 2024-12-04 12:02:38 字数 1073 浏览 0 评论 0原文

好吧,我的第二个问题。

Windows 7 专业版 x64、 视觉工作室专业2008年, 图形驱动程序是最新的, 安装了cuda工具包、错误修复、开发驱动程序、GPU计算SDK和Parallel Nsight 2.0。全部来自 nvidia.com/getcuda。 (当然下载了所有 x64)

好吧,事情就是这样。当我想编译一些 CUDA 代码时,例如 Nsight 附带的示例,我收到错误 1>cl : 命令行错误 D8003 : 缺少源文件名 1>项目:错误 PRJ0019:工具从“使用 CUDA 构建规则进行编译...”返回了错误代码 我在网上搜索了解决方案,由于我显然不是唯一的解决方案,因此我找到了一些解决方案。 这是我所做的:

- 在自定义构建规则中,我选择了 CUDA Driver API Build Rule (v4.0) 和 CUDA Runtime API Build Rule (v4.0)

- 在项目的属性选项卡中,我转到链接器/常规,并在“附加库依赖项”字段中,我放置“C:\Program Files\NVIDIA GPU Compute Toolkit\CUDA\v4.0\lib\x64”,这是我需要的正确位置,或者所以我明白了。

- 在链接器/输入选项卡中,我在“附加依赖项”选项卡中输入“cudart.lib”。

-最后,我从“构建/配置管理器”菜单中选择了平台 x64。

正如你所看到的,我确实做了一些研究,我所做的为很多人提供了解决方案。但不适合我... 所以我需要一些帮助,也许你们知道我还需要做什么?

提前致谢!

编辑:也尝试过这个,但没有解决任何问题:( http://forums.nvidia.com/index.php?showtopic=91057&st=0&p=513354&#entry513354

Edit2:CUDA 和 OpenCL 示例从 SDK 4.0 运行浏览器完美无缺...为什么它不编译呢..-_-' :P

allright, second question for me.

Windows 7 Professional x64,
Visual studio professional 2008,
graphics driver up to date,
installed the cuda toolkit, the bug fix, the developer drivers, the GPU computing SDK, and Parallel Nsight 2.0. All from nvidia.com/getcuda. (downloaded all the x64 offcourse)

Allright, here's the deal. When I want to compile some CUDA code, say for example the examples that come with Nsight, I get the error 1>cl : Command line error D8003 : missing source filename
1>Project : error PRJ0019: A tool returned an error code from "Compiling with CUDA Build Rule..."
I've searched the web for a solution, and since I'm apparently not the only one, I've found some solutions.
Here is what I did:

-at the custom build rules, I selected CUDA Driver API Build Rule (v4.0), and the CUDA Runtime API Build Rule (v4.0)

-at the properties tab of the project, I go to linker/general, and in the field for "Additional Library Dependecies" I put "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\lib\x64" which is the correct location for what I need, or so I understood.

-at the linker/input tab, I typt "cudart.lib" in the "Additional Dependecies" tab.

-last, I selected as platform x64 from the Build/Configuration Manager menu.

As you see, I really did some research, and what I did was a solution to many people. Not for me though...
So I need some help, maybe you people know what I have to do furthermore?

Thanks in advance!

Edit: also tried this, solves nothing :(
http://forums.nvidia.com/index.php?showtopic=91057&st=0&p=513354&#entry513354

Edit2: CUDA and OpenCL samples are running from the SDK 4.0 Browser flawlessly... Why doesn't it compile then..-_-' :P

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最后的乘客 2024-12-11 12:02:38

查看这个答案 了解将 CUDA 添加到 VS2008 项目的分步说明。

下面是一些其他想法。如果这些都没有帮助,那么可能需要更多信息(或者您可以在 NVIDIA 论坛上发布重现者)。

  • 不要同时添加驱动程序和运行时规则。添加一个并坚持使用(您可能只需要运行时)。
  • 如果您正在构建 64 位项目,请确保将 CUDA 构建也切换为 64 位。

Check out this answer for step-by-step instructions for adding CUDA to a VS2008 project.

Some other thoughts are below. If none of this helps then probably need more info (or you could post a reproducer on the NVIDIA forums).

  • Don't add both the Driver and the Runtime rules. Add one and stick with it (you probably want the Runtime only).
  • If you're building a 64-bit project then make sure you also switch the CUDA build to 64-bit.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文