MSVS2019 best -gencode setting

Using RTX 2080 SUPER (cc7.5).
CUDA 11.6

1.5.3. Applications Using CUDA Toolkit 10.0 says that compute_75,sm_75 should be used as optimum setting. %(CodeGeneration) is set to compute_52,sm_52 as default, and results in a 4% faster code than compute_75,sm_75. Is there a reason (apart from the wider compatibility and performance) to stay with compute_52,sm_52, or shall I switch to compute_75,sm_75 for any reason?

Besides that, MSVS2019 generates -gencode=arch=compute_75,code=\"sm_75,compute_75\" cubin and PTX. cubin alone (code=sm_75) doesn’t seem to be possible. Is there a reason for that?

The code I’m using is only supposed to run on developer machine (CUDA 11.6, RTX 2080 SUPER).

One possible reason to switch to the native architecture is if you used features specific to cc7.5 in your code. If your code compiles correctly for a cc5.2 target, then you’re not using any features. The reason the cc5.2 target settings here work on your cc7.5 GPU is that you are selecting PTX (also).

It should be possible by editing the setting in project settings, to select SASS only (cubin, using the terminology in that link).

1 Like

When I use the MSVS2019 user interface, I get this when sm_75 is used as Code Generation:
Error Item '' Code Generation value is not in the expected format '[Arch],[Code]'.

I have to enter -gencode=arch=compute_75,code=sm_75 within Additional Options and leave Code Generation blank.

And yes, code=sm_52 compiles correctly but doesn’t run.

Thanks for clarification!

Yes, you would need to use something like:


or maybe just


I don’t have the UI for this pulled up in front of me right now, but I’m sure there is an appropriate choice there. You should not have to resort to using Additional Options.

arch=compute_75,code=sm_75 doesn’t build if entered as such in Code Generation.

compute_75,sm_75 ends up with -gencode=arch=compute_75,code=\"sm_75,compute_75\" and builds fine, but PTX and cubin.

Strange that cubin only (code=sm_75) isn’t possible using Code Generation.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.