Nvjpegenc don't release GPU memory when gst element removed from pipeline

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
GPU (NVIDIA GeForce RTX 3060 Laptop GPU)
• DeepStream Version
6.4
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
550.54.15
• Issue Type( questions, new requirements, bugs)
bug
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

The archive contains all required files to reproduce the issue.

nvjpegenc_bug.zip (2.3 KB)

It contains:

  1. Dockerfile that installs python3-gst-1.0 into nvcr.io/nvidia/deepstream:6.4-samples-multiarch.
  2. Python application that repeatedly runs the following pipeline: videotestsrc ! capsfilter ! nvvideoconvert ! nvjpegenc ! fakesink (100 times).
  3. Bash script to build and run the app.

To reproduce the issue run run.sh script in the archive and see GPU memory consumption:

nvjpegenc don’t release GPU memory once a gst-pipeline done working.

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Can you write the app according to the GStreamer rules? https://gstreamer.freedesktop.org/documentation/application-development/basics/helloworld.html?gi-language=c

Even it is a python app, it should follow the GStreamer instructions.

What rule does the app not follows? I’ve rewrote the app with using GLib.MainLoop and Gst.Bus.add_watch, but this doesn’t change the behavior.

nvjpegenc_bug.zip (1.5 KB)

There is GPU memory leak and the virtual memory leak with your script. The leak may be caused by the nvjpegenc library. We will investigate this issue.