-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
NVPTX: Debug section symbol naming in .ptx output #99248
Copy link
Copy link
Open
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.O-NVPTXTarget: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.htmlTarget: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.htmlT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.O-NVPTXTarget: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.htmlTarget: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.htmlT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
When the panic machinery is used in a
ptx-kernelit generates a symbol in the debug section that is generated in a different way than the symbol it refers to.Today when compiling to ptx (
--target nvptx64-nvidia-cuda) all debug info is stripped by ptx-linker here. This decision predates debug info support on nvptx in llvm and it seems like there are only a few obstacles left to be able to debug rust code with cuda-gdb. Nonetheless, getting debug symbols into .ptx requires installing a ptx-linker with thisLLVMStripModuleDebugInfocommented out.It is reproducable with the following code compiled with
cargo +nightly-2022-06-18 rustc --target nvptx64-nvidia-cuda -Zbuild-std -- -C target-cpu=sm_86Inside
.section .debug_infoi get a line looking like.b64 anon.e3d4032e2030354db324b88c41516303.47. I assume it refers to the line.global .align 8 .u64 anon_$_e3d4032e2030354db324b88c41516303_$_47[4] = {_ZN4core3ptr88drop_in_place$LT$core$$panic$$panic_info$$PanicInfo$$internal_constructor$$NoPayload$GT$17h951018dc744e645eE, 0, 1, _ZN36_$LT$T$u20$as$u20$core$$any$$Any$GT$7type_id17h215c4e91a81cf303E};If I manually change this line to
.b64 anon_$_e3d4032e2030354db324b88c41516303_$_47ptxas stops complaining on this line (but still complains on a different nvptx debug info issue).If anyone got any pointers to where I should start investigate how this symbol mangling can be different from debug symbols and for
.globalvariables I would be thankful.Have you had to deal with this @RDambrosio016?