New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTX code missing DWARF debug information #31

Open
maleadt opened this Issue Jan 20, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@maleadt
Member

maleadt commented Jan 20, 2017

@vchuravy Care to summarize your findings? It'd be good to have all relevant documentation/links in an issue.

@maleadt maleadt added the upstream label Jan 20, 2017

@vchuravy

This comment has been minimized.

Show comment
Hide comment
@vchuravy

vchuravy Jan 21, 2017

Member

Gladly.

According to Nvidia's documentation their debug information is in DWARF2.
The debug information is emitted in a textual format for NVPTX documented in [1].

The responsibility for generating debug information is split between the PTX producer
and the PTX-to-SASS backend. The PTX producer is responsible for emitting binary
DWARF into the PTX file, using the .section and .b8-.b16-.b32-and-.b64 directives in PTX.
This should contain the .debug_info and .debug_abbrev sections, and possibly optional
sections .debug_pubnames and .debug_aranges. These sections are standard DWARF2
sections that refer to labels and registers in the PTX

The PTX-to-SASS backend is responsible for generating the .debug_line section from
the .file and .loc directives in the PTX file. This section maps source lines to SASS
addresses. The backend also generates the .debug_frame section.

Resources

Steps

  1. Decode the debug information that Nvidia currently generates
  2. Check that it is valid DWARF and that there are no properitary sections
  3. Teach NVPTXAsmPrinter in LLVM to emit the correct format
  4. Add support to Gallium.jl for GPUs ;)
Member

vchuravy commented Jan 21, 2017

Gladly.

According to Nvidia's documentation their debug information is in DWARF2.
The debug information is emitted in a textual format for NVPTX documented in [1].

The responsibility for generating debug information is split between the PTX producer
and the PTX-to-SASS backend. The PTX producer is responsible for emitting binary
DWARF into the PTX file, using the .section and .b8-.b16-.b32-and-.b64 directives in PTX.
This should contain the .debug_info and .debug_abbrev sections, and possibly optional
sections .debug_pubnames and .debug_aranges. These sections are standard DWARF2
sections that refer to labels and registers in the PTX

The PTX-to-SASS backend is responsible for generating the .debug_line section from
the .file and .loc directives in the PTX file. This section maps source lines to SASS
addresses. The backend also generates the .debug_frame section.

Resources

Steps

  1. Decode the debug information that Nvidia currently generates
  2. Check that it is valid DWARF and that there are no properitary sections
  3. Teach NVPTXAsmPrinter in LLVM to emit the correct format
  4. Add support to Gallium.jl for GPUs ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment