VS2012 Express and Cuda 5.5 error

When trying to compile 64-bit programs in VS2012 express with CUDA 5.5, I get the following error:

1>nvcc : fatal error : Microsoft Visual Studio configuration file 'vcvars64.bat' could not be found for installation at 'C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/x86_amd64/../../..'

Why does it add the trailing “…/…/…” and how do I get rid of that? I’ve confirmed that vcvars64.bat is at the location specified as well.

I’m struggling with tthe identical problem, which seems to arise from the Express verrsion of VS not installing certain components. II’ve found this so far,

but being less familiar with tthe Windows OS I don’t really understand the answer. If someone wwith mmore expertise could help with this that would be great!

Edit: if you have Matlab installed it looks like thîs will do it


But I don’t :(, trying to work through the m-file now…

Create a plain text file with Notepad or Wordpad or any text editor you want in the folder C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\amd64 named vcvars64.bat

Type in it:

Save it. Try compiling again and see if it works. Or just download the VS2012 Professional version from Dreamspark for free as a student like I mentioned in the other thread – http://www.dreamspark.com

Hi vacaloca,

Thank you! I’ve progressed so that now the problem seems to be that nvcc isn’t finding the right dll, although I don’t know which one. I created a subdirectory of …/VC/bin called ‘amd64’ and put vcvars64.bat in it; the program complained about not being able to find cl so I put cl (from VC/bin) in, and also copied …/VC/bin/x86_amd64 into it, but in both of these cases I got:

nvcc : error : ‘cl’ died with status 0xC0000135

which googling indicates is a missing dll code.

As for going through VS2012, yes thank you for telling me about Dreamspark!! I didn’t know about that. However only the 32-bit version is availanle, and also I intend ultimately to develop with Qt and MinGW, so VS2012 was really more to be able to examine and play with the code. So I think a ‘manual’ solution might be what I need ultimately.

The 32 bit version of VS2012 includes the 64-bit compilers – you’ll have to select them to install when you run the VS2012 installer. The IDE itself is just not 64-bit. It will work fine for compiling both 32 and 64 bit apps. Uninstall VS Express & CUDA, install VS2012 Professional, update it with the latest service pack while you’re at it, install CUDA (to install templates back into VS2012) and you should be all set.

(I realize it is a pain, but that’s the only way I know where it works, I’ve repeated this on 3 PC’s and laptops with no issue – I’ve never tried VS Express because I knew going in that it is a pain to configure correctly to work)

Hey vacaloca, terrific, this process worked!! Tough luck for anyone who doesn’t have an .edu email address, apparently. My target environment ultimately is Qt and I don’t have things working there yet, but this is a huge step, I can compile in VS now. Thanks again.

Hi, I have managed to solve the issue and make work with MS Visual Studio Express 2012, here what I did:

  • Installed MS Visual Studio 2012 Express
  • Installed cuda_5.5.20_winvista_win7_win8_general_64, the latest version as of 2014-01-16
  • From this directory: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin, I have copied x86_amd64 to amd64
  • In the new directory: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64, I have created a file vcvars64.bat
  • In the file vcvars64.bat, just added: CALL setenv /x64

The compilation worked great:

C:\CUDA>nvcc -o square square.cu
Creating library square.lib and object square.exp

0.000000 1.000000 4.000000 9.000000
16.000000 25.000000 36.000000 49.000000
64.000000 81.000000 100.000000 121.000000
144.000000 169.000000 196.000000 225.000000