NVIDIA / NVIDIA/cuda-python

[FEA] cuda.core: green context / device-resource follow-ons (CUDA 13.0-13.3)

Open
#2,366 0 comments 0 reactions 1 assignee View on GitHub

@juenglin is already working on this.

Since Jul 24, 2026.

cuda.core feature
Dominant language
Cython
Stars
3.4k
Forks
329
Avg merge
1d 23h
Merged PRs (30d)
116

Description

Summary

Green-context support in cuda.core (epic #112, closed) predates CUDA 12.8, and
_device_resources.pyx
already covers part of the 13.1 additions (SM-resource split via cuDevSmResourceSplit,
workqueue scope enums, backfill flag). This issue tracks the remaining 13.x deltas.

Underlying C APIs to cover

Symbol Purpose
cuGreenCtxGetId(CUgreenCtx, unsigned long long* greenCtxId) (13.0) stable green-context identifier
CUdevSmResource.minSmPartitionSize / .smCoscheduledAlignment (13.0), .flags (13.1) new SM-resource introspection fields
cuStreamGetDevResource(CUstream, CUdevResource*, CUdevResourceType) (13.1) query resources of the context a stream belongs to
CU_DEV_SM_RESOURCE_SPLIT_{IGNORE_SM_COSCHEDULING,MAX_POTENTIAL_CLUSTER_SIZE} (13.1) split-by-count flags (unexposed; BACKFILL group flag is already used)
CU_DEV_SM_RESOURCE_GROUP_DEFAULT (13.1) group flag
CUdevWorkqueueResource, CUdevWorkqueueConfigResource, CUdevResource.wq/.wqConfig/.nextResource (13.1) workqueue resource structs/fields (the enum members are recognized, the structs are unexposed)
CU_GREEN_CTX_NONE (13.3) green-ctx creation flag
cuCtxGetDevice_v2 / cuCtxSynchronize_v2 (13.0) green-ctx-aware variants — audit which entry points cuda.core should call on 13.x

Design sketch (draft — needs design-meeting review)

[!IMPORTANT]
Starting point only, not a settled design — review in the cuda.core design meeting.

  • GreenContext.id property (cuGreenCtxGetId).
  • Stream.device_resources accessor (cuStreamGetDevResource).
  • Split-by-count keyword flags on the existing split API
    (ignore_sm_coscheduling=, max_potential_cluster_size=).
  • Workqueue resource wrapper types mirroring the existing SM-resource wrappers.
  • Audit task: switch context-query/sync call sites to the _v2 entry points where semantics
    require it on 13.x.

Open questions for the meeting:

  1. How much of the workqueue config (sharingScope, wqConcurrencyLimit, device) to surface.
  2. Whether the new CUdevSmResource fields belong on the existing resource wrapper as plain
    properties (probably yes; mechanical).
  3. Flag defaults and naming for split options.

References

-- Leo's bot

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.