High memory usage of nvarguscamerasrc

Today we use the nvarguscamerasrc to interact with the two 4K IMX334 camera modules. We capture the video in NV12-format with a framerate of 30/1.

An example of a test pipeline could look like this:

gst-launch-1.0 \
       nvarguscamerasrc sensor-id=1 sensor-mode=1 silent=true ee-mode=0 \
           ! "video/x-raw(memory:NVMM),format=NV12,width=3840,height=2160,framerate=30/1" \
           ! queue max-size-buffers=1 max-size-time=0 max-size-bytes=0 \
           ! fakesink async=false \
       nvarguscamerasrc sensor-id=0 sensor-mode=1 silent=true ee-mode=0 \
           ! "video/x-raw(memory:NVMM),format=NV12,width=3840,height=2160,framerate=30/1" \
           ! queue max-size-buffers=1 max-size-time=0 max-size-bytes=0 \
           ! fakesink async=false

When running this pipeline, the memory usage is approx. 1.1 GB when running tegrastats, which I think sounds like a bit much.

Memory usage of the clients:

cat /sys/kernel/debug/nvmap/iovmm/clients 
CLIENT                        PROCESS      PID        SIZE
user                   gst-launch-1.0    20926     263508K
user                   nvargus-daemon     7982     524480K
total                                              787988K

Do you have any idea why it requires this high memory usage or if there is a way to reduce it?

hello alex51,

could you please try running below commands to disable desktop GUI for memory usage evaluation.
for example,
$ sudo systemctl stop gdm
$ sudo loginctl terminate-seat seat0

Hi,
The usage in nvargus-daemon is fixed. It is for ISP pipelines and we have SQA team test the functions. It may not be possible for further reduction since it may harm stability.

In nvarguscamera plugin, you may try to reduce buffer number. The default setting is

#define MIN_BUFFERS 6
#define MAX_BUFFERS 8

You may set to

#define MIN_BUFFERS 4
#define MAX_BUFFERS 4

And give it a try.

Besides, there is memory used in gstreamer frameworks. You may consider use jetson_multimedia_api to eliminate this. The samples are in

/usr/src/jetson_multimedia_api/argus/
/usr/src/jetson_multimedia_api/samples/09_argus_camera_jpeg/
/usr/src/jetson_multimedia_api/samples/10_argus_camera_recording/
/usr/src/jetson_multimedia_api/samples/13_argus_multi_camera/

Thanks for the reply.

We are using Yocto and have already all display/GUI services disabled.

I already tried lowering the min/max buffers, but that only gave me a reduction of approx.100 MB.

Unfortunately, GStreamer is a requirement for our side, since it is used as the core in all our video pipelines.

Would you be able to look into the ISP pipelines for further reduction of memory?

Hi,
The memory usage is related to resolution. For 720p or 1080p, there is less memory usage. Since your use-case is 2 sources in 4K, there may not be room for further improvement.

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