You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cuda.core: source-level cuda-gdb debugging broken for JIT kernels — NVRTC program name defaults to "default_program" #2385
When a cuda.core.Program is compiled from an inline source string with debug=True / lineinfo=True but no name= in ProgramOptions, cuda.core passes an empty program name to nvrtcCreateProgram. NVRTC then embeds its hardcoded fallback default_program as the DWARF source filename. Because no file named default_program exists on disk, cuda-gdb cannot resolve source — every kernel frame maps to default_program:10 and source-level GPU debugging is unusable.
Reproduction
Compile an inline kernel and break in it under cuda-gdb:
CUDA thread hit Breakpoint 1, matmul_shared<<<...>>> ()
at .../default_program:10
warning: 10 .../default_program: No such file or directory
Isolated to the program name: nvrtcCreateProgram with name "" → cubin embeds default_program; with "matmul.cu" → embeds matmul.cu and line mapping resolves correctly.
Current workaround (confirmed by the reporting customer and NVIDIA QA)
Persist the kernel source to a real .cu file and pass its absolute path as name=:
With the source on disk and name= pointing at it, cuda-gdb resolves the source and line mapping is correct.
Proposed enhancement
When debug or lineinfo is enabled and name is unset:
Quick win — emit a warning that source-level debugging requires a name that points at an on-disk source file, so users aren't silently left with default_program.
Full fix — auto-populate a deterministic program name and persist the JIT source to a cache/temp path, so cuda-gdb resolves source lines with no manual steps.
Context
Origin: internal NVBugs 6420444 (Linaro, CUDA-GDB Python debugging). cuda-gdb ruled itself out; root cause is cuda.core / NVRTC program-name handling.
Not a blocker today (Python GPU debugging is nascent) — this is a developer-experience improvement for future usability.
Activity
leofang commentedon Jul 17, 2026
Does cuda-gdb actually need a file to exist on-disk? 👀 I thought it just needs the debug symbols and line info?
rparolin commentedon Jul 30, 2026
According to the reported issue, gdb is failing to load the source code because there isn't a file on disk that matches the default name. So it fails.
Merge upstream/main into fix-program-debug, superseded by NVIDIA#2679