Skip to content

cuda.core: emit -numba-debug to libNVVM, not --numba-debug - #2571

Open
fedonman wants to merge 1 commit into
NVIDIA:mainfrom
fedonman:fix-nvvm-numba-debug-option-spelling
Open

cuda.core: emit -numba-debug to libNVVM, not --numba-debug#2571
fedonman wants to merge 1 commit into
NVIDIA:mainfrom
fedonman:fix-nvvm-numba-debug-option-spelling

Conversation

@fedonman

@fedonman fedonman commented Aug 9, 2026

Copy link
Copy Markdown

Summary

Closes #2570.

libNVVM accepts only single-dashed options, but _prepare_nvvm_options_impl emitted --numba-debug, so every ProgramOptions(numba_debug=True) compile on the NVVM backend failed with NVVM_ERROR_INVALID_OPTION. numba-cuda emits -numba-debug for the same path. The NVRTC backend tolerates both spellings and is left alone.

The guarding test never caught this because it probed libNVVM with the same wrong spelling, so it skipped on every configuration, including CUDA 13.3. It is one of the entries in #2077.

Changes

  • _program.pyx: emit -numba-debug in _prepare_nvvm_options_impl. The NVRTC call site is unchanged.
  • tests/test_program.py: probe and assert the emitted spelling, add an assertion that the double-dashed form is absent, and drop the skip reason's claim that the option needs CTK 13.2 (libNVVM rejects the double-dashed form at any version).
  • docs/source/release/1.2.0-notes.rst: release note. The wrong spelling is in released 1.1.0 and 1.1.1.

Verification

test_nvvm_program_numba_debug previously skipped everywhere. It now runs and passes, and it fails without the production change:

$ git stash push cuda_core/cuda/core/_program.pyx   # production only
$ python -m pytest tests/test_program.py -k numba_debug -v
tests/test_program.py::test_nvvm_program_options_as_bytes_numba_debug FAILED [ 50%]
tests/test_program.py::test_nvvm_program_numba_debug FAILED              [100%]
cuda.bindings.nvvm.nvvmError: ERROR_INVALID_OPTION (7)
NVVM program log: libnvvm : error: --numba-debug is an unsupported option

With the change:

$ python -m pytest tests/test_program.py -k numba_debug -v
tests/test_program.py::test_nvvm_program_options_as_bytes_numba_debug PASSED [ 50%]
tests/test_program.py::test_nvvm_program_numba_debug PASSED              [100%]

Whole module, before and after:

$ python -m pytest tests/test_program.py -q   # upstream/main
110 passed, 2 skipped in 2.01s
$ python -m pytest tests/test_program.py -q   # this branch
111 passed, 1 skipped in 2.61s

libNVVM accepts only single-dashed options, so every
ProgramOptions(numba_debug=True) compile on the NVVM backend failed with
NVVM_ERROR_INVALID_OPTION. numba-cuda emits -numba-debug for the same
path. The NVRTC backend tolerates both spellings and is left alone.

The guarding test probed libNVVM with the same wrong spelling, so it
skipped on every configuration and never caught this. Probe and assert
the spelling the code now emits, and drop the skip reason's claim that
the option needs CTK 13.2: libNVVM rejects the double-dashed form at any
version.

Closes NVIDIA#2570

Signed-off-by: Vyron Vasileiadis <hi@fedonman.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 9, 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 cuda.core Everything related to the cuda.core module label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: ProgramOptions(numba_debug=True) always fails on the NVVM backend

1 participant