[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 於 63 天前認領。 未關閉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 天內回覆