Compiler warning "nvlink warning : SM Arch ('sm_20') not found in 'g2init.o'"

For some reason, nvcc returns the warning

nvlink warning : SM Arch ('sm_20') not found in 'cudafile.o'

for every compiled .cu file. I am compiling with

nvcc -dc -m64 -lineinfo -Wno-deprecated-gpu-targets -arch=sm_60 -Xcudafe "--diag_suppress=declared_but_not_referenced" cudafile.cu

Any way to get rid of this pointless warning?

The warning you are showing arises from a link command, however the command you are showing is a compile command.

Add -arch=sm_60 to your link command also

Excellent, that worked. Thanks.