Diagnostics & Messages
Addresses apply to ptxas v13.0.88 (CUDA 13.0). VA base
0x400000(non-PIE).
ptxas emits 506 diagnostic messages from two .data tables. Unlike its opcode,
knob, and macro data, the diagnostic strings are stored in cleartext — no
string-pool cipher, ROT13, or position-XOR is involved, so they appear verbatim in a
strings dump. The symbolic ptxMsg* identifiers are macro-expanded away at build
time; only the numeric table index survives as the message id.
Two tables, separate id-spaces
| Table | Base VMA | Count | Contents |
|---|---|---|---|
main | 0x29FA4D0 | 465 (id 0–464) | PTX front-end / SASS assembler diagnostics; id 0 = "Memory allocation failure", last = "Internal compiler error%s, please report" |
link | 0x29FD590 | 41 (id 0–40) | Linker / options-file / DWARF diagnostics |
The two tables are separated in .data by a ROT47-obfuscated opcode/pseudo-instruction
name pool whose second field carries Adler-32 keys — the same hash scheme documented
in Pseudo-Instruction Expansion. That
pool is not part of the catalog; it just bounds the two diagnostic tables.
Record format
Each entry is a 16-byte record, indexed directly by id:
struct ptxas_msg {
uint32_t severity; // +0 severity code (see below)
uint32_t _pad; // +4 zero
const char *format; // +8 cleartext printf-style format string
};
Severity scheme
The emit path switches on the severity code and prepends a prefix looked up from two
small .rodata aux tables — the prefix char*[] at 0x1CE3300 and a per-severity
output-channel class byte at 0x1CE32F8. The printed channel tags (@E@ / @I@ /
@W@) select the stderr stream and exit behavior.
| Code | Prefix | Channel weight | Records in ptxas |
|---|---|---|---|
| 0 | (internal) | 4 | 0 (special-cased) |
| 1 | note | 0 | 0 |
| 2 | info | 0 | 13 |
| 3 | warning | 1 | 49 |
| 4 | error* (recoverable) | 1 | 0 |
| 5 | error | 2 | 341 |
| 6 | fatal | 4 | 103 |
Emission path
The emitter is sub_42F590 with formatter sibling sub_42FBA0 (the one carrying the
"%s, line %d; " location prefix). Both take a pointer to a message record as the
first argument and va_start the call-site varargs. Call sites pass &table[id] — e.g.
the allocation-failure path calls sub_42F590(&main_table[0]). The record's severity
field selects the prefix and channel from the aux tables; the format field is the
printf template applied to the varargs.
Catalog grouping
main(465) — lexer/parser errors,.target/.versionmismatches, type/operand checks, ABI / register / regcount diagnostics, pragma handling, alias/symbol resolution, and info-level advisories.link(41) — options-file parser, DWARF / debug-line, and link-time resource / data-size limits.
The full id → (severity, message) table for both tables is in the repo at
decoded/ptxas-messages/messages.tsv, regenerated by extract_messages.py, which
auto-locates the tables in any ptxas build and reproduces the table byte-for-byte.
Cross-References
- Pseudo-Instruction Expansion — the Adler-32-keyed pool adjacent to the message tables.
- Extracted .rodata Tables — the broader static-table corpus.
- Methodology.