Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

cuda - nvcc.exe linking error Microsoft Visual Studio configuration file 'vcvars64.bat' could not found

I want to use nvcc -ptx from windows command line, but I always get this error message: nvcc : fatal error : Microsoft Visual Studio configuration file 'vcvars64.bat' could not be found for installation at 'C:Program Files (x86)Microsoft Visual S tudio 11.0VCin/../..'

I'm using vs 2012 express edition. What can be the solution?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

  1. Installed MS Visual Studio 2012 Express
  2. Installed cuda_5.5.20_winvista_win7_win8_general_64, the latest version as of 2014-01-16
  3. From this directory: C:Program Files (x86)Microsoft Visual Studio 11.0VCin, I have copied x86_amd64 to amd64
  4. In the new directory: C:Program Files (x86)Microsoft Visual Studio 11.0VCinamd64, I have created a file vcvars64.bat
  5. 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

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...