Robotics

ros2_cuda_ipc enables zero-copy GPU sharing across ROS 2 processes

New ROS 2 library shares GPU memory between processes without CPU roundtrips, using CUDA VMM file descriptors.

Deep Dive

ros2_cuda_ipc is an experimental library introduced by Daisuke_Kato to solve a persistent bottleneck in GPU-accelerated ROS 2 systems: when perception pipelines split preprocessing, DNN inference, visualization, and encoding into separate processes, GPU data typically has to be copied through CPU memory at every boundary. The library enables inter-process GPU memory sharing using CUDA VMM file descriptors, directly mapping GPU buffers across processes without them ever touching host memory. It also provides CUDA event-based stream synchronization and buffer lifetime management to safely coordinate multiple consumers, so that a producer's GPU buffer stays valid while subscribers read it on their own CUDA streams.

The core package is intentionally untyped, with message-specific packages offering typed interpretations like Image and PointCloud2. Both C++ and Python APIs are provided; the Python side uses DLPack-compatible tensors, meaning PyTorch and CuPy can consume the data directly, and TensorRT inference can be integrated via its Python bindings without additional copies. Notably, the project evolved independently from ROS 2 Lyrical's new rosidl::Buffer and CUDA buffer backend, addressing the same problem with a standalone descriptor-based approach. In the comments, users pointed out NVIDIA's similar Nitros framework used in Isaac ROS, which supports non-Nitros nodes via topic type negotiation. The author welcomes feedback on real-world use cases, interoperability, and API design, making this a promising early contribution to zero-copy GPU transport in ROS 2.

Key Points
  • Uses CUDA VMM file descriptors for inter-process GPU memory sharing, avoiding CPU copies entirely.
  • Includes CUDA event-based stream synchronization and buffer lifetime management for multiple consumers.
  • Python DLPack support enables direct integration with PyTorch, CuPy, and TensorRT inference pipelines.

Why It Matters

Zero-copy GPU sharing enables efficient, isolated ROS 2 perception stacks, critical for real-time robotics and autonomous systems.

📬 Get the top 10 AI stories daily