From 89089145fd6cc32f2d27787a354033034c2c8e47 Mon Sep 17 00:00:00 2001 From: Marcos Luciano Date: Fri, 19 Aug 2022 13:41:49 -0300 Subject: [PATCH] Add docker usage --- README.md | 39 +++++++++++++++++++++++++++++ nvdsinfer_custom_impl_Yolo/Makefile | 12 ++++----- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ba60bc6..5756c3d 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ NVIDIA DeepStream SDK 6.1 / 6.0.1 / 6.0 configuration for YOLO models * [Benchmarks](#benchmarks) * [dGPU installation](#dgpu-installation) * [Basic usage](#basic-usage) +* [Docker usage](#docker-usage) * [NMS configuration](#nms-configuration) * [INT8 calibration](#int8-calibration) * [YOLOv5 usage](docs/YOLOv5.md) @@ -504,6 +505,44 @@ config-file=config_infer_primary_yoloV2.txt ## +### Docker usage + +* x86 platform + + ``` + nvcr.io/nvidia/deepstream:6.1-devel + nvcr.io/nvidia/deepstream:6.1-triton + ``` + +* Jetson platform + + ``` + nvcr.io/nvidia/deepstream-l4t:6.1-samples + nvcr.io/nvidia/deepstream-l4t:6.1-triton + ``` + + **NOTE**: To compile the `nvdsinfer_custom_impl_Yolo`, you need to install the g++ inside the container + + ``` + apt-get install build-essential + ``` + + **NOTE**: With DeepStream 6.1, the container image missed to include certain header files that will be available on host machine with Compute libraries installed from Jetpack. To mount the headers, use: + + ``` + -v /usr/include/aarch64-linux-gnu/NvInfer.h:/usr/include/aarch64-linux-gnu/NvInfer.h -v /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:/usr/include/aarch64-linux-gnu/NvInferLegacyDims.h -v /usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h -v /usr/include/aarch64-linux-gnu/NvInferVersion.h:/usr/include/aarch64-linux-gnu/NvInferVersion.h -v /usr/include/aarch64-linux-gnu/NvInferRuntime.h:/usr/include/aarch64-linux-gnu/NvInferRuntime.h -v /usr/include/aarch64-linux-gnu/NvInferImpl.h:/usr/include/aarch64-linux-gnu/NvInferImpl.h -v /usr/include/aarch64-linux-gnu/NvCaffeParser.h:/usr/include/aarch64-linux-gnu/NvCaffeParser.h -v /usr/include/aarch64-linux-gnu/NvUffParser.h:/usr/include/aarch64-linux-gnu/NvUffParser.h -v /usr/include/aarch64-linux-gnu/NvInferPlugin.h:/usr/include/aarch64-linux-gnu/NvInferPlugin.h -v /usr/include/aarch64-linux-gnu/NvInferPluginUtils.h:/usr/include/aarch64-linux-gnu/NvInferPluginUtils.h -v /usr/local/cuda/:/usr/local/cuda/ + ``` + +
+ Example + + ``` + sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -w /opt/nvidia/deepstream/deepstream-6.1 -v /tmp/.X11-unix/:/tmp/.X11-unix -v /usr/include/aarch64-linux-gnu/NvInfer.h:/usr/include/aarch64-linux-gnu/NvInfer.h -v /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:/usr/include/aarch64-linux-gnu/NvInferLegacyDims.h -v /usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h -v /usr/include/aarch64-linux-gnu/NvInferVersion.h:/usr/include/aarch64-linux-gnu/NvInferVersion.h -v /usr/include/aarch64-linux-gnu/NvInferRuntime.h:/usr/include/aarch64-linux-gnu/NvInferRuntime.h -v /usr/include/aarch64-linux-gnu/NvInferImpl.h:/usr/include/aarch64-linux-gnu/NvInferImpl.h -v /usr/include/aarch64-linux-gnu/NvCaffeParser.h:/usr/include/aarch64-linux-gnu/NvCaffeParser.h -v /usr/include/aarch64-linux-gnu/NvUffParser.h:/usr/include/aarch64-linux-gnu/NvUffParser.h -v /usr/include/aarch64-linux-gnu/NvInferPlugin.h:/usr/include/aarch64-linux-gnu/NvInferPlugin.h -v /usr/include/aarch64-linux-gnu/NvInferPluginUtils.h:/usr/include/aarch64-linux-gnu/NvInferPluginUtils.h -v /usr/local/cuda/:/usr/local/cuda/ nvcr.io/nvidia/deepstream-l4t:6.1-samples + ``` +
+ +## + ### NMS Configuration To change the `nms-iou-threshold`, `pre-cluster-threshold` and `topk` values, modify the config_infer file and regenerate the model engine file diff --git a/nvdsinfer_custom_impl_Yolo/Makefile b/nvdsinfer_custom_impl_Yolo/Makefile index 69d6deb..c6e19b8 100644 --- a/nvdsinfer_custom_impl_Yolo/Makefile +++ b/nvdsinfer_custom_impl_Yolo/Makefile @@ -25,12 +25,12 @@ CUDA_VER?= ifeq ($(CUDA_VER),) - $(error "CUDA_VER is not set") + $(error "CUDA_VER is not set") endif OPENCV?= ifeq ($(OPENCV),) - OPENCV=0 + OPENCV=0 endif CC:= g++ @@ -40,9 +40,9 @@ CFLAGS:= -Wall -std=c++11 -shared -fPIC -Wno-error=deprecated-declarations CFLAGS+= -I/opt/nvidia/deepstream/deepstream/sources/includes -I/usr/local/cuda-$(CUDA_VER)/include ifeq ($(OPENCV), 1) -COMMON= -DOPENCV -CFLAGS+= $(shell pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv) -LIBS+= $(shell pkg-config --libs opencv4 2> /dev/null || pkg-config --libs opencv) + COMMON= -DOPENCV + CFLAGS+= $(shell pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv) + LIBS+= $(shell pkg-config --libs opencv4 2> /dev/null || pkg-config --libs opencv) endif LIBS+= -lnvinfer_plugin -lnvinfer -lnvparsers -L/usr/local/cuda-$(CUDA_VER)/lib64 -lcudart -lcublas -lstdc++fs @@ -53,7 +53,7 @@ INCS:= $(wildcard *.h) SRCFILES:= $(filter-out calibrator.cpp, $(wildcard *.cpp)) ifeq ($(OPENCV), 1) -SRCFILES+= calibrator.cpp + SRCFILES+= calibrator.cpp endif SRCFILES+= $(wildcard layers/*.cpp)