Skip to content

ci: install cuda-gdb in the default fetch_ctk toolkit - #3371

Open
juenglin wants to merge 1 commit into
NVIDIA:mainfrom
juenglin:ci/fetch-ctk-default-cuda-gdb
Open

juenglin wants to merge 1 commit into
NVIDIA:mainfrom
juenglin:ci/fetch-ctk-default-cuda-gdb

Conversation

@juenglin

@juenglin juenglin commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds cuda_gdb to the default cuda-components list of the fetch_ctk action, so Linux jobs that install the mini CTK also get cuda-gdb and cuda-gdbserver on PATH (about 60–100 MB per archive depending on the CUDA version).

cuda_gdb is published for linux-x86_64 and linux-sbsa in every CUDA version in the CI matrix (12.6.3 through 13.4.2). There is no Windows build; fetch_ctk already skips components a platform does not publish (as it does for libcudla on x86_64), so Windows jobs are unchanged.

Tests enabled

  • cuda_core/tests/test_program.py::test_cuda_gdb_shows_nvrtc_debug_source_lines currently always skips in mini-CTK jobs ("cuda-gdb is not on PATH"). With this change it runs: it debugs a kernel compiled with debug=True and checks that cuda-gdb shows the NVRTC source lines. It reports xfail rather than failing on runners where ptrace is not permitted.
  • cuda_pathfinder/tests/test_find_nvidia_binaries.py::test_find_binary_utilities[cuda-gdb] and [cuda-gdbserver] now locate real binaries instead of returning None. These pass either way, so this only adds coverage of the found path.

Only matrix entries that use the mini CTK (LOCAL_CTK == '1') are affected; jobs that take CUDA from wheels do not get cuda-gdb.

Side effects

  • Build, docs, coverage, and sdist jobs also use the default list, so they download cuda_gdb on a cache miss even though they do not use it.
  • The component list is part of the fetch_ctk cache key, so every Linux job misses the CTK cache once after this lands.

cuda_core's test_cuda_gdb_shows_nvrtc_debug_source_lines skips when
cuda-gdb is not on PATH, which is always the case with the mini CTK.
Adding cuda_gdb (about 100 MB, Linux only) to the default components lets
the test run in every Linux job that uses fetch_ctk's default list.
fetch_ctk already skips components a platform does not publish, so
Windows jobs are unchanged.

Signed-off-by: Ralf Juengling <rjuengling@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI/CD CI/CD infrastructure label Nov 4, 2026
@juenglin

juenglin commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 724bc86

@juenglin juenglin added the test Improvements or additions to tests label Nov 4, 2026
@juenglin juenglin self-assigned this Nov 4, 2026
@juenglin juenglin added this to the cuda.core 1.3.0 milestone Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@juenglin
juenglin requested review from mdboom and rwgk November 4, 2026 17:59
@juenglin
juenglin marked this pull request as ready for review November 4, 2026 18:02
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

Summary

Summary by CodeRabbit

  • New Features
    • The default CUDA component selection now includes cuda_gdb.

The fetch_ctk GitHub Action's default cuda-components list now includes cuda_gdb.

Changes: fetch_ctk component defaults

Layer / File(s) Summary
Update component default
.github/actions/fetch_ctk/action.yml
The default cuda-components list adds cuda_gdb.

Possibly related PRs

  • NVIDIA/cuda-python#3347: The fetch_ctk action behavior established in this PR applies to the expanded default component list.

Suggested labels: github_actions

Change: Feature

Merge Risk: Low · up to 724bc

This increases CI transfer and cache usage for jobs that do not need cuda-gdb, but does not block normal functionality.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comments: 1
.github/actions/fetch_ctk/action.yml: 1

17-17: Trivial · Performance & Scalability · Quick win

suggestion: Keep cuda_gdb out of the global default and add it only to the Linux mini-CTK invocation that needs the debugger. Callers that omit cuda-components inherit this list, so unrelated jobs download and cache the debugger archive on cold misses. This increases CI transfer and cache use for jobs that do not run the debugger test. (raw.githubusercontent.com)

Source: Path instructions

Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between deb3d04 and 724bc86.

Files selected for processing: 1
  • .github/actions/fetch_ctk/action.yml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@leofang

leofang commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Q: Who/where is using this? Our "mini" CTK is not mini anymore because cuda-gdb pulls in its own Python...

@leofang leofang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In numba-cuda-mlir, we overlay fetch_ctk call to additionally fetch cuda-gdb in the one pipeline that needs it. Let's do the same here (if it is needed at all).

@rwgk rwgk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codex GPT-6.1-Sol ultra:

No actionable findings in PR #3371, reviewed at 724bc86.

  • Platform filtering and cache invalidation handle the added component correctly.
  • All 13 toolkit-helper tests pass locally; full CI is green.
  • The debugger source-line test passes in both x86_64 and aarch64 CI.

The remaining tradeoff is extra download and cache usage for Linux jobs that do not need the debugger, already acknowledged in the PR description.

CUDA-GDB history and download sizes

CUDA-GDB is a long-established tool. NVIDIA’s CUDA 2.1 release in January 2009 already included GDB-based CUDA debugging. It extends GDB to debug CPU and GPU code together, including breakpoints, stepping, variables, and GPU state. cuda_gdb is the redistribution component’s name; cuda-gdb is the executable. Release history, tool overview.

For the CUDA versions relevant to this PR, the compressed debugger downloads are:

CUDA version Linux x86_64 Linux ARM64/SBSA
12.6.3 64.7 MB 43.5 MB
12.9.1 67.7 MB 45.7 MB
13.0.2 68.5 MB 66.1 MB
13.4.2 103.5 MB 100.5 MB

These are decimal MB for this component alone. There is no native Windows package in those manifests, so this PR adds no Windows download. CUDA-GDB does support WSL2 using Linux tooling. Supported platforms.

The main coverage gain is enabling an existing source-debugging integration test. It:

  1. Starts a Python process under cuda-gdb.
  2. Compiles a CUDA source string through cuda.core.Program and NVRTC with debug=True.
  3. Loads and launches the resulting kernel, with the debugger configured to stop at kernel launch.
  4. Asks the debugger to display source and checks for the generated .cu filename and a known source line.

The practical benefit is verifying that a user can see their runtime-compiled CUDA source in a real debugger. That requires the generated source file, compiler debug information, source paths, and GPU debugger to work together. Existing file-management tests cover parts of that chain; this exercises the complete interaction. Compilation and launch helper.

There is also modest additional coverage of finding installed cuda-gdb and cuda-gdbserver binaries. Those lookup tests still accept None, and nothing here exercises remote debugging through cuda-gdbserver. Lookup test.

@rwgk

rwgk commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

In numba-cuda-mlir, we overlay fetch_ctk call to additionally fetch cuda-gdb in the one pipeline that needs it. Let's do the same here (if it is needed at all).

I only saw this right now.

@juenglin

juenglin commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Q: Who/where is using this? Our "mini" CTK is not mini anymore because cuda-gdb pulls in its own Python...

The test cuda_core/tests/test_program.py::test_cuda_gdb_shows_nvrtc_debug_source_lines is currently never executed. Are you suggesting that we include cuda_gdb in the fetch for test workflows only? Or live with the gap?

@lijinf2

lijinf2 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Q: Who/where is using this? Our "mini" CTK is not mini anymore because cuda-gdb pulls in its own Python...

The test cuda_core/tests/test_program.py::test_cuda_gdb_shows_nvrtc_debug_source_lines is currently never executed. Are you suggesting that we include cuda_gdb in the fetch for test workflows only? Or live with the gap?

I checked CI log of this job, The test is executed there and passes:

tests/test_program.py::test_cuda_gdb_shows_nvrtc_debug_source_lines PASSED [ 66%]

@lijinf2

lijinf2 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What is the "mini CTK" used for? My agent says it tests the scenario of downloading and installing the CUDA Toolkit. If so, wouldn't "local CTK" be a more fitting name? "mini CTK" sounds like a subset, as if it runs only some of the tests rather than all of them.

@rwgk

rwgk commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What is the "mini CTK" used for? My agent says it tests the scenario of downloading and installing the CUDA Toolkit. If so, wouldn't "local CTK" be a more fitting name? "mini CTK" sounds like a subset, as if it runs only some of the tests rather than all of them.

Both names are already in use in the workflow code, and they're basically equivalent AFAIK.

"mini CTK" sounds like a subset

Correct. The way I think about it, roughly: it's a subset of what external users usually install into /usr/local/cuda

(In the CI, I think the directory is actually elsewhere.)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants