编译CUDA项目时无法打开cpp1.ii文件

时间:2010-09-01 07:11:05

标签: visual-studio-2008 cuda

过去几个月我一直在使用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文件没有被打开。我在这里做错了什么?任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

只是检查一些随机(即不太可能)的想法......

  1. 您是否安装了32位工具包?
  2. 您是否以管理员身份运行VS?
  3. C:\ Windows \ TEMP是否可写?
  4. 你有磁盘空间吗?
  5. VS2005总是需要以管理员身份运行(即使没有CUDA),而2008年则不太严格,因此需要进行一些操作,所以只需检查即可。