[FEA] cuda.core: green context / device-resource follow-ons (CUDA 13.0-13.3)
Open
@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.idproperty (cuGreenCtxGetId).Stream.device_resourcesaccessor (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
_v2entry points where semantics
require it on 13.x.
Open questions for the meeting:
- How much of the workqueue config (
sharingScope,wqConcurrencyLimit,device) to surface. - Whether the new
CUdevSmResourcefields belong on the existing resource wrapper as plain
properties (probably yes; mechanical). - Flag defaults and naming for split options.
References
- Driver docs: https://docs.nvidia.com/cuda/cuda-driver-api/
- Found during the CUDA 12.8 → 13.3 bindings vs. cuda.core gap sweep (2026-07-14)
-- Leo's bot
Contributor 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.
Assessment
This issue has not been assessed yet.