Does deepstream-occupancy-analytics run on deepstream6?

• Hardware Platform (Jetson / GPU)
Jetson Xavier NX
• DeepStream Version
6.0.1
(downloaded from https://developer.nvidia.com/deepstream_sdk_v6.0.1_jetson.tbz2)
• JetPack Version (valid for Jetson only)
4.6.1

Hi, I am trying to run deepstream-occupancy-analytics on Deepstream6.0.1. But when I run

sudo make

I got the following errors:

/usr/bin/ld: cannot find -lnvdsgst_meta
/usr/bin/ld: cannot find -lnvds_meta
/usr/bin/ld: cannot find -lnvdsgst_helper
/usr/bin/ld: cannot find -lnvdsgst_smartrecord
/usr/bin/ld: cannot find -lnvds_utils
/usr/bin/ld: cannot find -lnvds_msgbroker
collect2: error: ld returned 1 exit status
Makefile:76: recipe for target 'deepstream-test5-analytics' failed
make: *** [deepstream-test5-analytics] Error 1

Is the error just because deepstream-occupancy-analytics is not compatible with deepstream6? Or Is there a way to run?

Thank you for your support.

There two branches, which one you are using?
For 6.0 version, you should use branch ds_6.0

@Amycao thank you very much. I didn’t noticed the branch and used master branch. Now I am trying ds_6.0 and facing the same issue as this question.
I compared deepstream_test5_app_main.c in ds_6.0 with the one in the master branch, but I don’t see the header files missing. Could you tell me what header files are needed?

Can you paste the result:
git branch

/usr/bin/ld: cannot find -lnvdsgst_meta

Linker is looking for libnvdsgst_meta.so library under /opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
master set NVDS_VERSION as 5.0, that’s why you met the error above, but 6.0 branch set NVDS_VERSION to 6.0, it’s weired you still met the issue.

@Amycao Ah, the first issue returning"/usr/bin/ld: cannot find -lnvdsgst_meta" was solved by using the code of ds_6.0 branch.
Now, after run

sudo make

it returns

c -c -o deepstream_test5_app_main.o  -DPLATFORM_TEGRA -I../../apps-common/includes -I./includes -I../../../includes -I../deepstream-app/ -DDS_VERSION_MINOR=1 -DDS_VERSION_MAJOR=5 -I../deepstream-test5 -I/usr/local/cuda-10.2/include `pkg-config --cflags gstreamer-1.0 gstreamer-video-1.0 x11 json-glib-1.0` deepstream_test5_app_main.c
deepstream_test5_app_main.c: In function ‘meta_copy_func’:
deepstream_test5_app_main.c:314:88: error: ‘NvDsEventMsgMeta {aka struct NvDsEventMsgMeta}’ has no member named ‘source_id’
        g_print(" %s %d source id: %d, Enter: %d, Exit: %d\n",__func__,__LINE__, dstMeta->source_id, dstMeta->lccum_cnt_entry, dstMeta->lccum_cnt_exit);
                                                                                        ^~
deepstream_test5_app_main.c:314:108: error: ‘NvDsEventMsgMeta {aka struct NvDsEventMsgMeta}’ has no member named ‘lccum_cnt_entry’
        g_print(" %s %d source id: %d, Enter: %d, Exit: %d\n",__func__,__LINE__, dstMeta->source_id, dstMeta->lccum_cnt_entry, dstMeta->lccum_cnt_exit);
                                                                                                            ^~
deepstream_test5_app_main.c:314:134: error: ‘NvDsEventMsgMeta {aka struct NvDsEventMsgMeta}’ has no member named ‘lccum_cnt_exit’
        g_print(" %s %d source id: %d, Enter: %d, Exit: %d\n",__func__,__LINE__, dstMeta->source_id, dstMeta->lccum_cnt_entry, dstMeta->lccum_cnt_exit);
                                                                                                                                      ^~
deepstream_test5_app_main.c: In function ‘generate_event_msg_meta’:
deepstream_test5_app_main.c:413:9: error: ‘NvDsEventMsgMeta {aka struct NvDsEventMsgMeta}’ has no member named ‘occupancy’
     meta->occupancy = obj_params->lccum_cnt;
         ^~
deepstream_test5_app_main.c:414:9: error: ‘NvDsEventMsgMeta {aka struct NvDsEventMsgMeta}’ has no member named ‘lccum_cnt_entry’
     meta->lccum_cnt_entry = obj_params->lcc_cnt_entry;
         ^~
deepstream_test5_app_main.c:415:9: error: ‘NvDsEventMsgMeta {aka struct NvDsEventMsgMeta}’ has no member named ‘lccum_cnt_exit’
     meta->lccum_cnt_exit = obj_params->lcc_cnt_exit ;
         ^~
deepstream_test5_app_main.c:416:9: error: ‘NvDsEventMsgMeta {aka struct NvDsEventMsgMeta}’ has no member named ‘source_id’
     meta->source_id = obj_params->source_id;
         ^~
Makefile:73: recipe for target 'deepstream_test5_app_main.o' failed
make: *** [deepstream_test5_app_main.o] Error 1

This issue is the same as this question. And in the thread you mentioned

Seems you miss some header file.

Could you tell me what kind of files are missing?

There changes in structure NvDsEventMsgMeta, the author add some analytic fields, which redefined in includes/nvdsmeta_schema.h, but not included in 6.0 branch, you need to modify accordingly.

@Amycao thank you again. I successfully compiled deepstream-test5-analytics by importing missing files and edit the config file. I run the program, but it doesn’t show the streaming. It is just black where the video image is supposed to be shown. And it is shutdown soon.

Following is the output of the program. I really appreciate if you can support this issue.

sudo ./deepstream-test5-analytics -c config/test5_config_file_src_infer_tlt.txt 
** WARN: <parse_source:577>: Deprecated config 'smart-rec-video-cache' used in group [source1]. Use 'smart-rec-cache' instead
Warning: 'input-dims' parameter has been deprecated. Use 'infer-dims' instead.

Using winsys: x11 
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-6.0/lib/libnvds_nvdcf.so
gstnvtracker: Batch processing is OFF
gstnvtracker: Past frame output is OFF
0:00:05.888023859 16234   0x5592b66550 INFO                 nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1900> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-occupancy-analytics-ds_6.0/config/peoplenet/resnet34_peoplenet_pruned.etlt_b1_gpu0_int8.engine
INFO: [Implicit Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1         3x544x960       
1   OUTPUT kFLOAT output_bbox/BiasAdd 12x34x60        
2   OUTPUT kFLOAT output_cov/Sigmoid 3x34x60         

0:00:05.914126435 16234   0x5592b66550 INFO                 nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2004> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-occupancy-analytics-ds_6.0/config/peoplenet/resnet34_peoplenet_pruned.etlt_b1_gpu0_int8.engine
0:00:05.922756306 16234   0x5592b66550 INFO                 nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-occupancy-analytics-ds_6.0/config/config_infer_primary_peoplenet.txt sucessfully

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
      To go back to the tiled display, right-click anywhere on the window.


**PERF:  FPS 0 (Avg)	
Sun Sep 11 09:30:13 2022
**PERF:  0.00 (0.00)	
** INFO: <bus_callback:194>: Pipeline ready

Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
** INFO: <bus_callback:180>: Pipeline running

~~ CLOG[/dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvdcf/src/modules/NvDCF/NvDCF.cpp, NvDCF() @line 630]: !!![WARNING] Can't open config file (/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-occupancy-analytics-ds_6.0/config/tracker_config.yml). Will go ahead with default values
~~ CLOG[/dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvdcf/src/modules/NvDCF/NvDCF.cpp, NvDCF() @line 642]: !!![WARNING] Invalid low-level config file is provided. Will go ahead with default values
[NvDCF] Initialized
Segmentation fault

Thanks,

Tracker changed from DS 6.0, it used one unified low level library for the tracker algorithms, DCF, IOU, DeepSORT. please check test2 app for how tracker used.

@Amycao You mean the code ds_6.0 doesn’t work as it is? Do we need to edit it referring to test2 app?

You need to change tracker related refering to test2 in DS 6.0.

@Amycao I tried to modify but don’t get what to do. If you don’t mind, could you show me the concrete way to change it?

code after comment #Set properties of tracker about tracker properties setting.

@Amycao I don’t find the comment though I searched “#Set properties of tracker” in deepstream-occupancy-analytics-ds_6.0 and deepstream-test2 directories. Could you tel me which line of what file?

Oh. it’s for python version.

g_object_set (G_OBJECT (nvtracker), “tracker-width”, width, NULL);
also other properties need to set. just one example.

@Amycao umm, still can’t get…
nvtracker is used in deepstream_test2_app.c, but not in deepstream_test5_app_main.c in ds_6.0 of deepstream-occupancy-analytics. Referring to the code written in deepstream_test2_app.c,

g_object_set (G_OBJECT (nvtracker), “tracker-width”, width, NULL);

how do I change the code in deepstream_test5_app_main.c?
I really appreciate if you show me an example or the complete code for deepstream_test5_app_main.c.

Why you need to change in test5 app? don’t you work with deepstream-occupancy-analytics? please read the code carefully and work out.

@Amycao Yes, I am working on deepstream-occupancy-analytics and the file name in the directory is deepstream_test5_app_main.c same as the one in deepstream-test5.