my libnvds_infer.so can not work

i try to rebuild libnvds_infer.so.

use opencv 3.4.5 with cuda,and i did not change any code but makefile change to

LIBS := -shared -Wl,-no-undefined
-lnvinfer -lnvinfer_plugin -lnvonnxparser -lnvparsers
-L/usr/local/cuda-$(CUDA_VER)/lib64/ -lcudart
-lopencv_world
and can get the libnvds_infer.so.

but my libnvds_infer.so is only 721KB and your origin libnvds_infer.so is 5181KB.
i guest that maybe your lib link with static library.

ok. when i copy my libnvds_infer.so to /opt/nvidia/deepstream/deepstream-4.0/lib and use the vscode to debug the sample-test1.

it could not work, with the error message box like this:
无法打开“pthread_create.c”: 无法读取文件(Error: 找不到文件(/build/glibc-OTsEL5/glibc-2.27/nptl/pthread_create.c))。

but if i change your origin lib. it could work.

can any one can help me to fix this problem.

Can you make it without any change ?
The below is my build log on xavier. My opencv has been installed by sdkmanager/jetpack4.2.2

nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-4.0/sources/libs/nvdsinfer$ export CUDA_VER=10.0
nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-4.0/sources/libs/nvdsinfer$ make clean
rm -rf nvdsinfer_context_impl.o nvdsinfer_context_impl_capi.o nvdsinfer_context_impl_output_parsing.o nvdsinfer_conversion.o libnvds_infer.so
nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-4.0/sources/libs/nvdsinfer$ ls
Makefile                         nvdsinfer_context_impl.cpp  nvdsinfer_context_impl_output_parsing.cpp  nvdsinfer_conversion.h
nvdsinfer_context_impl_capi.cpp  nvdsinfer_context_impl.h    nvdsinfer_conversion.cu                    README
nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-4.0/sources/libs/nvdsinfer$ 
nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-4.0/sources/libs/nvdsinfer$ make
-fPIC -std=c++11 -I /usr/local/cuda-10.0/include -I ../../includes
g++ -c -o nvdsinfer_context_impl.o -fPIC -std=c++11 -I /usr/local/cuda-10.0/include -I ../../includes nvdsinfer_context_impl.cpp
-fPIC -std=c++11 -I /usr/local/cuda-10.0/include -I ../../includes
g++ -c -o nvdsinfer_context_impl_capi.o -fPIC -std=c++11 -I /usr/local/cuda-10.0/include -I ../../includes nvdsinfer_context_impl_capi.cpp
-fPIC -std=c++11 -I /usr/local/cuda-10.0/include -I ../../includes
g++ -c -o nvdsinfer_context_impl_output_parsing.o -fPIC -std=c++11 -I /usr/local/cuda-10.0/include -I ../../includes nvdsinfer_context_impl_output_parsing.cpp
-fPIC -std=c++11 -I /usr/local/cuda-10.0/include -I ../../includes
/usr/local/cuda-10.0/bin/nvcc -c -o nvdsinfer_conversion.o --compiler-options '-fPIC' nvdsinfer_conversion.cu
-fPIC -std=c++11 -I /usr/local/cuda-10.0/include -I ../../includes
g++ -o libnvds_infer.so nvdsinfer_context_impl.o nvdsinfer_context_impl_capi.o nvdsinfer_context_impl_output_parsing.o nvdsinfer_conversion.o -shared -Wl,-no-undefined -lnvinfer -lnvinfer_plugin -lnvonnxparser -lnvparsers -L/usr/local/cuda-10.0/lib64/ -lcudart -lopencv_objdetect -lopencv_imgproc -lopencv_core -L/opt/nvidia/deepstream/deepstream-4.0/lib/ -lnvdsgst_helper -lnvdsgst_meta -lnvds_meta -lnvds_inferutils -ldl -Wl,-rpath,/opt/nvidia/deepstream/deepstream-4.0/lib/

my cuda version is 10.1.

do i need change to cuda 10.0?

What’s your jetpack version? Can you install 4.2.2 ?

my workmate use opencv 3.4.5 ’s static library make a libnvds_infer.so

it works now.

but this 's still confuse me.

thank you.