[BUG]: SMResource.split() dry_run=True fails with cuDevSmResourceSplit when smCount is non-zero
維護者通常 1 天內回覆
@leofang 已經在處理了。
開始於 2026年9月8日。
評估
這個 Issue 還沒有評估資料。
描述
[BUG]: SMResource.split() dry_run=True fails with cuDevSmResourceSplit when smCount is non-zero
Type of Bug
Runtime Error
Component
cuda.core
Describe the bug
SMResource.split(..., dry_run=True) always raises an exception on devices using the general cuDevSmResourceSplit API path (CUDA 13.x, _can_use_structured_sm_split()=True), silently causing the greenContext sample to fail.
Root cause: _split_with_general_api passes result=NULL to cuDevSmResourceSplit while groupParams[i].smCount is non-zero. Per the CUDA driver API docs, result=NULL is only valid in discovery mode (smCount=0). Passing result=NULL with non-zero smCount causes the driver to return CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION.
How to Reproduce
Found while running the new cuda_core example samples against the CI GPU pool in PR #2266 - Migrating cuda-python samples from cuda-samples.
CI failure on H100 NVL (132 SMs, sm_90, CUDA 13.3):
[Green Context Sample using CUDA Core API]
Device: NVIDIA H100 NVL
Compute Capability: sm_90
Total SMs: 132
Min. SM partition size: 8
SM co-scheduled alignment: 8
Error: could not find an SM split that the driver accepts on this device (total SMs=132, min_partition_size=8).
The driver enforces architecture-specific alignment rules beyond min_partition_size; try passing an explicit --split.
Internally, _driver_accepts_split calls sm.split(SMResourceOptions(count=(112, 16)), dry_run=True), which hits _split_with_general_api → cuDevSmResourceSplit(result=NULL, smCount=[112,16]) → exception swallowed by except Exception: return False → all split candidates return False → _find_working_split returns None → sys.exit(1).
System information
- GPU: NVIDIA H100 NVL, sm_90, 132 SMs
- CUDA: 13.3.0 (local)
- Driver: 596.36 (kernel-mode)
- Python: 3.14t (free-threaded)
- 主要語言
- Cython
- 星號
- 3.4k
- 分支
- 329
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 112
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NVIDIA/cuda-python 的其他 Issue
-
triage
難度 2/5 1-3 小時 新手友好度 84/100
NVIDIA/cuda-python#2952 ·
維護者通常 1 天內回覆
-
bug cuda.core
難度 2/5 1-3 小時 新手友好度 76/100
NVIDIA/cuda-python#2886 · 1 則留言 ·
維護者通常 1 天內回覆
-
[DOC]: cuda.core 1.1.1 note misstates program cache permissions可能已有人在做 @leofang 於 3 天前認領。 未關閉documentation P1
難度 1/5 1 小時以內 新手友好度 88/100
NVIDIA/cuda-python#2717 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
[DOC]: `PinnedMemoryResource.allocate` documents no parameters可能已有人在做 @Andy-Jost 於 3 天前認領。 未關閉cuda.core documentation P1
難度 1/5 1-3 小時 新手友好度 90/100
NVIDIA/cuda-python#2712 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
triage
難度 2/5 1-3 小時 新手友好度 82/100
NVIDIA/cuda-python#2646 · 1 個 reaction ·
維護者通常 1 天內回覆