nvcc Fornicate Under the Consent of the King under windows just want to compile GPU code, but fails

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.

Jason,
He is just looking to use only the PTX conversion phase for his kernels. Hez not generating an executable… So, why would he need MSVC?

Jason,
He is just looking to use only the PTX conversion phase for his kernels. Hez not generating an executable… So, why would he need MSVC?

You can get it for FREE. Is having to download it really that much of a hassle?

You can get it for FREE. Is having to download it really that much of a hassle?