Fix host copy source lifetime
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend, embedded-iot
Research direction
The referenced work is in cuda-core/src/runtime.rs, cutile/src/api.rs, and a GPU execution test for copy_host_vec_to_device_keeps_source_alive_until_stream_completion. First read the “Transplanting a cutile-rs pull request” section in AGENTS.md; the prior pull request is closed in the archived repository, and its branch conflicts in the listed files. Done means recreating the work against this repository and validating it, though the reported CUDA toolkit requirement may block local tests.
Written by the indexing model from the issue text.
Description
Tracks pull request NVlabs/cutile-rs#168 (https://github.com/NVlabs/cutile-rs/pull/168) by @fallintoplace, opened 2026-06-19: Fix host copy source lifetime. As of 2026-10-07 the branch conflicts with cutile-rs main in: cuda-core/src/runtime.rs, cutile/src/api.rs.
@fallintoplace: that repository has moved here and is being archived, so the pull request is closed there, not rejected. If you want to continue the work, please recreate it against NVIDIA/cuda-rust. AGENTS.md in NVIDIA/cuda-rust has a "Transplanting a cutile-rs pull request" section that lets an agent do the replay (it fetches pull/168/head from NVlabs/cutile-rs, keeps your authorship and sign-off, and maps the moved paths).
Original description:
Summary
- Keep the
Arc<Vec<T>>source forcopy_host_vec_to_devicealive until the CUDA stream reaches a host callback queued after the H→D copy. - Tighten
Stream::launch_host_functionso callbacks must be'staticand the boxed callback is reclaimed if enqueueing fails. - Add a regression test that blocks the stream before the copy, drops the caller's
Arc, and verifies the source stays alive until stream completion.
Root Cause
CopyHostVecToDevice::execute enqueued memcpy_htod_async with vec.as_ptr() and then returned a Tensor, letting the operation-owned Arc<Vec<T>> drop immediately. Awaiting the DeviceFuture waited for stream completion, but nothing kept the host source buffer alive while the copy was still pending.
Validation
cargo fmt --checkgit diff --checkcargo test -p cutile --test gpu_execution_ops copy_host_vec_to_device_keeps_source_alive_until_stream_completion -- --nocaptureblocked locally becauseCUDA_TOOLKIT_PATHis unset and no CUDA 13.2+ toolkit exists at the default/usr/local/cuda*paths.cargo check -p cutileblocked for the same missing CUDA toolkit.
- Dominant language
- Rust
- Stars
- 3.9k
- Forks
- 349
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 83
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuda-rust
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
cutile-rs supply-chain
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NVIDIA/cuda-rust#1568 · 1 comment ·
Maintainers usually reply within 1 day
All issues in NVIDIA/cuda-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
calcit-lang/calcit#2538 ·
Maintainers usually reply within 1 day
-
Remove the em dashes from the skill smart-account referencePossibly taken @Vamsi-2581 claimed this today. Openagent-ready area: docs documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Soneso/stellar-agent-wallet#541 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bovinemagnet/AdocFoundry#279 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 1/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
weihubeats/Miyo#132 · 1 comment ·
Maintainers usually reply within 2 days