Zero copy using CUDA allocated memory on Jetson TX2
itaidagan
itai at joymo.no
Thu Dec 12 14:57:26 UTC 2019
Hello everyone,
I'm currently working on a plugin derived from VideoFlip that takes a frame,
copies the contents of the regular Mat to a GpuMat (using "upload"),
performs a cv::cuda::remap function and then copies the remapped GpuMat back
to the buffer frame (using "download").
I'd like to accelerate this process by avoiding the unnecessary copies. Is
there a way to tell gstreamer to allocate buffers using cudaMalloc in a way
that will allow me to implement this pipeline without any unnecessary
copies?
Here's the relevant code:
// Upload Mat to GpuMat
jmundistort->frame_gpu_mat.upload(jmundistort->frame_mat);
// Remap
cuda::remap(
jmundistort->frame_gpu_mat,
jmundistort->undistorted_frame_gpu_mat,
jmundistort->dist_params.map1_gpu,
jmundistort->dist_params.map2_gpu,
INTER_CUBIC);
// Download
jmundistort->undistorted_frame_gpu_mat.download(jmundistort->frame_mat);
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list