【问题标题】:Unable to open cpp1.ii file while compiling CUDA project编译 CUDA 项目时无法打开 cpp1.ii 文件
【发布时间】: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 但无济于事。我还发布了编译器命令行。

标签: visual-studio-2008 cuda


【解决方案1】:

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

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

VS2005 始终需要以管理员身份运行(即使没有 CUDA),而 2008 则不那么严格,但某些操作需要它,所以只需检查一下。

【讨论】:

  • 是的,C:\Windows\Temp 文件夹不可写,确保解决了问题。非常感谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-05
  • 2012-09-04
  • 2013-06-10
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多