Skip to content

fix(example): report stream faults from callback-based CUDA awaitables - #386

Merged
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:pr/cuda-callback-error-reporting
Aug 26, 2026
Merged

fix(example): report stream faults from callback-based CUDA awaitables#386
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:pr/cuda-callback-error-reporting

Conversation

@sgerbino

Copy link
Copy Markdown
Collaborator

cudaLaunchHostFunc passes no completion status to its host function, so a callback-based IoAwaitable could not observe a stream fault and resumed with success. Query the stream with cudaStreamQuery in await_resume, back on a worker thread where CUDA calls are permitted, and surface the sticky error through the awaitable's normal error path.

Apply this to callback_awaitable in notification-strategies and to cuda_stream / cuda_device_stream in datamovement. Add a --fault mode to notification-strategies that launches a null-pointer kernel and awaits it via one mechanism per process under a watchdog; all three now resume with cudaErrorIllegalAddress, where the callback previously resumed with success. Poll and deferred-sync were already correct because cudaEventQuery and cudaStreamSynchronize return the status.

cudaLaunchHostFunc passes no completion status to its host function,
so a callback-based IoAwaitable could not observe a stream fault and
resumed with success. Query the stream with cudaStreamQuery in
await_resume, back on a worker thread where CUDA calls are permitted,
and surface the sticky error through the awaitable's normal error path.

Apply this to callback_awaitable in notification-strategies and to
cuda_stream / cuda_device_stream in datamovement. Add a --fault mode to
notification-strategies that launches a null-pointer kernel and awaits
it via one mechanism per process under a watchdog; all three now resume
with cudaErrorIllegalAddress, where the callback previously resumed
with success. Poll and deferred-sync were already correct because
cudaEventQuery and cudaStreamSynchronize return the status.
@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://386.capy.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-08-26 18:13:55 UTC

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (aed1c30) to head (0cf4363).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #386   +/-   ##
========================================
  Coverage    98.09%   98.09%           
========================================
  Files          130      130           
  Lines         6291     6291           
========================================
  Hits          6171     6171           
  Misses         120      120           
Flag Coverage Δ
linux 98.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 82 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aed1c30...0cf4363. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgerbino
sgerbino merged commit cace302 into cppalliance:develop Aug 26, 2026
38 checks passed
@sgerbino
sgerbino deleted the pr/cuda-callback-error-reporting branch August 26, 2026 19:23
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Beast2 Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants