Skip to content

Keep deferred copy count storage alive#156

Merged
kevmo314 merged 1 commit into
mainfrom
fix-nvrtc-sample-hang
Jun 4, 2026
Merged

Keep deferred copy count storage alive#156
kevmo314 merged 1 commit into
mainfrom
fix-nvrtc-sample-hang

Conversation

@kevmo314

@kevmo314 kevmo314 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fix deferred DtoH copy-count writes to use caller-owned storage that stays alive until rpc_write_end()
  • restore cuCtxSynchronize stdout capture instead of disabling it
  • fixes vectorAdd_nvrtc hanging because the client no longer reads a corrupted deferred-copy count

Root cause

rpc_write() stores iovec pointers and flushes them later in rpc_write_end(). lupine_write_pending_dtoh_copies() queued a pointer to its local count variable, so calls made before rpc_write_end() could reuse that stack slot. In vectorAdd_nvrtc, the client read garbage for copy_count and then waited for nonexistent copy payload bytes.

Verification

  • cmake --build build -j"24"
  • ctest --test-dir build --output-on-failure
  • RESULTS_DIR=/tmp/lupine-vectoradd-count-lifetime SAMPLE_TIMEOUT=30 BUILD_SAMPLES=0 SERVER_PORT_BASE=15180 ./test/run_cuda_samples.sh vectorAdd vectorAddDrv vectorAdd_nvrtc simplePrintf

@kevmo314 kevmo314 marked this pull request as draft June 4, 2026 06:47
@kevmo314 kevmo314 changed the title Avoid stdout capture during context sync Keep deferred copy count storage alive Jun 4, 2026
@kevmo314 kevmo314 force-pushed the fix-nvrtc-sample-hang branch from 4589b84 to 2907b05 Compare June 4, 2026 06:50
@kevmo314 kevmo314 marked this pull request as ready for review June 4, 2026 06:50
@kevmo314 kevmo314 force-pushed the fix-nvrtc-sample-hang branch from 2907b05 to 4350a3b Compare June 4, 2026 06:53
@kevmo314 kevmo314 merged commit e63787f into main Jun 4, 2026
47 of 48 checks passed
@kevmo314 kevmo314 deleted the fix-nvrtc-sample-hang branch June 4, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant