Communication error nvcc.exe Microsoft Visual Studio configuration file 'vcvars64.bat' could not be found

I want to use nvcc -ptx from the Windows command line, but I always get this error message: nvcc: fatal error: Microsoft Visual Studio configuration file 'vcvars64.bat' was not found for installation in the C: \ Program Files (x86) \ Microsoft folder Visual S tudio 11.0 \ VC \ bin /../ .. '

I am using vs 2012 express edition. What could be the solution?

+7
visual-studio-2012 cuda nvcc
source share
3 answers

I managed to solve the problem and work with MS Visual Studio Express 2012, here is what I did:

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

The compilation worked fine:

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

C: \ CUDA> square.exe 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

+14
source share

From the NVIDIA CUDA compiler driver document

1,2. Supported host compilers nvcc uses the following compilers to compile host code:

On Linux platforms

GNU, gcc and arm-linux-gnueabihf-g ++ compiler for cross-compiling in ARMv7 architecture

On Windows platforms

Compiler Microsoft Visual Studio, cl On both platforms, the compiler found on the current one will use the search path if the nvcc -compiler-bindir parameter is not specified (see Technical specifications of the file and paths).

+1
source share

When in your project go to "Configuration Properties"> "CUDA C / C ++"> "Device" and change the code generation to the following: compute_11, sm_11

-2
source share

All Articles