On windows, nvcc requires Microsoft’s compiler to be available. On linux, nvcc requires gcc to be available.
The requirement is non-negotiable; it doesn’t matter if you’re compiling only device code, or if you are not using the CUDA C or C++ extensions in your host code. nvcc is a compiler wrapper, and I think that the wrapper needs one compiler or the other when parsing your input source files, in order to separate the host and device code and put them in the correct object file locations.
If you use only the driver API, your code is plain C and any compiler will build it; but the moment you use nvcc for anything you must have the native compiler as specified above. You can download MSVC Express for free and never use it, just to get nvcc to work and build device code (this is what I do), but if you want nvcc to also build host code then it will insist on using Microsoft’s compiler.
On windows, nvcc requires Microsoft’s compiler to be available. On linux, nvcc requires gcc to be available.
The requirement is non-negotiable; it doesn’t matter if you’re compiling only device code, or if you are not using the CUDA C or C++ extensions in your host code. nvcc is a compiler wrapper, and I think that the wrapper needs one compiler or the other when parsing your input source files, in order to separate the host and device code and put them in the correct object file locations.
If you use only the driver API, your code is plain C and any compiler will build it; but the moment you use nvcc for anything you must have the native compiler as specified above. You can download MSVC Express for free and never use it, just to get nvcc to work and build device code (this is what I do), but if you want nvcc to also build host code then it will insist on using Microsoft’s compiler.