[BUG]: `launch()` rejects `numpy.intc` scalars on Windows
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with cuda.core's _kernel_arg_handler.pyx, where the issue says NumPy scalar classes are matched. Reproduce the unsupported-type error using the provided np.intc(5) launch example on Windows with NumPy 2, then compare its handling with np.int32(5) and check the corresponding tests. Done means the accepted scalar reaches the kernel as 5, with coverage for the reported platform and related integer types.
由索引模型根据 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
Runtime Error
Component
cuda.core
Describe the bug
on windows with numpy 2, np.int32 is np.long, so np.intc ends up as its own class and launch() doesn't recognize it, _kernel_arg_handler.pyx only matches the fixed-width numpy classes. the same should happen with np.longlong on linux
How to Reproduce
import numpy as np
from cuda.core import Device, Program, LaunchConfig, launch
d = Device(); d.set_current(); s = d.create_stream()
src = 'extern "C" __global__ void k(int x, int* out){ *out = x; }'
ker = Program(src, "c++").compile("cubin").get_kernel("k")
out = d.allocate(4, stream=s)
launch(s, LaunchConfig(grid=1, block=1), ker, np.intc(5), out)
# TypeError: the argument is of unsupported type: <class 'numpy.intc'>
Expected behavior
same as np.int32(5), the kernel gets 5. I can put up a fix that falls back to the itemsize for np.signedinteger/np.unsignedinteger if you'd like
Operating System
Windows 11, RTX 4060 Ti, driver 610.88, cuda.core built from main (84e50ca49), numpy 2.5.5
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]: the `__cuda_stream__` deprecation warning points to `Stream(obj)`, which always raises可能已有人在做 @Iamsohungrynow 于 5 天前认领。 未关闭bug cuda.core P1
难度 1/5 1 小时以内 新手友好度 86/100
NVIDIA/cuda-python#3505 · 3 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
[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 天内回复
查看 NVIDIA/cuda-python 的全部 Issue
相似的 Issue
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
dsx-ai-factory/health-validation#368 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 83/100
Tripstack-Corp/spyc#1352 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
vllm-project/vllm#70030 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
help wanted small extra
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复