Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

cuda-core: distinguish CUDA devices and contexts in the shared host API

Open
#1,504 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
8/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Active
Tech stack
rust
Domain
api, hpc

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 Device and simt::CudaContext users 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/cuda-rust

All issues in NVIDIA/cuda-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.