CUDA linking error - Visual Express 2008 - nvcc fatal due to (null) configuration file

后端 未结 4 1531
渐次进展
渐次进展 2020-12-01 15:20

I\'ve been searching extensively for a possible solution to my error for the past 2 weeks. I have successfully installed the Cuda 64-bit compiler (tools) and SDK as well as

相关标签:
4条回答
  • 2020-12-01 15:30

    UPDATE 06/04/2010:

    Ok, I found the solution to the problem. The code is fine. After following the steps from the original link above and adding in the needed registry key make sure that Windows SDK is targeting the correct version (7.0) by launching the Windows SDK Configuration Tool from start menu, choose the right version (v7.0), and click "Make Current".

    Make sure to include the following directories for x64 compiling (under "Tools->Options->Projects And Solutions->VC++ Directories): C:\CUDA\bin64 C:\CUDA\lib64 C:\CUDA\include C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64

    Now there's one other thing to change for a 64-bit system. Apparently the cuda compiler has a "hard-coded" directory for 64-bit compilers on Visual Express 2008. To make the fix, copy the needed file "vcvars64.bat" and rename it to "vcvarsamd64.bat" as follows:

    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat

    to

    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat

    Upon the change, the program compiled and ran successfully.

    I've read 'other' postings all over the web for other solutions to the error: "nvcc fatal: Visual Studio configuration file '(null)'", but very few have specified the above as a requirement to get nvcc to find the necessary visual studio configuration file.

    Disclaimer: I installed to a clean machine and OS.

    Hopefully this helps others with similar problems.

    0 讨论(0)
  • 2020-12-01 15:34

    Same error message, but different solution yet again. I was trying to compile 32 bits CUDA libs on a 64bits machine. I had to add --machine 32 argument to nvcc call, as suggested by Imperian in a comment, here : Error compiling CUDA from Command Prompt

    in hope this helps someone

    0 讨论(0)
  • 2020-12-01 15:38

    I solved the problem by

    1. installing Windows SDK (don't forget to choose all x64 options for 64 bit OS)
    2. include "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64" in PATH
    3. create file vcvars64.bat inside directory "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64" with following content: call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64

    Note: I did this because:

    1. I am using VC++ Express 2010
    2. I dont have "vcvars64.bat" in any directory ??
    0 讨论(0)
  • 2020-12-01 15:42

    I found that I also had to change the CUDA_PATH and CUDA_LIB_PATH environment variables, because they were pointing to the x86 toolchain (which I had installed after the x64 tools).

    After some faffing around with some linker errors, I managed to build a x64 CUDA app!

    0 讨论(0)
提交回复
热议问题