nvcc fata: fail to open output file

Hello everyone, i follow the installation instruction on the internet and try to compile my project but it doesn’t work.

I am using windows 7 with visual studio 2008 32 bit and CUDA SDK and Toolkit v3.2 32 bit

I got the following message:

1>------ Rebuild All started: Project: VaRCUDA, Configuration: Debug Win32 ------

1>Deleting intermediate and output files from project ‘VaRCUDA’, configuration ‘Debug|Win32’

1>Compiling with CUDA Build Rule…

1>“C:Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\bin\nvcc.exe” -arch sm_10 -ccbin

“c:\Program Files\Microsoft Visual Studio 9.0\VC\bin” -Xcompiler "/EHsc /W3 /nologo /Od /Zi

/RTC1 /MTd " -I"C:\Program Files\NVIDIA GPU Computing ToolKit\CUDA\v3.2\include" -I

“C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\common\inc” -maxrregcount=32

–compile -o “Debug\VARmain.cu.obj”


1>nvcc fatal : Failed to open output file

'C:\Users\xxxxxx\AppData\Local\TempC:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing

SDK\C\Bin\win32\Debug;C:</b>ProgramData\NVIDIA Corporation\NVIDIA GPU Computing

SDK\C\Bin\win32\EmuDebug;:</b>ProgramData\NVIDIA Corporation\NVIDIA GPU Computing

SDK\C\Bin\win32\Release;C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing


1>Internal error



1>c:\users\xxxxxx\documents\xxxx2010\varcuda\varcuda\getdata.cpp(19): warning C4996: ‘fopen’:

This fuction or variable may be unsafe. Consider using fopen_s instead. To disable deprecation,

use _CRT_SECURE_NO_WARNINGS. See online help for details.

1> C:\program files\microsoft visual studio 9.0\vc\include stdio.h(237) :see declaration

of ‘fopen’

1>c:\users\xxxxxx\cocuments\xxxx2010\varcuda\varcuda\getdata.cpp(44) : warning C4244: ‘=’ :

conversion from ‘double’ to ‘float’, possible loss of data

1>c:\users\xxxxxx\documents\xxxx2010\varcuda\varcuda\getdata.cpp(44) : warning C4101: ‘n’ :

unreferenced local variable


1>getData.obj : waring LNK4075: ignoring ‘/EDITANDCONTINUE’ due to ‘/INCREMENTAL:NO’


1>LINK : fatal error LNK1181: cannot open input file ‘.\Debug\VARmain.cu.obj’

1>Build log was saved at


1>VaRCUDA - 1 error(s), 4 warning(s)

=========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I know there are still some errors in my code.

I follow the step by step instruction and setup my vs2008 several times but still got this problem. I think i may miss

some settings or make some mistakes. The compiler just don’t know what to do.

I label the message that might provide the useful information about my miss during the setting.

Can anyone help?

try it:add

C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\Bin\win32\Debug;

C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\Bin\win32\EmuDebug;

C:\ProgramData\NVIDIA Corporation\NVIDIA GPU ComputingSDK\C\Bin\win32\Release;

C:\ProgramData\NVIDIA Corporation\NVIDIA GPU ComputingSDK\C\Bin\win32\EmuRulease

in the end of the environment variables “Path”.

O.K. It might be the case that the path setting in my vs2008 goes wrong so i have to correct it…

Is there anyone who suffer the same problem?

Guys, I need your help…I check all the settings and system variables but the thing just doesn’t work…

My code pass the compilation but when i try to press F5 to run the problem:

nvcc fatal: Failed to open file …

still exist.

can anyone help?

or can i write an e-mail to ask Nvidia support?

  1. if you just want to compile CUDA program successfully,you can install CUDA 3.2
    or CUDA 4.0 with Nsight 2.0.It supports VS2008 and VS2010.This is the easiest way.

  2. if you still want to solve you problem,I can only tell you how i did.I hope it
    can help you.I use windows7 x64 with VS2008+CUDA2.3 for it can support Emudebug.
    1)when you install VS2008,you must choose custom setup and remember to choose
    X64 compiler(for windows7 x64).
    2)Install driver,toolkit,SDK with Default path.
    3)Use CUDA_VS_Wizard_W64_2.2.exe to complete the CUDA configuration.
    4)Add the path of “debug/emudebug/release/emurelease” in the end of the system
    variable “path”.for example ,by the default path install,you would add:
    C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\Bin\win64\Debug;
    C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\Bin\win64\EmuDebug;
    C:\ProgramData\NVIDIA Corporation\NVIDIA GPU ComputingSDK\C\Bin\win64\Release;
    C:\ProgramData\NVIDIA Corporation\NVIDIA GPU ComputingSDK\C\Bin\win64\EmuRelease;
    You can find the system variable “path” by computer->properties->Advanced system
    settings->environment variables->system variables->path
    5)In VS2008,you can creat CUDA64 project like C/C++ project.(PS:You can only use
    this method to configuration VS2008+CUDA2.3 or CUDA3.2)

3.Your OS is 32bit,so you can use CUDA_VS_Wizard_W32_2.2.exe,and when you add the
system variable “path”,you should change win64 to win32.(PS:I didn’t use 32bit
OS,so I can’t ensure whether you can success or not)
CUDA_VS_Wizard.2.2.rar (210 KB)

Thanks for your advice, tllovejf!

When you say:

Add the path of “debug/emudebug/release/emurelease” in the end of the system

You mean add the path to the system variable using Control Panel -> System -> Advanced system settings -> Environment

variables, and then add the four path after the system variable PATH with “;” separating each component.

Is that correct?

I also found Nvidia Nsight but i need some time to make it work. I just want to know what cause this problem

“nvcc fatal: Failed to open output file xxxx…”