PyMUTEX_LOCK(gil->switch_mutex) in DeepStream SDK

Updating the architecture of an application from deepstream 6.3 to 7.0, I encounter the following problem

Error message:

(python3:1933): GStreamer-WARNING **: 12:37:25.558: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though.

(python3:1933): GStreamer-WARNING **: 12:37:25.558: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so’: librivermax.so.1: cannot open shared object file: No such file or directory
Fatal Python error: take_gil: PyMUTEX_LOCK(gil->switch_mutex) failed
Python runtime state: initialized

Thread 0x00007f19a78b1640 (most recent call first):
File “/usr/lib/python3.10/threading.py”, line 320 in wait
File “/usr/lib/python3.10/queue.py”, line 171 in get
File “/usr/local/lib/python3.10/dist-packages/watchdog/observers/api.py”, line 391 in dispatch_events
File “/usr/local/lib/python3.10/dist-packages/watchdog/observers/api.py”, line 223 in run
File “/usr/lib/python3.10/threading.py”, line 1016 in _bootstrap_inner
File “/usr/lib/python3.10/threading.py”, line 973 in _bootstrap

Thread 0x00007f19ab8b2640 (most recent call first):
File “/usr/lib/python3.10/threading.py”, line 324 in wait
File “/usr/lib/python3.10/threading.py”, line 607 in wait
File “/usr/local/lib/python3.10/dist-packages/watchdog/observers/polling.py”, line 83 in queue_events
File “/usr/local/lib/python3.10/dist-packages/watchdog/observers/api.py”, line 166 in run
File “/usr/lib/python3.10/threading.py”, line 1016 in _bootstrap_inner
File “/usr/lib/python3.10/threading.py”, line 973 in _bootstrap

Thread 0x00007f19b5c73480 (most recent call first):
File “/usr/lib/python3/dist-packages/gi/overrides/Gst.py”, line 261 in make
File “/app/deepstream_base.py”, line 160 in pipeline_init
File “/app/deepstream_base.py”, line 97 in init
File “/app/run.py”, line 1522 in main
File “/app/run.py”, line 1534 in

Extension modules: gi._gi, cairo._cairo, gi._gi_cairo, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, gi.overrides._gi_gst, yaml._yaml, grpc._cython.cygrpc, google.protobuf.pyext._message, rapidjson, charset_normalizer.md, requests.packages.charset_normalizer.md, requests.packages.chardet.md, shapely.lib, shapely._geos, shapely._geometry_helpers, PIL._imaging (total: 28)
Aborted (core dumped)

Part of the code that causes the error

def pipeline_init(self) -> None:
        """Initializes pipeline with the initial data from the application config file"""
        # Create mux
        self.streammux = Gst.ElementFactory.make("nvstreammux", "mux"); assert self.streammux
        self.streammux.set_property("batch-size", self.cfg["streammux"]["max-batch-size"])  
        if USE_NEW_NVSTREAMMUX:
            self.streammux.set_property("config-file-path", self.cfg["streammux"]["config-file-path"])
        else:
            self.streammux.set_property("width", self.cfg["streammux"]["width"])
            self.streammux.set_property("height", self.cfg["streammux"]["height"])
            self.streammux.set_property("batched-push-timeout", self.cfg["streammux"]["batched-push-timeout"])

        # Adding eosmonitor probe to streammux
        streammuxPad = self.streammux.get_static_pad("src"); assert streammuxPad
        streammuxPad.add_probe(Gst.PadProbeType.EVENT_DOWNSTREAM,
                                self.nvstreammux_eosmonitor_probe_func, None)
        streammuxPad.add_probe(Gst.PadProbeType.BUFFER, self.streammux_src_monitor_probe_func)

Hardware Platform (Jetson / GPU)? GPU
DeepStream Version? 7.0
TensorRT Version? 8.6
NVIDIA GPU Driver Version ? 510.73.08
Issue Type? Bug

I’ve already tried removing the gstreamer cache with: rm ${HOME}/.cache/gstreamer-1.0/*, but without success

  1. The driver version required by DS-7.0 is 535.161.08, you need to upgrade the driver

2.It seems that there is a problem with pyds. What is your OS version? DS-7.0 need ubuntu 22.04.

How did you install pyds? Please refer to the method in README to compile and install.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

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