• 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
andcuGraphicsResourceGetMappedEglFrame
.
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:
- Are there any examples of using VPI with Python on Jetson devices?
- 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!