I am on Windows 10, Visual Studio 2017, CUDA 9 (nvcc V9.0.176). Here is the bare minimum code to reproduce the issue
nvcc -c “-DMYMACRO=__pragma(warning(push,0))” test.cu
test.cu(2): fatal error C1001: An internal error has occurred in the compiler.
However, if I simply rename test.cu to test.cpp and compile with cl it works without a problem,
cl -c “-DMYMACRO=__pragma(warning(push,0))” test.cpp
If I downgrade my CUDA 9 back to CUDA 8 it also works. Why is it not working on CUDA 9?
Internal compiler errors are caused by either of the following:
- A corrupted CUDA installation
- An error internal to the CUDA compiler that a programmer can do nothing about, other than filing a bug report with NVIDIA
I would suggest checking these possibilities in the order indicated. A corrupted CUDA installation could also involve mixing files from multiple different versions of CUDA. If you believe this to be a compiler bug after performing due-diligence checks, consider filing a bug using the form linked from the registered developer website. You would want to attach the smallest buildable self-contained code that reproduces the issue.