DeepStream and VPI with Python on Jetson

• Hardware Platform (Jetson Orin NX)
• DeepStream Version 6.3
• JetPack Version 5.1.2 [L4T 35.4.1]

• Issue Type(questions, bugs)
I am trying to utilize VPI for efficient image operations within a DeepStream pipeline using Python. However, there are very limited resources available on how to achieve this.

On dGPU, I successfully followed the Python app example and used pyds.get_nvds_buf_surface_gpu to convert the buffer into a CuPy array and then into a VPI Image.

However, on Jetson devices, the pyds.get_nvds_buf_surface_gpu function is unavailable. Based on a forum post, I learned that:

On Tegra, you need to chain NvBufSurfaceMapEglImage and cuGraphicsResourceGetMappedEglFrame.

To address this, I attempted to replicate the C code in Python, referencing Paul Bridger’s post to work with the NvBufSurface C struct in Python. The overall process I implemented was: GStreamer buffer → CUDA EGL frame → CuPy array → VPI Image.

While I was able to obtain the VPI Image, I encountered an issue where calling cudart.cudaGraphicsUnregisterResource(graphics_resources) resulted in a cudaErrorIllegalAddress error after the pipeline ran for some time.

I would like to ask:

  1. Are there any examples of using VPI with Python on Jetson devices?
  2. How can I resolve the illegal memory access error?

• How to reproduce the issue?
Please refer to this Github repository. app.py is a modified version of deepstream_imagedata-multistream_cupy.py of deepstream_python_appsv1.1.8.

Thank you for your assistance!

Currently no.

Seems you need to consult with the VPI python API expert. Please raise topic in Latest Jetson & Embedded Systems/Jetson Orin NX topics - NVIDIA Developer Forums

Thank you @Fiona.Chen.
It will be great if there are more examples of using VPI with DeepStream in Python.
Anyway, I will raise the topic in the forum you mentioned.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.