Cuda 8 compiler warnings when doing nvcc -clean

I am using Visual Studio to build a Cuda project, and with the Cuda 8 update I get a ton of warnings when doing a rebuild. This calls nvcc with the clean flag, which does not pass the sm or compute flags, so it seems to spit out the message when nvcc defaults to 2.0 even though it’s just doing a clean. Note that the sm and compute is explicitly set to 3.0 for these files.

7>CUDACOMPILE : nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).

If this is a problem or is bother you, they’ve given you the flag required to suppress the warning. Otherwise, just specify a higher compute-capability.

I do not want to use the flag, as multiple people work on the project and we want to see the warning if someone explicitly sets sm or compute version on a file to a deprecated version. The project is already set to use sm and compute 3.0. If you simply do a “clean” on a project you get this error despite the higher specified compute version.

I believe the warning should be ignored if doing a clean, or the clean command should also pass the sm/compute flags.

You might want to file a enhancement request with NVIDIA for nvcc to ignore architecture target with -clean. Enhancement requests can be filed through the bug reporting form, simply prefix the synopsis with “RFE:” to mark it as an enhance request rather than a functional bug.

For now, it should be easy enough to always specify -Wno-deprecated-gpu-targets along with -clean, but not any other compilation steps. At least it is trivial with a regular makefile. With MSVS solutions you may have to search through the GUI a bit to find out where exactly to specify that, but presumably there is a way since MSVS calls command-line tools under the hood, just adds a bit of obfuscation on top.

I only just found the bug form. I have submitted it as an enhancement request. Thanks!

It really bother me.Where can I exactly to specify -Wno-deprecated-gpu-targets in MSVS?
I mean,the detail way of specify.
Thanks in advance.

Go into Project Properties → CUDA C/C++ → Command Line
At the bottom it will have a place for ‘Additional Options’.
Add the following flags there:
-arch=compute_30 -code=sm_30