Nvjpegdec segfaults when using GdkX11

Please provide complete information as applicable to your setup.

When I run this python script, it exits with a “Segmentation fault (core dumped)”. When I remove the GdkX11 import, it works.

import gi

gi.require_version("Gst", "1.0")
gi.require_version("GdkX11", "3.0")
from gi.repository import Gst, GdkX11

Gst.init(None)

nvjpegdec = Gst.ElementFactory.make("nvjpegdec", "nvjpegdec")

Deepstream 7.0
dGPU NVIDIA GeForce RTX 3060
NVIDIA-SMI 560.35.03 Driver Version: 560.35.03 CUDA Version: 12.6
TensorRT v8601

We’ll investigate this issue. Can you tell us why you need to use GdkX11?

I’m not dependent on GdkX11, it was just a way to distill the crash. It segfaults with just Gdk also. I use that get draw on Pixbufs.

import gi

gi.require_version("Gst", "1.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gst, Gdk

Gst.init(None)

nvjpegdec = Gst.ElementFactory.make("nvjpegdec", "nvjpegdec")

OK. There might be some compatibility issues between the libjpeg.so and the libnvdsgst_jpeg.so.
Could you try to set the LD_PRELOAD macro first?

export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_jpeg.so

Setting LD_PRELOAD as suggested solves my trivial example, but when I try it on my real application it just hangs. It doesn’t segfault, but it doesn’t run either.

I do notice that if I just postpone importing Gdk or Gtk until after the nvjpegdec is loaded, it seems to work.

import gi

gi.require_version("Gst", "1.0")
gi.require_version("Gtk", "3.0")
from gi.repository import Gst

Gst.init(None)

Gst.ElementFactory.make("nvjpegdec", "nvjpegdec")

from gi.repository import Gtk

Glad to hear that. Perhaps this order of API calls avoids the lib compatibility issues.