[BUG]: the `__cuda_stream__` deprecation warning points to `Stream(obj)`, which always raises
维护者通常 1 天内回复
评估
调研方向
issue 指出位置是 _stream.pyx,并说明传入带有 __cuda_stream__ 的对象时,错误警告来自 launch()。阅读警告文本,并将其与复现示例中展示的可正常工作的调用 Device.create_stream(obj) 进行比较。警告提到该受支持的调用后即算完成;issue 将其描述为一行改动。
由索引模型根据 Issue 内容生成。
描述
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Something else
Component
cuda.core
Describe the bug
passing an object with __cuda_stream__ to launch() warns and says to wrap it with Stream(obj). Stream.__init__ always raises though, so following the warning doesn't work, Device.create_stream(obj) is the call that does
How to Reproduce
import numpy as np
from cuda.core import Device, Program, LaunchConfig, Stream, launch
d = Device(); d.set_current(); s = d.create_stream()
ker = Program('extern "C" __global__ void k(int x){}', "c++").compile("cubin").get_kernel("k")
class W:
def __cuda_stream__(self):
return (0, int(s.handle))
launch(W(), LaunchConfig(grid=1, block=1), ker, np.int32(1)) # warning says to use Stream(obj)
d.create_stream(W()) # works
Stream(W()) # RuntimeError: Stream objects cannot be instantiated directly...
Expected behavior
the warning names Device.create_stream(obj). it's a one line change in _stream.pyx, glad to send it if someone assigns this to me
Operating System
Windows 11, RTX 4060 Ti, cuda.core built from main (84e50ca49)
nvidia-smi output
No response
- 主要语言
- Cython
- 星标
- 3.4k
- 派生
- 353
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 163
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/cuda-python 的其他 Issue
-
[BUG]: ProcessInfo.used_gpu_memory returns the NVML_VALUE_NOT_AVAILABLE sentinel as a byte count未关闭triage
难度 2/5 1-3 小时 新手友好度 80/100
NVIDIA/cuda-python#3468 · 3 条评论 ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 68/100
NVIDIA/cuda-python#3409 ·
维护者通常 1 天内回复
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRs可能重新可做 @rwgk 于 48 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
NVIDIA/cuda-python#2952 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookup可能已有人在做 @rwgk 于 62 天前认领。 未关闭triage
难度 2/5 1-3 小时 新手友好度 82/100
NVIDIA/cuda-python#2646 · 1 个 reaction ·
维护者通常 1 天内回复
-
documentation
难度 4/5 3-5 天 新手友好度 35/100
NVIDIA/cuda-python#3617 ·
维护者通常 1 天内回复
查看 NVIDIA/cuda-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
vllm-project/vllm#70030 ·
维护者通常 1 天内回复
-
help wanted small extra
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
t: bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
Retry an empty final answer when Gemini reports MALFORMED_RESPONSE (gemini-4-hydrogen)可能已有人在做 @waleedkadous 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复