【发布时间】:2010-09-01 07:11:04
【问题描述】:
过去几个月我一直在使用 CUDA 安装 64 位 Windows 7 和 Visual Studio 2008。最近我转向安装 32 位 Windows 7 并更新了我的显卡,之前是8600GTX,现在是 GTX465。我已经安装了相关驱动和CUDA 3.1工具包,还在用VS2008。
如果我尝试编译之前使用的相同 Visual Studio 项目,我会在构建窗口中得到以下输出:
1>------ Build started: Project: CUDAServicenew, Configuration: Debug Win32 ------
1>Performing Custom Build Step
1>CUDAHelloWorld.cu
1>Catastrophic error: cannot open source file "C:/Windows/TEMP/tmpxft_0000082c_00000000-6_CUDAHelloWorld.cpp1.ii": not a regular file
1>1 catastrophic error detected in the compilation of "C:/Windows/TEMP/tmpxft_0000082c_00000000-6_CUDAHelloWorld.cpp1.ii".
1>Compilation terminated.
1>Project : error PRJ0019: A tool returned an error code from "Performing Custom Build Step"
1>Build log was saved at "file://c:\wamp\www\server_root\GPU_stitcher_live\SiftGPU\CUDAServicenew\CUDAServicenew\Debug\BuildLog.htm"
1>CUDAServicenew - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我使用了如下所示的自定义构建规则:
“$(CUDA_BIN_PATH)\nvcc.exe” -ccbin “$(VCInstallDir)bin” -c -D_DEBUG -DWIN32 -D_CONSOLE D_MBCS -Xcompiler /EHsc,/W3,/nologo,/Od,/Zi,/RTC1,/MTd --ptxas-options -v - I”$(CUDA_INC_PATH)” -I./ -o $(ConfigurationName)\CUDAHelloWorld.obj CUDAHelloWorld.cu
即使我尝试编译 NVIDIA 提供的 SDK 示例,也会发生这种情况。我不明白为什么cpp1.ii 文件没有被打开。我在这里做错了什么?任何帮助将不胜感激。
【问题讨论】:
-
您是否使用自己的自定义构建规则?尝试使用 SDK 提供的 cuda.rules,这样您将始终拥有最新的构建设置。如果您真的必须使用自己的构建规则,请发布编译器命令行。
-
我确实尝试使用 cuda.rules 但无济于事。我还发布了编译器命令行。