0
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env --cl-version 2017 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\Hostx64\x64\cl.exe" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" -I"C:\cub-1.7.4" -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include" --keep-dir "C:\Users\Marko\Source\Repos\The Spiral Language\Temporary\bin\Release" -maxrregcount=0  --machine 64 -ptx -cudart static  -o "C:\Users\Marko\Source\Repos\The Spiral Language\Temporary\bin\Release\cuda_kernels.ptx" "C:\Users\Marko\Source\Repos\The Spiral Language\Temporary\bin\Release\cuda_kernels.cu"

A template similar to the above would have worked for me with Cuda 8.0, but it does not with the never version.

[vcvarsall.bat] Environment initialized for: 'x86_x64'
nvcc fatal   : Cannot find compiler 'cl.exe' in PATH

I get the above error, but if you look at the ccbin path, cl.exe is exactly in that directory and NVCC's error message barely makes sense to me.

In order to figure out what the problem is what I should be doing is taking a look at the VS 2017 Cuda template and adapt it from that, but I'd prefer not to have to deal with the 3.5Gb install just for this single thing.

What is the problem with the way I am handling NVCC? It does find cl.exe if I put it in the PATH.

Edit: It is not a duplicate question because I am not asking how to add cl.exe to PATH. I am asking why NVCC itself is not accepting proper inputs. I only asked how to add to PATH as a side-note in the comments. Also, in the bug report to NVidia, I am linking to this question directly so please do not close it down until the issue is resolved.

Marko Grdinić
  • 3,798
  • 3
  • 18
  • 21
  • 1
    You can specify the complete executable in ccbin, try that. If it doesn't work then report it to NVIDIA, it might be a bug – talonmies Nov 19 '17 at 10:07
  • Even with a direct path to `cl.exe` it doesn't work. I will do as you suggest. But there should be a way to get this to work from the command line. – Marko Grdinić Nov 19 '17 at 10:11
  • The VC include path also needs to be passed to NVCC unlike in the previous version so I am modifying the `.bat` script to reflect that. I can get it to compile now, but `cl.exe` does need to be in `PATH` for it to work. I've opened the bug ticket so we'll see where this goes. – Marko Grdinić Nov 19 '17 at 12:27
  • why not add the path to cl.exe to your windows environment `PATH` variable? That is the actual error being reported here. I don't know of anywhere in the CUDA windows documentation (e.g. windows install guide) where it is stated that command line execution can be set up to run without modification of the `PATH`. `nvcc` may well indeed require that `cl.exe` be both properly accounted for in the `-ccbin` switch as well as the `PATH` env variable. That was my experience some time ago (prior to CUDA 8), although I don't use compilation from command line in windows very much. – Robert Crovella Nov 20 '17 at 15:16
  • In the previous version it worked without `cl.exe` being in path. As for why not add it to path, it would be because the potential users of my program would need to add it manually...though now that I wrote that it occurs to me that there should be a way to add it to path inside the batch script. Any idea how that might be done? – Marko Grdinić Nov 20 '17 at 16:01
  • 1
    google popped [this](https://stackoverflow.com/questions/6832496/command-prompt-how-to-add-a-set-path-only-for-that-batch-file-executing) up right away; note use of `setlocal` – Robert Crovella Nov 21 '17 at 17:58
  • @talonmies Please see edit for my argument why this is not a duplicate. – Marko Grdinić Nov 28 '17 at 12:52

0 Answers0