Nsight Compute: no -lineinfo from cmake cuda_compile_ptx

Hello,

i am trying to profile an OptiX 7 Application using Nsight Compute on an Ubuntu 20.10 Machine. The CUDA code gets compiled using the cuda_compile_and_embed command from Files · master · Ingo Wald / optix7course · GitLab. The general profiling works as expected, but I don’t get an option to attach my source code, because there seems to be no line info inside the ptx. There is no option to switch from the pure SASS like described in Nsight Compute :: Nsight Compute Documentation.

The cmake macro uses cuda_compile_ptx internally and creates as const char from the result using BIN2C. I extended this macro with the -lineinfo (cuda_compile_ptx(ptx_files ${cuda_file} OPTIONS -lineinfo) but without luck.

What am i missing ? Any help is much appreciated.

My assessment would be that this is a build issue, where the executed cubin does not actually carry line information (e.g. because it’s only compiled at runtime using NVRTC). I am checking with the OptiX team and will get back to you once there is more information.

The cmake in the repository has been updated to now preserve the line correlation information, please try again.

In combination with the debug flag for the module (https://gitlab.com/ingowald/optix7course/-/commit/ff37ccdede6f470570f5b6590231ec8bbc35273a) everything works as expected.

Thank you.