Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error compiling CUDA from Command Prompt

Tags:

cuda

nvidia

I'm trying to compile a cuda test program on Windows 7 via Command Prompt, I'm this command:

nvcc test.cu 

But all I get is this error:

nvcc fatal : Cannot find compiler 'cl.exe' in PATH 

What may be causing this error?

like image 984
GennSev Avatar asked Nov 14 '11 17:11

GennSev


2 Answers

You will need to add the folder containing the "cl.exe" file to your path environment variable. For example:

C:\Program Files\Microsoft Visual Studio 10.0\VC\bin 

Edit: Ok, go to My Computer -> Properties -> Advanced System Settings -> Environment Variables. Here look for "PATH" in the list, and add the path above (or whatever is the location of your cl.exe).

like image 119
Tudor Avatar answered Sep 28 '22 07:09

Tudor


For new Visual Studio cl.exe is present in path => C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64

x64 is for 64bit

x86 is for 32bit

like image 45
Samarth Janardhan Avatar answered Sep 28 '22 07:09

Samarth Janardhan