79738760

Date: 2025-08-18 13:11:06
Score: 0.5
Natty:
Report link

The problem was related to the compiler.

When specifying the targeted platform of the compilation, one must specify both the virtual target and the real target. The former is related to the PTX version, and the latter, to the SASS version. So, what might happened is that the compiler has defaulted to an old PTX version when I only specified -arch in the compilation command:

nvcc cuda_test.cu -o cuda_test -arch=sm_121a

Now that I also specify the -code, the compilation has succeeded. The command is as follows:

nvcc cuda_test.cu -o cuda_test --generate-code arch=compute_121a,code=sm_121a

In which the arch and code are parameters of the --generate-code.

The compute_XX is about the virtual target, and the sm_XX, the real target.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Junhao Liu