Linker warning: nvlink warning : SM Arch ('sm_52') not found in XX.o when building for sm_86 in CUDA 11

I’m getting this warning when building my project.
Most search results on the topic are either trying to compile for a deprecated architecture or with a CUDA version that had a known issue.
Obviously this is similar to this topic, However specifying -arch=sm_86 to the link command causes the build to fail with error code 255, which seems to be related to the number of registers allowed for kernels.
What am I doing wrong and what can be done to help?

The title of your post indicates Cuda 11. If this is Cuda 11.0, then sm_86 was not available until 11.1.

Specifying matching/proper architectures on all relevant command lines (compile, link) is the proper solution for the problem stated in the title.

If that clears that problem and results in another one, you will need to work on the next problem. I’m not able to make any further suggestions based on what you have provided so far.

1 Like

problem seen in versions 11.4 and 11.5

I’ll open another thread then =\