NvBuffer Transform much slower than OpenCV GPU

I use transform to scale my NvBuffer from 960x540 to 3840x2160. This takes 11ms with NvBuffer, but only 2ms with OpenCV. How come that NvBufferTransform is so slow? On which engine is it run?

Best regards,

Sorry I no longer have an NX for trying, but using AGX Xavier running L4T R32.6.1 with NVP model MAXN and clocks boosted with jetson_clocks, it seems it takes not more than 3ms (360 fps): Using gstreamer, you may refer to nvvidconv public sources for NvTransform usage.

gst-launch-1.0 videotestsrc ! video/x-raw,format=I420,width=320,height=240,framerate=360/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=3840,height=2160' ! nvvidconv ! fpsdisplaysink text-overlay=0 video-sink=fakesink -v

(here using videotestsrc with low resolution because this plugin is CPU-based)

However, it is true that copying from NVMM memory to system (CPU) memory does slows it donw to 80 fps that better matches what you are seeing:

gst-launch-1.0 videotestsrc ! video/x-raw,format=I420,width=320,height=240,framerate=360/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=3840,height=2160' ! nvvidconv ! video/x-raw ! fpsdisplaysink text-overlay=0 video-sink=fakesink -v

I might not further help, but I’d suggest you try to better explain how you are doing measurement, if you are trying to display opencv frame, if yes with what backend (OpenGL, with GTK2 or QT…) and monitor refresh rate if any.

Hey, thanks for the fast response. Since NvBufferTransform and OpenCV CUDA are both synced with CPU when not using streams I just measure the time before and after and calculate the difference.

Running on Xavier NX MAXN and Jetson clocks on.
Format is pitch linear rgba8 buffer format input and output.

Best regards,

The execution is on hardware converter and for having optimal throughput, please run it at max clock:
Nvvideoconvert issue, nvvideoconvert in DS4 is better than Ds5? - #3 by DaneLLL

This shall bring NvBufferTransform()/NvBufferComposite() in maxumum throughput. Besides, if you have multiple threads calling NvBufferTransform(), please create NvBufferSession

Are the described settings permanent or are they reset after boot?

It is reset after rebooting the device. For having permanent setting, please refer to this post:
Camera's frame rate unstable - #24 by DaneLLL

Sorry, I don’t see it directly.
How do I have to modify your linked file to set static max_freq?


Please set the device nodes in nv.sh like:

echo on > "/sys/devices/13e10000.host1x/15340000.vic/power/control"

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