使用仿真模式时出现 nvcc 错误

发布于 2024-08-23 04:25:38 字数 619 浏览 6 评论 0原文

当尝试使用 Visual Studio 2008 从 NVIDIA GPU 计算 SDK 构建示例时,我收到以下奇怪的错误:

"C:\CUDA\bin\nvcc.exe"    -arch sm_10 -ccbin "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin" -deviceemu -D_DEVICEEMU   -Xcompiler "/EHsc /W3 /nologo /Od /Zi   /MTd  " -I"C:\CUDA\include" -I"../../common/inc" -maxrregcount=32  --compile -o "Debug\matrixMul.cu.obj" "c:\Documents and Settings\All Users.SYSROOT\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\src\matrixMul\matrixMul.cu" 
nvcc fatal   : Could not open input file C:\DOCUME~1\Murali_Krishna05\Local Settings\Temp/tmpxft_000008cc_00000000-1

When trying to build an example from the NVIDIA GPU Computing SDK using Visual Studio 2008, I get this weird error:

"C:\CUDA\bin\nvcc.exe"    -arch sm_10 -ccbin "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin" -deviceemu -D_DEVICEEMU   -Xcompiler "/EHsc /W3 /nologo /Od /Zi   /MTd  " -I"C:\CUDA\include" -I"../../common/inc" -maxrregcount=32  --compile -o "Debug\matrixMul.cu.obj" "c:\Documents and Settings\All Users.SYSROOT\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\src\matrixMul\matrixMul.cu" 
nvcc fatal   : Could not open input file C:\DOCUME~1\Murali_Krishna05\Local Settings\Temp/tmpxft_000008cc_00000000-1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

征﹌骨岁月お 2024-08-30 04:25:38

我通过将环境变量“TEMP=%USERPROFILE%\Local Settings\Temp”替换为“TEMP=%SystemRoot%\TEMP”解决了这个问题。

I solved it by replacing the environmental varialble "TEMP=%USERPROFILE%\Local Settings\Temp" by "TEMP=%SystemRoot%\TEMP".

丘比特射中我 2024-08-30 04:25:38

这是NVIDIA VS2008 集成中已知的 老错误。我们必须执行以下所有 3 个步骤才能解决该问题。

  1. 设置 TEMP=%SystemRoot%\TEMP
  2. 检查并可能设置 PATH= 以避免任何多余的引号 "和危险!)。只需删除它们即可:各个目录之间用分号 ; 分隔,并且空格不是问题
  3. (假设您已将 VS2008 安装在默认位置并面向常见的 Win64 和 Win32 平台) ) 仅替换 "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\ 中的第一对括号 () vcvarsamd64.bat""C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"

步骤 3 的示例:

替换

@if not "%WindowsSdkDir%" == "" (
    set "PATH=%WindowsSdkDir%bin;%PATH%"
    set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
    set "LIB=%WindowsSdkDir%lib;%LIB%"
)

@if "%WindowsSdkDir%" == "" @goto :SKIP_SET_SDK
set "PATH=%WindowsSdkDir%bin;%PATH%"
set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
set "LIB=%WindowsSdkDir%lib;%LIB%"
:SKIP_SET_SDK

This is a known old bug in the NVIDIA VS2008 integration. We've had to do all of the following 3 steps to solve it.

  1. set TEMP=%SystemRoot%\TEMP
  2. check and potentiallyset PATH= to avoid any quotation marks " which are anyway superfluous (and dangerous!). Just delete them: individual directories are separated by semicolon ; and spaces are not a problem
  3. (assuming you have VS2008 installed in the default location and target the usual Win64 and Win32 platforms) replace just the first pair of parentheses ( and ) in "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat" and "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"

Example for step 3:

Replace

@if not "%WindowsSdkDir%" == "" (
    set "PATH=%WindowsSdkDir%bin;%PATH%"
    set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
    set "LIB=%WindowsSdkDir%lib;%LIB%"
)

by

@if "%WindowsSdkDir%" == "" @goto :SKIP_SET_SDK
set "PATH=%WindowsSdkDir%bin;%PATH%"
set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
set "LIB=%WindowsSdkDir%lib;%LIB%"
:SKIP_SET_SDK
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文