Repository navigation
[BUG]: MemcpyNode.update() rejects stream-captured memcpy nodes #2649
Description
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 |
+-----------------------------------------------------------------------------------------+
Activity
mdboom commentedon Aug 20, 2026
Cc: @Andy-Jost for viz.
atiaomar1978-hub commentedon Aug 20, 2026
Cc: @Andy-Jost @mdboom
RunPod verification (RTX 4090, driver 560.35, cuda.core main + CUDA 13.3)
I reproduced this on GPU and traced the failure to
_is_supported_memcpy_descriptor()rejecting driver-recorded UNIFIED memory types — not to anything multidimensional/pitched about the copy itself.What the driver actually records
After
GraphBuilderstream capture ofdst.copy_from(src, stream=builder):srcMemoryTypeCU_MEMORYTYPE_UNIFIED(4)dstMemoryTypeCU_MEMORYTYPE_UNIFIED(4)WidthInBytesHeight/DepthBy contrast, a manually built
GraphDefinition().memcpy(dst, src, 64)node getsCU_MEMORYTYPE_DEVICEon both sides — andMemcpyNode.update(size=32)succeeds there.So the error message is misleading for the common capture path: none of the pitched/offset/array conditions apply; the descriptor is a plain 1D device copy, just tagged UNIFIED because
Buffer.copy_fromlowers tocuMemcpyAsyncunder unified addressing.Driver accepts UNIFIED updates
Bypassing cuda.core and calling
cuGraphMemcpyNodeSetParamson the captured node (keeping UNIFIED types, changingWidthInBytes64→32) succeeds, and the instantiated graph copies exactly 32 bytes on launch. The limitation is purely in cuda.core's guard, not the driver API.Suggested fix
1.
_is_supported_memcpy_descriptor()(cuda_core/cuda/core/graph/_subclasses.pyx~237): allowCU_MEMORYTYPE_UNIFIEDalongside HOST and DEVICE when all the existing 1D/unpitched checks pass:2.
MemcpyNode.update()pointer extraction (~878–895): treat UNIFIED like DEVICE (CUDA docs: usesrcDevice/dstDevicefor UNIFIED):3. Tests: add a GPU test that captures
Buffer.copy_fromviaGraphBuilder, then callsMemcpyNode.update(size=…)— mirroring the issue repro. Optionally assert_create_from_driver/__repr__still show sensible(D)labels for UNIFIED device pointers.This is a small, behavior-safe change: the same checks that reject truly multidimensional/pitched/offset copies still apply; only the memory-type filter was too narrow for stream-captured nodes.
Probe
Run on any CUDA GPU host with
cuda.corebuilt from main (CUDA 12.2+ for graph node updates):RunPod wrapper (creates pod, builds cuda.core from main + mini CUDA 13.3 CTK, runs probe):
scripts/issue2649-memcpy-node-probe.py(full probe script)RunPod probe log (2026-08-20T17:40:09Z, RTX 4090, driver 560.35.03)
issue2649-memcpy-node-probe.json(full probe report — attached){ "issue": "NVIDIA/cuda-python#2649", "timestamp_utc": "2026-08-20T17:40:09.426004+00:00", "bindings_version": "13.3.1", "cuda_core_version": "0.0.0", "tests": { "stream_capture": { "node_repr": "<MemcpyNode handle=0x379d570 dst=0x302000200(D) src=0x302000000(D) size=64>", "descriptor": { "srcMemoryType": "CU_MEMORYTYPE_UNIFIED", "srcMemoryType_raw": 4, "dstMemoryType": "CU_MEMORYTYPE_UNIFIED", "dstMemoryType_raw": 4, "srcDevice": 12918456320, "dstDevice": 12918456832, "srcHost": 0, "dstHost": 0, "WidthInBytes": 64, "Height": 1, "Depth": 1, "srcPitch": 0, "dstPitch": 0, "srcHeight": 0, "dstHeight": 0, "srcXInBytes": 0, "dstXInBytes": 0, "srcY": 0, "dstY": 0, "srcZ": 0, "dstZ": 0, "srcLOD": 0, "dstLOD": 0 }, "is_supported_current": false, "is_supported_proposed": true, "update_result": "NotImplementedError", "update_error": "updating multidimensional, pitched, offset, or array-backed memcpy nodes is not supported" }, "manual_graph_definition": { "node_repr": "<MemcpyNode handle=0x379ea40 dst=0x302000600(D) src=0x302000400(D) size=32>", "descriptor": { "srcMemoryType": "CU_MEMORYTYPE_DEVICE", "srcMemoryType_raw": 2, "dstMemoryType": "CU_MEMORYTYPE_DEVICE", "dstMemoryType_raw": 2, "srcDevice": 12918457344, "dstDevice": 12918457856, "srcHost": 0, "dstHost": 0, "WidthInBytes": 64, "Height": 1, "Depth": 1, "srcPitch": 0, "dstPitch": 0, "srcHeight": 0, "dstHeight": 0, "srcXInBytes": 0, "dstXInBytes": 0, "srcY": 0, "dstY": 0, "srcZ": 0, "dstZ": 0, "srcLOD": 0, "dstLOD": 0 }, "is_supported_current": true, "update_result": "success" }, "driver_bypass": { "cuGraphMemcpyNodeSetParams_ok": true, "graph_launch_ok": true, "dst_first_32_bytes": [ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90 ], "dst_tail_bytes": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "error": null } }, "verdict": { "bug_confirmed": true, "root_cause": "_is_supported_memcpy_descriptor rejects CU_MEMORYTYPE_UNIFIED", "driver_accepts_unified_update": true, "proposed_fix_viable": true } }cuda.core: accept stream-captured memcpy nodes in MemcpyNode.update (N…