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

Visual studio 2008 编译CUDA项目时无法打开cpp1.ii文件,visual-studio-2008,cuda,Visual Studio 2008,Cuda,在过去的几个月里,我一直在使用CUDA安装64位Windows7和VisualStudio2008。最近,我改用32位Windows7安装,并更新了我的图形卡,以前是8600GTX,现在是GTX465。我已经安装了相关的驱动程序和CUDA3.1工具包,现在仍在使用VS2008 不知何故,如果我尝试编译与前面使用的相同的Visual Studio项目,我会在“生成”窗口中获得以下输出: 1>------ Build started: Project: CUDAServicenew, Conf

在过去的几个月里,我一直在使用CUDA安装64位Windows7和VisualStudio2008。最近,我改用32位Windows7安装,并更新了我的图形卡,以前是8600GTX,现在是GTX465。我已经安装了相关的驱动程序和CUDA3.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
文件。我做错了什么?任何帮助都将不胜感激。

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

  • 您是否安装了32位工具包
  • 您是否以管理员身份运行VS
  • C:\Windows\TEMP是否可写
  • 你有磁盘空间吗

  • VS2005始终需要以管理员身份运行(即使没有CUDA),而2008对某些操作要求不那么严格,所以请检查。

    您是否使用自己的自定义生成规则?尝试使用SDK提供的cuda.rules,这样您将始终拥有最新的构建设置。如果您真的需要使用自己的构建规则,请发布编译器命令行。我确实尝试过使用cuda.rules,但没有效果。我还发布了编译器命令行。是的,C:\Windows\Temp文件夹不可写,确保解决了问题。多谢各位