[BUG]: SMResource.split() dry_run=True fails with cuDevSmResourceSplit when smCount is non-zero

未关闭
#2,765 0 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

@leofang 已经在做这个了。

开始于 2026年9月8日。

评估

这个 Issue 还没有评估数据。

描述

bug

[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_apicuDevSmResourceSplit(result=NULL, smCount=[112,16]) → exception swallowed by except Exception: return False → all split candidates return False_find_working_split returns Nonesys.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 天 21 小时
30 天内合并 PR
113

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/cuda-python 的其他 Issue

查看 NVIDIA/cuda-python 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。