Gstreamer Pipeline issue : PosixMemMap:84 mmap failed V2

Hello,
I’m sorry for bringing this topic again (Gstreamer Pipeline issue : PosixMemMap:84 mmap failed) but because I didn’t reply faster it got closed. However, my problem is not really solved. I have tried to do both a gst-launch pipeline and a python pipeline. The one that I launch through the command line works without limit but the one that I launch through python crashes after 1h30 minutes.
Here is the github link to my example with a gst-launch pipeline and a python code so that you can try also.
GitHub - EmilienRNN/pipeline
Sorry again for opening a new topic that is directly linked to another one.

Hi,
Have you tried the case to replace v4l2src with videotestsrc is-live=1? The issue looks to be in stability of camera sources. Not an issue in Deepstream plugins. Would suggest try other sources(such as videotestsrc, or rtspsrc) to clarify this first.

Hello,
I have tried with videotestsrc with gst-launch command and it works. I have done tests on my own also and those tests worked even after 24h :
test 1 : 4 independent pipelines at the same time :
gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 nvstreammux name=m batch-size=2 width=960 height=544 batched-push-timeout=33333 sync_inputs=1 live-source=1 ! nvinfer config-file-path=/home/nvidia/Innovia-V3.1/Innovia_V2/models/config_file/config_peoplenet_large.txt ! nvmultistreamtiler width=960 height=544 ! nvvideoconvert ! nvdsosd ! nv3dsink sync=false

gst-launch-1.0 v4l2src device=/dev/video1 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 nvstreammux name=m batch-size=2 width=960 height=544 batched-push-timeout=33333 sync_inputs=1 live-source=1 ! nvinfer config-file-path=/home/nvidia/Innovia-V3.1/Innovia_V2/models/config_file/config_peoplenet_large.txt ! nvmultistreamtiler width=960 height=544 ! nvvideoconvert ! nvdsosd ! nv3dsink sync=false

gst-launch-1.0 v4l2src device=/dev/video2 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 nvstreammux name=m batch-size=2 width=960 height=544 batched-push-timeout=33333 sync_inputs=1 live-source=1 ! nvinfer config-file-path=/home/nvidia/Innovia-V3.1/Innovia_V2/models/config_file/config_peoplenet_large.txt ! nvmultistreamtiler width=960 height=544 ! nvvideoconvert ! nvdsosd ! nv3dsink sync=false

gst-launch-1.0 v4l2src device=/dev/video3 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 nvstreammux name=m batch-size=2 width=960 height=544 batched-push-timeout=33333 sync_inputs=1 live-source=1 ! nvinfer config-file-path=/home/nvidia/Innovia-V3.1/Innovia_V2/models/config_file/config_peoplenet_large.txt ! nvmultistreamtiler width=960 height=544 ! nvvideoconvert ! nvdsosd ! nv3dsink sync=false

test 2 : One pipeline
gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 v4l2src device=/dev/video1 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_1 v4l2src device=/dev/video2 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_2 v4l2src device=/dev/video3 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_3 nvstreammux name=m batch-size=2 width=960 height=544 batched-push-timeout=33333 sync_inputs=1 live-source=1 ! nvinfer config-file-path=/home/nvidia/Innovia-V3.1/Innovia_V2/models/config_file/config_peoplenet_large.txt ! nvmultistreamtiler width=960 height=544 ! nvvideoconvert ! nvdsosd ! nv3dsink sync=false

Hello,
Maybe I was not clear enough. Those gstreamer pipelines work but not through the deepstream python librairy, it is why I have provided to you a github link with an implementation of the pipeline.
I would be grateful if you can have en eye on this code and test it on your side.

Hi,
Gstreamer Pipeline issue : PosixMemMap:84 mmap failed - #11 by DaneLLL

Do you mean if you run above command with your cameras, it can pass long run? We run it over weekend and there’s no issue.

Hi,
Those commands above run without problems through the terminal. When I launch them through Deepstream python library (code provided on my GitHub), I have the problem that appears after 1h30min.

Hi,
If gst-launch-1.0 command works and it is specific to python app, it may be an issue in python binding. Since it is open source, please download the source code:

deepstream_python_apps/bindings at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub

And follow the guidance to build it with debug prints to check further.

And for comparison, please try to use videotestsrc in:

pipeline/camera.py at main · EmilienRNN/pipeline · GitHub

and see if the issue occurs. To try python app with videotestsrc

Hello,
Is it possible that you try to run my python code to see if you have the same problem as me ?

Hi,
We are not able to run the script since our USB cameras are not identical. The supported formats are different. So would need your help to test with videotestsrc. If it is something wrong in python binding, we should also observe it while using videotestsrc

Hello,

I have tried replacing v4l2src by videotestsrc and it crashed after 1h11min using the python script that I have provided. It crashed with the same error.

Hi,
Please modify the sample to use videotestsrc so that we can try. And do you use 5.1.3? We have 6.0GA release and would suggest upgrade to the version and try.

Hello,
I have modified the sample. I’m using 5.1.2. I don’t know if you are able to test it on both versions ? To be honest, I can not really upgrade the version that quickly those days. (If you can not it is okay, just precise me on which version you try it)
I really thank you for the help that you provide to me.
Have a great day.

Hi,
Since python binding is open source, would suggest take a look at the source code to do further investigation. You can see the source code in

deepstream_python_apps/bindings at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub

And we hit the error while running the sample:

$ python3 main.py
main.py:5: PyGIWarning: Gst was imported without specifying a version first. Use
 gi.require_version('Gst', '1.0') before import to ensure that the right version
 gets loaded.
  from gi.repository import GLib, Gst, GObject, GstVideo
Traceback (most recent call last):
  File "main.py", line 7, in <module>
    from gst_pipeline import gst_body
  File "/home/nvidia/pipeline/gst_pipeline.py", line 3, in <module>
    from camera import *
  File "/home/nvidia/pipeline/camera.py", line 3, in <module>
    from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget,QPushButton,Q
Label,QSlider,QStackedLayout,QStackedWidget
ModuleNotFoundError: No module named 'PyQt5'

Please eliminate QT and give it a try. It may be a memory leak in QT.

Hello, Thanks for your reply.

I have deleted all PyQT librairies and updated on github. Please, can you try again without PyQT ?
I wish you a great day.

Hi,
Please eliminate QT and check if the issue still occurs. We have checked python binding of DeepStream and don’t see suspicious leak. The leak may be from somewhere. Would suggest eliminate QT and test.

Hi,
I have eliminated QT tools and tried again and it crashed again as always.

Hi,
It should be an issue in on_click_cam_1/2/3/4. It is not supported to dynamically link/unlink the element. For changing the linkage, you would need to re-initialize the whole pipeline.

Hi,
The issue appear also without using this function.

Hi,
The leak should be in the application code. We would suggest

  1. Remove the unlink/link code and link only once while initializing the pipeline. Not to unlink/link dynamically
  2. Use nvmultistreamtiler to composite the sources into single video plane for rendering

Hi,

I don’t really want to display all at once. Display one and choosing another one when the user wants it’s better for our use case