It seems that you try to wrap the cupy array into a VPI image.
Could you help to verify if “GStreamer buffer → CUDA EGL frame → CuPy array” can work?
If the cudart.cudaGraphicsUnregisterResource(graphics_resources) can work correctly if not wrapped into VPI?
For CuPy ↔ VPI, please find the below topic for more info: