Segfault at nvds_destroy_batch_meta with non-image input layer model

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson Orin AGX
• DeepStream Version 7.1
• JetPack Version (valid for Jetson only) 6.2
• TensorRT Version 10.3.0
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• 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)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Hi,
I have a pipeline like Face Detect (PGIE) → Face Recognition → Face Swap
|
→ Yolov8 (Full frame input from PGIE) → Person Attribute

This pipeline was earlier running with 7.0 and now I have transitioned to 7.1. If I disable the Face Swap model then the pipeline runs properly, however with Face swap the pipeline crashes as soon as I run it. The face swap model has two input layers one as image and other is a non image input layer. I have used gdb and collected backtrace as below.

App Crash Output

./deepstream-app/deepstream-app -c file_rtsp_config.txt --gst-plugin-path=deepstream/sources/gst-plugins/ 

(deepstream-app:17901): GLib-GObject-WARNING **: 15:28:24.806: g_object_set_is_valid_property: object class 'nvv4l2h264enc' has no property named 'gpu-id'

 *** DeepStream: Launched RTSP Streaming at rtsp://localhost:8550/ds-test ***

Opening in BLOCKING MODE 
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
0:00:00.401046584 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<secondary_gie_3> NvDsInferContext[UID 5]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2092> [UID = 5]: deserialized trt engine from :solider_model.onnx_b1_gpu0_fp32.engine
Implicit layer support has been deprecated
INFO: [Implicit Engine Info]: layers num: 0

0:00:00.401154965 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<secondary_gie_3> NvDsInferContext[UID 5]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2195> [UID = 5]: Use deserialized engine model: solider_model.onnx_b1_gpu0_fp32.engine
0:00:00.407687128 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<secondary_gie_3> [UID 5]: Load new model:solider_config.txt sucessfully
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
0:00:00.719132678 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<secondary_gie_2> NvDsInferContext[UID 4]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2092> [UID = 4]: deserialized trt engine from :inswapper_128.onnx_b1_gpu0_fp32.engine
Implicit layer support has been deprecated
INFO: [Implicit Engine Info]: layers num: 0

0:00:00.719207524 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<secondary_gie_2> NvDsInferContext[UID 4]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2195> [UID = 4]: Use deserialized engine model: inswapper_128.onnx_b1_gpu0_fp32.engine
obj id from func: 1853066616
0:00:00.732390631 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<secondary_gie_2> [UID 4]: Load new model:swap_config.txt sucessfully
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
0:00:00.863601460 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<secondary_gie_1> NvDsInferContext[UID 3]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2092> [UID = 3]: deserialized trt engine from :w600k_r50.onnx_b1_gpu0_fp32.engine
Implicit layer support has been deprecated
INFO: [Implicit Engine Info]: layers num: 0

0:00:00.863684914 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<secondary_gie_1> NvDsInferContext[UID 3]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2195> [UID = 3]: Use deserialized engine model: w600k_r50.onnx_b1_gpu0_fp32.engine
0:00:00.865195637 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<secondary_gie_1> [UID 3]: Load new model:recog_config.txt sucessfully
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
0:00:00.933860017 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<secondary_gie_0> NvDsInferContext[UID 2]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2092> [UID = 2]: deserialized trt engine from :yolov8s.onnx_b1_gpu0_fp32.engine
Implicit layer support has been deprecated
INFO: [Implicit Engine Info]: layers num: 0

0:00:00.933949295 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<secondary_gie_0> NvDsInferContext[UID 2]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2195> [UID = 2]: Use deserialized engine model: yolov8s.onnx_b1_gpu0_fp32.engine
0:00:00.940072058 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<secondary_gie_0> [UID 2]: Load new model:yolo_config.txt sucessfully
Using offsets : 127.500000,127.500000,127.500000
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so
[NvMultiObjectTracker] Initialized
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
0:00:01.064092176 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2092> [UID = 1]: deserialized trt engine from :new_layer_det.onnx_b1_gpu0_fp32.engine
Implicit layer support has been deprecated
INFO: [Implicit Engine Info]: layers num: 0

0:00:01.064170255 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2195> [UID = 1]: Use deserialized engine model: new_layer_det.onnx_b1_gpu0_fp32.engine
0:00:01.074782755 17901 0xaaaae97b2e10 INFO                 nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:scrfd_config.txt sucessfully

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

** INFO: <bus_callback:302>: Pipeline ready

Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
** INFO: <bus_callback:288>: Pipeline running

NvMMLiteOpen : Block : BlockType = 4 
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
H264: Profile = 66 Level = 0 
NVMEDIA: Need to set EMC bandwidth : 846000 
NvVideo: bBlitMode is set to TRUE 
double free or corruption (out)
Aborted (core dumped)

gdb backtrace

double free or corruption (out)
[New Thread 0xfffe8221f840 (LWP 18097)]

Thread 23 "secondary_gie_b" received signal SIGABRT, Aborted.
[Switching to Thread 0xffff8a7c7840 (LWP 18042)]
__pthread_kill_implementation (threadid=281473005156416, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=281473005156416, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x0000fffff640f254 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x0000fffff63ca67c in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x0000fffff63b7130 in __GI_abort () at ./stdlib/abort.c:79
#4  0x0000fffff6403308 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0xfffff64e43b8 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#5  0x0000fffff641957c in malloc_printerr (str=str@entry=0xfffff64df7b0 "double free or corruption (out)") at ./malloc/malloc.c:5664
#6  0x0000fffff641b694 in _int_free (av=0xfffff652bb10 <main_arena>, p=0xfffec406af30, have_lock=<optimized out>) at ./malloc/malloc.c:4588
#7  0x0000fffff641dc84 in __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3391
#8  0x0000fffff7e93a18 in  () at /opt/nvidia/deepstream/deepstream-7.1/lib/libnvds_meta.so
#9  0x0000fffff7e93094 [PAC] in nvds_destroy_batch_meta () at /opt/nvidia/deepstream/deepstream-7.1/lib/libnvds_meta.so
#10 0x0000fffff723ddec [PAC] in gst_buffer_foreach_meta () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#11 0x0000fffff7243918 in gst_buffer_pool_release_buffer () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#12 0x0000fffff7243a40 in  () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#13 0x0000fffff727b7f8 in gst_mini_object_unref () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#14 0x0000ffffc5646470 in  () at /usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_multistream.so
#15 0x0000fffff7284a78 [PAC] in  () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#16 0x0000fffff7287cb8 in  () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#17 0x0000fffff72880e8 in gst_pad_push () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#18 0x0000ffffc09e6f30 in  () at /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcoreelements.so
#19 0x0000ffffc09e7048 in  () at /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcoreelements.so
#20 0x0000fffff7284a78 in  () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#21 0x0000fffff7287cb8 in  () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#22 0x0000fffff72880e8 in gst_pad_push () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#23 0x0000fffff726e63c in gst_proxy_pad_chain_default () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#24 0x0000fffff7284a78 in  () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#25 0x0000fffff7287cb8 in  () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#26 0x0000fffff72880e8 in gst_pad_push () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#27 0x0000ffffc09e36fc in  () at /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcoreelements.so
#28 0x0000fffff72b180c in  () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#29 0x0000fffff6f17668 in  () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
#30 0x0000fffff6f14990 in  () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
#31 0x0000fffff640d5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
#32 0x0000fffff6475edc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79

Please resolve.
Thanks

The same code you implemented yourself is good on 7.0, but there are problems on 7.1, right?
From the backtrace, it might be that there are some issues with the metadata you created. You can check the code yourself first.

yes, it was working properly with 7.0. Can you tell me which section I should look at for metadata. I have not modified anything in the function mentioned in the backtrace. I have written parsers for all the models, pre-process for the swap model and rtsp metadata. The code for these are same as 7.0. Also I do not find the definition of the nvds_destroy_batch_meta function mentioned in the backtrace.

Update

Based on your response I tried to run the app with output-tensor-meta=0 for Face swap model and now I am not getting segfault. Why enabling output-tensor-meta is causing an issue which was working fine with 7.0 Below is my swap model config file

[property]
gpu-id=0
input-tensor-from-meta=1
model-engine-file=inswapper_128.onnx_b1_gpu0_fp32.engine
#onnx-file=fixed_swap.onnx
batch-size=1
model-color-format=0
network-mode=0
process-mode=2
network-type=3
interval=0
infer-dims=3;128;128
cluster-mode=4
custom-lib-path=./parser/libnvdsinfer_custom_impl.so
parse-bbox-instance-mask-func-name=NvDsInferParseSwap
#maintain-aspect-ratio=1
#symmetric-padding=1
output-tensor-meta=1
#output-instance-mask=1

[class-attrs-all]
pre-cluster-threshold=0.5

To avoid any confusion I ran the standard deepstream-app provided by Nvidia and if output-tensor-meta is set to 1 in face swap model then I am getting same error as with modified code. So this means that standard app is also not able to work with output-tensor-meta as 1? Please resolve.

Which sample code are you using? You can try to use our deepstream-infer-tensor-meta-test to verify the output-tensor-meta issue.

I have used standard deepstream-app. The output tensor meta should work with it. After further testing I found that if I enable this flasg for other model like YOLO or face detect then the standard app is working without seg fault. So I feel that some how it is related to the non image input model and output tensor meta. I want to work with deepstream-app only and not with any other app. Let me know how to proceed.

You can debug the code implemented by yourself line by line to find the place that causes your sample to crash.

Or you can try to reproduce your problem with one of our deepstream\sources\apps\sample_apps. If there is a way to reproduce the problem on our side, we can analyze it faster.

As I said earlier that I have used deepstream-app provided by Nvidia and that is also crashing so you should be able reproduce it at your end.

I am also facing another issue with this same pipeline and no one has responded on it. Please take a look at Model not working after upgrading to Deepstream 7.1

Thanks,
Vishal

Could you attach your complete commands and configuration files you mentioned above?

Hi,
Let me provide you config file and model. To make things simple just use Yolo as primary detector and then use this model as SGIE. Use the standard deepstream-app available at /usr/bin/deepstream-app with the command

deepstream-app -c main_config.txt

The main config file is as below

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5

[tiled-display]
enable=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
uri=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
num-sources=1
gpu-id=0
# (0): memtype_device   - Memory type Device
# (1): memtype_pinned   - Memory type Host Pinned
# (2): memtype_unified  - Memory type Unified
cudadec-memtype=0

[sink0]
enable=1
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
#sync=0
#iframeinterval=10
#bitrate=2000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
# set profile only for hw encoder, sw encoder selects profile based on sw-preset
profile=0
output-file=clip2_db.mp4
source-id=0

[osd]
enable=1
gpu-id=0
border-width=1
text-size=10
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0
display-bbox=1
display-text=1

[streammux]
gpu-id=0
##Boolean property to inform muxer that sources are live
live-source=0
batch-size=1
buffer-pool-size=500
## Set muxer output width and height
width=1920
height=1080
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=1
nvbuf-memory-type=0
## If set to TRUE, system timestamp will be attached as ntp timestamp
## If set to FALSE, ntp timestamp from rtspsrc, if available, will be attached

[primary-gie]
enable=1
gpu-id=0
batch-size=1
#Required by the app for OSD, not a plugin property
bbox-border-color0=0;0;1;1
bbox-border-color1=0;0;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;0;1;1
interval=0
#Required by the app for SGIE, when used along with config-file property
gie-unique-id=1
nvbuf-memory-type=0
config-file=yolo_config.txt

[secondary-pre-process2]
enable=1
operate-on-gie-id=1
config-file=secondary_preprocess.txt

[secondary-gie2]
enable=1
gpu-id=0
batch-size=1
gie-unique-id=4
input-tensor-meta=1
operate-on-gie-id=1
nvbuf-memory-type=0
config-file=swap_config.txt

[tracker]
enable=1
# For NvDCF and DeepSORT tracker, tracker-width and tracker-height must be a multiple of 32, respectively
tracker-width=640
tracker-height=640
ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so
# ll-config-file required to set different tracker types
# ll-config-file=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_tracker_IOU.yml
#ll-config-file=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_tracker_NvDCF_perf.yml
ll-config-file=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_tracker_NvSORT.yml
# ll-config-file=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_tracker_NvDCF_accuracy.yml
# ll-config-file=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_tracker_DeepSORT.yml
#gpu-id=0
display-tracking-id=1

[tests]
file-loop=0

Please use the onnx model from below link and deepstream will automatically convert it to engine

swap_config.txt file is as below

[property]
gpu-id=0
input-tensor-from-meta=1
model-engine-file=inswapper_128.onnx_b1_gpu0_fp32.engine
onnx-file=inswapper_128.onnx
batch-size=1
model-color-format=0
network-mode=0
process-mode=2
network-type=3
interval=0
infer-dims=3;128;128
cluster-mode=4
custom-lib-path=./parser/libnvdsinfer_custom_impl.so
parse-bbox-instance-mask-func-name=NvDsInferParseSwap
#maintain-aspect-ratio=1
#symmetric-padding=1
output-tensor-meta=1
#output-instance-mask=1

[class-attrs-all]
pre-cluster-threshold=0.5

secondary_preprocess.txt

[property]
enable=1
    # list of component gie-id for which tensor is prepared
target-unique-ids=4
    # preprocess on metadata generated by this unique gie-id
#operate-on-gie-id=1
    # 0=NCHW, 1=NHWC, 2=CUSTOM
network-input-order=0
    # 0=process on objects 1=process on frames
process-on-frame=0
    #uniquely identify the metadata generated by this element
unique-id=9
    # gpu-id to be used
gpu-id=0
    # if enabled maintain the aspect ratio while scaling
maintain-aspect-ratio=1
    # if enabled pad symmetrically with maintain-aspect-ratio enabled
symmetric-padding=1
    # processig width/height at which image scaled
processing-width=128
processing-height=128
    # max buffer in scaling buffer pool
scaling-buf-pool-size=6
    # max buffer in tensor buffer pool
tensor-buf-pool-size=6
    # tensor shape based on network-input-order
network-input-shape= 1;3;128;128
    # 0=RGB, 1=BGR, 2=GRAY
network-color-format=0
    # 0=FP32, 1=UINT8, 2=INT8, 3=UINT32, 4=INT32, 5=FP16
tensor-data-type=0
    # tensor name same as input layer name
tensor-name=target
    # 0=NVBUF_MEM_DEFAULT 1=NVBUF_MEM_CUDA_PINNED 2=NVBUF_MEM_CUDA_DEVICE 3=NVBUF_MEM_CUDA_UNIFIED
scaling-pool-memory-type=0
    # 0=NvBufSurfTransformCompute_Default 1=NvBufSurfTransformCompute_GPU 2=NvBufSurfTransformCompute_VIC
scaling-pool-compute-hw=0
    # Scaling Interpolation method
    # 0=NvBufSurfTransformInter_Nearest 1=NvBufSurfTransformInter_Bilinear 2=NvBufSurfTransformInter_Algo1
    # 3=NvBufSurfTransformInter_Algo2 4=NvBufSurfTransformInter_Algo3 5=NvBufSurfTransformInter_Algo4
    # 6=NvBufSurfTransformInter_Default
scaling-filter=0
    # custom library .so path having custom functionality
custom-lib-path=/opt/nvidia/deepstream/deepstream-7.1/lib/gst-plugins/libcustom2d_preprocess.so
    # custom tensor preparation function name having predefined input/outputs
    # check the default custom library nvdspreprocess_lib for more info
custom-tensor-preparation-function=CustomTensorPreparation

[user-configs]
   # Below parameters get used when using default custom library nvdspreprocess_lib
   # network scaling factor
#pixel-normalization-factor=1
pixel-normalization-factor=0.0039215686274509
   # mean file path in ppm format
#mean-file=
   # array of offsets for each channel
#offsets=

[group-0]
src-ids=0
#0:Car 1:Bicycle 2:Person 3:Roadsign
operate-on-class-ids=0
process-on-roi=0
process-on-all-objects=1
custom-input-transformation-function=CustomTransformation
#roi-params-src-0=0;0;1920;1080

yolo_config.txt

[property]
gpu-id=0
net-scale-factor=0.0039215686274509
model-engine-file=yolov8s.onnx_b1_gpu0_fp32.engine
onnx-file=yolov8s.onnx
batch-size=1
network-mode=0
process-mode=1
num-detected-classes=80
interval=0
#gie-unique-id=2
symmetric-padding=1
cluster-mode=2
parse-bbox-func-name=NvDsInferParseCustomYoloV8
custom-lib-path=parser/libnvdsinfer_custom_impl.so
infer-dims=3;640;640
maintain-aspect-ratio=1
#output-tensor-meta=1

[class-attrs-all]
pre-cluster-threshold=0.75
#topk=20
nms-iou-threshold=0.25

You can use standard yolov8 model and parser library from below.

We cannot run your sample on our side.

Failed to retrieve embedding. HTTP Status: 0
obj id from func: 1148820808
Failed to open file: source_embeddings/source_embedding_3.txt

From your previous investigation, the place where the crash occurs is most likely in your code implementation libnvdsinfer_custom_impl.so. Please add more logs in your own code and find the place that causes the crash.

Thanks for looking into this. I have uploaded the missing file at below link.

Please create a directory name source_embeddings and put this file.

Library libnvdsinfer_custom_impl.so is providing the input to non-image layer and adding custom parser. The custom parser is doing nothing and just reporting true. The same code for input and parser worked with 7.0 so why do you think that it is an issue with this library.

Because if I disable the sgie, the code will not crash. Also, you have set the output-tensor-meta=1 in your swap_config.txt file, but you haven’t done any processing for this tensor data. Are you sure you haven’t made any changes to our deepstream-app source code in the DeepStream 7.0?

I have made the changes in deepstream-app but to avoid any confusion with my code I ran the standard deepstream-app and found that it is crashing. So in nutshell if I enable output-tensor-meta for swap then the standard app provided with DS7.1 crashes. Were you able to reproduce it with the provided library libnvdsinfer_custom_impl.so.

Library libnvdsinfer_custom_impl.so has input function for non-image layer and a parser function. The parser function is doing nothing.

Yes. But if I diable the swap_sgie, it works well. So the reason might be that some operations within this part have affected the normal release of metadata. Could you try to use our source4_1080p_dec_preprocess_infer-resnet_preprocess_sgie_tiled_display_int8.txt sample to reproduce your issue.
This demo is basically the same as your pipeline, and the code is all open source. If you can reproduce that with this sample, we can analyze the problem more quickly.

The config file source4_1080p_dec_preprocess_infer-resnet_preprocess_sgie_tiled_display_int8.txt doesn’t has output-tensor-meta.

Yes. You can make modifications on this basis sample and try to reproduce your issue. After we get the modified source code, we can analyze this problem better.
You can also verify again whether all your modifications have been completely migrated from 7.0 to 7.1.

Thanks for your constant support. I understood your point. I was just thinking that making changes in existing sample code and then reproducing the issue will be a longer shot. Since standard Nvdia provided deepstream-app and plugins are used so we should be good to go ahead and debug it. I can provide you the source code of libnvdsinfer_custom_impl.so which has only two relevant functions i.e. non-image layer input function and a parser function.
Let me know if this works.