Measure DMA buffer data rates

Board: Nvidia Jetson Xavier NX
L4T version: 32.5.1

I would like to measure the bitrate of the transfer between ram and the hardware DMA buffer.

If I understand correctly, the following pipeline :

nvarguscamerasrc ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! 'video/x-raw,format=NV12'  ! fakesink

Will copy the data from the DMA buffer to RAM, please confirm that it is correct.

We are encountering some difficulties with a GStreamer pipeline and we believe that we might reach the limit bandwidth of the DMA Buf - RAM transfer.

I would like to measure this transfer, from RAM to DMA buffer and other way around.
How to do that ?

Thanks!

Hi,
Yes, the frame data is copied from DMA buffer(NVMM buffer) to CPU buffer. For further information, you can download the source code and check:

L4T R32.5.1 Release Page | NVIDIA Developer
L4T Driver Package (BSP) Sources

Hey ! @DaneLLL thanks for your answer .
I am only trying to measure the data rate between DMA buf and RAM. How to do that ?

Hi,
You may check which function call yo would like to profile. And add
gettimeofday(2) - Linux manual page

before and after the function call. To get how much time is used in the function.

@DaneLLL thanks for your answer.

I didnt write any code, I am simply using available elements, e.g.

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),format=NV12' ! \
               nvvidconv ! 'video/x-raw,format=NV12'  ! 
               nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12'  ! 
               fakesink

To do the following copies: DMA Buf → CPU Buf → DMA Buf

I want to measure those transfers and figure out the upper limit, hopefully with some lower level measurement ?

Hi,
There is no existing code for the profiling, so you would need to add it to source code of nvvidconv plugin and rebuild it.

@DaneLLL thanks for your answer.

Is there any debug tool that would allow me to get the value for the whole board ? Maybe some kernel debug endpoints or something ?

Hi,
For profiling the plugin, you would need to add debug prints manually. For profiling overall system status, you can run sudo tegrastats.

@DaneLLL thanks for your answer.

Tegrastats gives the following output, but the data rate between DMA buf and CPU buff is not in it :

RAM 830/7774MB (lfb 1547x4MB) SWAP 0/3887MB (cached 0MB) CPU [36%@1420,30%@1420,35%@1420,34%@1420,52%@1420,44%@1420] EMC_FREQ 3%@1600 GR3D_FREQ 0%@114 VIC_FREQ 0%@115 APE 150 MTS fg 1% bg 13% AO@58.5C GPU@59C PMIC@100C AUX@57.5C CPU@61.5C thermal@59C VDD_IN 4592/4592 VDD_CPU_GPU_CV 1797/1797 VDD_SOC 1277/1277

Hi,
The loading on the CPU cores indicates the memory copy.

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