• Hardware Platform (Jetson / GPU)
RTX2080
• DeepStream Version
6.1
• JetPack Version (valid for Jetson only)
• TensorRT Version
8.1
• 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)
I’m using deepstream_infer_tensor_meta_test.cpp
and I’d like to use a custom gst-nvinfer
instead of gst-nvinfer
, how to compile it and use it in my code?
I compiled the sources as it explained in README
in gst-infer
folder and I generated the libnvdsgst_infer.so
and I added it to gst-plugins
in the lib
folder. When I include the gstnvinfer.h
in the deepstream_infer_tensor_meta_test.cpp
it shows me this error
/usr/bin/ld: deepstream_infer_tensor_meta_test.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
This is the makefile
################################################################################
# Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
################################################################################
CUDA_VER?=11.7
ifeq ($(CUDA_VER),)
$(error "CUDA_VER is not set")
endif
APP:= deepstream-infer-tensor-meta-app
CC = g++
TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -)
NVDS_VERSION:=6.1
LIB_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
APP_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/bin/
GST_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/gst-plugins/
SRCS:= $(wildcard *.cpp)
INCS:= $(wildcard *.h)
PKGS:= gstreamer-1.0 opencv4
# CFLAGS:= -fPIC -std=c++11 \
# -I/opt/nvidia/deepstream/deepstream-6.1/sources/includes \
# -I /usr/local/cuda-$(CUDA_VER)/include
CFLAGS+= -I /opt/nvidia/deepstream/deepstream-6.1/sources/includes \
-I /usr/local/cuda-$(CUDA_VER)/include \
-I /opt/nvidia/deepstream/deepstream-6.1/sources/gst-nvinfer \
-I /opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/retina_facereco/test_last/gst-nvinfer-custom
CFLAGS+= $(shell pkg-config --cflags $(PKGS))
LIBS:= $(shell pkg-config --libs $(PKGS))
LIBS+= -L$(LIB_INSTALL_DIR) -lnvdsgst_meta -lnvds_meta -lnvds_inferutils -lnvds_utils -lm \
-lnvbufsurface -lnvbufsurftransform -lnvdsgst_helper -lnvds_batch_jpegenc \
-L$(GST_INSTALL_DIR) -lnvdsgst_infer \
-L/usr/local/cuda-$(CUDA_VER)/lib64/ -lcudart \
-lcuda -Wl,-rpath,$(LIB_INSTALL_DIR)
ifeq ($(TARGET_DEVICE),aarch64)
CFLAGS+= -DPLATFORM_TEGRA
SRCS+=/opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/retina_facereco/nvdsinfer_customparser/nvdsparse_retinaface.cpp
else
LIBS+= -L$(LIB_INSTALL_DIR) -lnvds_infercustomparser
endif
OBJS:= $(SRCS:.cpp=.o)
all: $(APP)
debug: CFLAGS+= -DDEBUG -g
debug: CXXFLAGS+= -DDEBUG -g
debug: CCFLAGS+= -DDEBUG -g
debug: $(APP)
%.o: %.cpp $(INCS) Makefile
$(CC) -c -o $@ $(CFLAGS) $<
$(APP): $(OBJS) Makefile
$(CC) -o $(APP) $(OBJS) $(LIBS)
install: $(APP)
cp -rv $(APP) $(APP_INSTALL_DIR)
clean:
rm -rf $(OBJS) $(APP)
In the makefile I specified the -L$(GST_INSTALL_DIR) -lnvdsgst_infer \
which is libnvdsgst_infer.so
…
What is the issue is it a linker problem or symbolic link ?