How to generate a cubin file from a cu file in Aerial

I tried to generate a cubin file from a cu file but failed.
Specifically, I tried to generate a cubin file from /opt/cuBB/cuPHY/src/cuphy/error_correction/ldpc2_reg_index_fp_desc_dyn_row_dep.cu and executed the following command and error message.

nvcc /opt/cuBB/cuPHY/src/cuphy/error_correction/ldpc2_reg_index_fp_desc_dyn_row_dep.cu -o ldpc2_reg_index_fp_desc_dyn_row_dep.cubin - arch=sm90

  • /usr/bin/ld: /lib/aarch64-linux-gnu/crt1.o: in function `__wrap_main’:

  • (.text+0x38): undefined reference to `main’

  • /usr/bin/ld: /tmp/tmpxft_00003358_00000000-11_ldpc2_reg_index_fp_desc_dyn_row_dep.o: in function `ldpc2::BG_desc<1> const* ldpc2::get_BG_desc<__half, 1>(int)':

This may be a rudimentary question, but thank you in advance.

To create a cubin with nvcc, it is usually typical/necessary to specify a particular compile switch such as -cubin on the nvcc command line. Any such switch is missing from your posted example.

The error coming from your posted example is due to the fact that without any other compile switches, nvcc will behave much like gcc and expect that you want to build an executable. An executable will require a main entry point, or else you’ll get the error you show.

nvcc usage is documented here.