编译cuda Visual Studio 2008
好吧,我的第二个问题。
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=513354entry513354
Edit2: CUDA and OpenCL samples are running from the SDK 4.0 Browser flawlessly... Why doesn't it compile then..-_-' :P
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看这个答案 了解将 CUDA 添加到 VS2008 项目的分步说明。
下面是一些其他想法。如果这些都没有帮助,那么可能需要更多信息(或者您可以在 NVIDIA 论坛上发布重现者)。
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).