There are lots of customized code, we don’t know what happened. So we don’t know whether your code is “zero-copy GPU access”. But the pipeline nvv4l2camerasrc device=/dev/video0 name=mysource ! video/x-raw(memory:NVMM), width=1920, height=1020, framerate=30/1 ! nvvidconv ! video/x-raw(memory:NVMM), format=RGBA ! tee name=t t. ! queue leaky=2 max-size-buffers=10 ! nvvidconv name=myconv ! video/x-raw(memory:NVMM),format=RGBA ! appsink name=sink emit-signals=true max-buffers=1 drop=true itself is “zero-copy GPU access”.
From your code there is no CPU access until
You’ve already got the CUDA array in “eglFrame”. CUDA Driver API :: CUDA Toolkit Documentation. All you succeeded operations should be CUDA operation on the “pArray” in “eglFrame”. Then you can guarantee there is only GPU envolved.
We don’t know what happened in your “ctx->inference->undistort”, “ctx->inference->runInference”,… You need to check by yourself.
If your code “ctx->inference->runInference” is for inferencing, we suggest you to deploy your inferencing model directly with DeepStream APIs.
Please make sure your model is ONNX model and you know well about your model’s input and output. Then you can follow the instructions DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums to prepare the nvinfer parameters. There are lots of ONNX model deployment samples in DeepStream SDK, please refer to C/C++ Sample Apps Source Details — DeepStream documentation and NVIDIA-AI-IOT/deepstream_reference_apps: Samples for TensorRT/Deepstream for Tesla & Jetson