emkrish
emkrish

Reputation: 31

error in nvcc using emulation mode

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

Upvotes: 2

Views: 1228

Answers (2)

V-R
V-R

Reputation: 1401

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

Upvotes: 0

emkrish
emkrish

Reputation: 31

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

Upvotes: 1

Related Questions