[BUG]: MemcpyNode.update() rejects stream-captured memcpy nodes
还没有人认领这个 Issue。
评估
调研方向
从 cuda_core/cuda/core/graph/_subclasses.pyx 中的 _is_supported_memcpy_descriptor 开始,并复现 GraphBuilder 的流捕获示例。跟踪 MemcpyNode.update() 如何处理 CU_MEMORYTYPE_UNIFIED 描述符。完成的标准是:捕获的一维 memcpy 接受 node.update(size=32) 而不引发 NotImplementedError,并为该复现提供覆盖测试。
由索引模型根据 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
MemcpyNode.update() raises NotImplementedError on every memcpy node produced by stream capture. Buffer.copy_from and Buffer.copy_to lower to cuMemcpyAsync, which the driver records with CU_MEMORYTYPE_UNIFIED on both operands, and _is_supported_memcpy_descriptor in cuda_core/cuda/core/graph/_subclasses.pyx admits only CU_MEMORYTYPE_HOST and CU_MEMORYTYPE_DEVICE. Capturing a GraphBuilder is the primary way to build a graph in cuda.core, so update() is unavailable on most memcpy nodes a user ends up holding.
How to Reproduce
from cuda.core import Device
from cuda.core.graph import MemcpyNode
dev = Device()
dev.set_current()
stream = dev.create_stream()
src = dev.memory_resource.allocate(64, stream=stream)
dst = dev.memory_resource.allocate(64, stream=stream)
stream.sync()
builder = dev.create_graph_builder().begin_building()
dst.copy_from(src, stream=builder)
builder.end_building()
node = next(n for n in builder.graph_definition.nodes() if isinstance(n, MemcpyNode))
node.update(size=32)
Output:
Traceback (most recent call last):
File "<stdin>", line 16, in <module>
File "cuda/core/graph/_subclasses.pyx", line 874, in cuda.core.graph._subclasses.MemcpyNode.update
NotImplementedError: updating multidimensional, pitched, offset, or array-backed memcpy nodes is not supported
Expected behavior
node.update(size=32) should replace the copy size. The descriptor the driver recorded for this node is one-dimensional, unpitched and unoffset, so none of the reasons given in the error apply to it.
Operating System
Ubuntu 26.04 LTS
nvidia-smi output
Sun Aug 16 21:24:13 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.84 Driver Version: 595.84 CUDA Version: 13.2 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3050 ... Off | 00000000:01:00.0 Off | N/A |
| N/A 62C P8 4W / 35W | 66MiB / 4096MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 6822 G /usr/bin/gnome-shell 1MiB |
| 0 N/A N/A 1071386 G /app/libexec/stremio/stremio 1MiB |
+-----------------------------------------------------------------------------------------+
- 主要语言
- Cython
- 星标
- 3.4k
- 派生
- 329
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 117
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/cuda-python 的其他 Issue
-
bug cuda.core
难度 2/5 1-3 小时 新手友好度 76/100
NVIDIA/cuda-python#2886 · 1 条评论 ·
-
triage
难度 1/5 1 小时以内 新手友好度 88/100
NVIDIA/cuda-python#2717 ·
-
triage
难度 1/5 1-3 小时 新手友好度 90/100
NVIDIA/cuda-python#2712 ·
-
triage
难度 2/5 1-3 小时 新手友好度 82/100
NVIDIA/cuda-python#2646 · 1 个 reaction ·
-
cuda.core triage
难度 2/5 1-3 小时 新手友好度 62/100
NVIDIA/cuda-python#2435 · 1 条评论 ·
查看 NVIDIA/cuda-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
pastelsky/bundlephobia#1122 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
CachyOS/distribution#587 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
难度 2/5 1-3 小时 新手友好度 70/100