cuda-core: distinguish CUDA devices and contexts in the shared host API
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 8/100
Research direction
Start by reading the root Device in cuda-core/src/runtime.rs and simt::CudaContext in cuda-core/src/simt/context.rs to see how each bundles a device handle with a context handle. Related work lives in #1460, #1461, #1403 and #1505, so check those before proposing anything. Done means a written ownership and lifetime model with migration examples for both programming models, and the final type names chosen.
Written by the indexing model from the issue text.
Description
Root Device and simt::CudaContext both bundle a CUDA device handle with a context handle. The shared host API needs distinct device and context identities while preserving convenient initialization and correct resource ownership.
Requirements
- Define device and context responsibilities, including the relationship between a device and its primary or other contexts. Physical-device identity must not substitute for context identity.
- Specify context ownership, retaining/releasing, thread binding, and borrowed/foreign-handle lifetimes.
- Evaluate a separately named convenience handle or constructor that pairs a device and context without obscuring their distinction.
- Map root
Deviceandsimt::CudaContextusers onto the shared model, including streams, allocations, events, modules, and functions. Preserve context compatibility checks and resource lifetimes. - Provide an incremental migration path for #1460 and #1461, coordinating explicit global-context handling with #1403 and cleanup without implicit synchronization on drop.
Acceptance
Document the type and ownership model and provide migration examples for both programming models. Validate context identity and lifetimes across owned, borrowed, and foreign resources. Select the final type names and convenience-wrapper shape as part of the API design.
Source: root Device, SIMT CudaContext.
Public namespace design is tracked separately in #1505.
- Dominant language
- Rust
- Stars
- 3.7k
- Forks
- 312
- Avg merge
- 6d 5h
- Merged PRs (30d)
- 68
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
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NVIDIA/cuda-rust#1568 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: The doc of trait `LoadTileLike` is incorrectPossibly taken @akhil9tiet claimed this 5 days ago. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
NVIDIA/cuda-rust#1523 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Target feature scan splits LLVM IR on ';', so conjunctive predicates match across the whole module (integer redux + any f32 reads as ReduxF32)Possibly taken @vyncint claimed this 32 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA/cuda-rust#1303 · 1 comment ·
Maintainers usually reply within 2 days
All issues in NVIDIA/cuda-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rustls/rustls-platform-verifier#262 · 2 comments · 2 reactions ·
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
bherbruck/solvecraft#4493 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
IngvarConsulting/unica#1911 ·
Maintainers usually reply within 1 day