Hi,
I’ve noticed a significant slowdown of my GStreamer/DeepStream pipeline based on YOLOv7 with almost every version after DeepStream v6.2 during both TensorRT engine build and nvinfer run.
I can observe similar behavior when running this DeepStream sample app repo in different DeepStream containers. With DeepStream 7.0 it takes twice as long to run the same pipeline.
What is the reason for this and can this somehow be fixed?
Thanks a lot for any advice!
Setup:
GPU: GeForce RTX 3060 12 GB
NVIDIA GPU Driver Version 555.42.02
Steps to reproduce:
- Pull and run the respective Docker images/containers
- Navigate to /opt/nvidia/deepstream/deepstream/sources/apps/
- Checkout commit with respective DeepStream version tag from sample app repo
- Specify correct NVDS_VERSION in Makefile
- Run make
- Run ./deepstream-redaction-app -c ./configs/pgie_config_fd_lpd.txt -i /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -o out.mp4
Outputs
DeepStream 6.1 (nvcr.io/nvidia/deepstream:6.1-triton)
./deepstream-redaction-app -c ./configs/pgie_config_fd_lpd.txt -i /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -o out.mp4
Now playing: /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1482 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.1/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine open error
0:00:01.310177147 583 0x563fe97ae230 WARN nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1888> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.1/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed
0:00:01.336521804 583 0x563fe97ae230 WARN nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1993> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.1/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed, try rebuild
0:00:01.336543205 583 0x563fe97ae230 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
Warning, setting batch size to 1. Update the dimension after parsing due to using explicit batch size.
0:00:30.862798311 583 0x563fe97ae230 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1946> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.1/sources/apps/redaction_with_deepstream-master/fd_lpd_model/fd_lpd.caffemodel_b1_gpu0_fp32.engine successfully
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT data 3x270x480
1 OUTPUT kFLOAT output_cov 4x17x30
2 OUTPUT kFLOAT output_bbox 16x17x30
0:00:30.901643307 583 0x563fe97ae230 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-nvinference-engine> [UID 1]: Load new model:./configs/pgie_config_fd_lpd.txt sucessfully
Pipeline ready
Pipeline running
End of stream
The program took 4.94 seconds to redact 1443 frames, pref = 292.15 fps
Returned, stopping playback
Deleting pipeline
DeepStream 6.2 (nvcr.io/nvidia/deepstream:6.2-triton)
./deepstream-redaction-app -c ./configs/pgie_config_fd_lpd.txt -i /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -o out.mp4
Now playing: /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1487 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine open error
0:00:02.629953427 241 0x55ef20e83c10 WARN nvinfer gstnvinfer.cpp:677:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1897> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.2/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed
0:00:02.734843529 241 0x55ef20e83c10 WARN nvinfer gstnvinfer.cpp:677:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2002> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.2/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed, try rebuild
0:00:02.734880039 241 0x55ef20e83c10 INFO nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1923> [UID = 1]: Trying to create engine from model files
Warning, setting batch size to 1. Update the dimension after parsing due to using explicit batch size.
0:00:24.517833343 241 0x55ef20e83c10 INFO nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1955> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.2/sources/apps/redaction_with_deepstream-master/fd_lpd_model/fd_lpd.caffemodel_b1_gpu0_fp32.engine successfully
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT data 3x270x480
1 OUTPUT kFLOAT output_cov 4x17x30
2 OUTPUT kFLOAT output_bbox 16x17x30
0:00:24.656468132 241 0x55ef20e83c10 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-nvinference-engine> [UID 1]: Load new model:./configs/pgie_config_fd_lpd.txt sucessfully
Pipeline ready
Pipeline running
nvstreammux: Successfully handled EOS for source_id=0
End of stream
The program took 4.25 seconds to redact 1443 frames, pref = 339.63 fps
Returned, stopping playback
Deleting pipeline
DeepStream 6.3 (nvcr.io/nvidia/deepstream:6.3-triton-multiarch)
./deepstream-redaction-app -c ./configs/pgie_config_fd_lpd.txt -i /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -o out.mp4
Now playing: /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1487 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.3/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine open error
0:00:02.624725396 880 0x55c783be08f0 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1976> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.3/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed
0:00:02.731642010 880 0x55c783be08f0 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2081> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.3/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed, try rebuild
0:00:02.731689119 880 0x55c783be08f0 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2002> [UID = 1]: Trying to create engine from model files
Warning, setting batch size to 1. Update the dimension after parsing due to using explicit batch size.
0:00:24.484216113 880 0x55c783be08f0 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2034> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.3/sources/apps/redaction_with_deepstream-master/fd_lpd_model/fd_lpd.caffemodel_b1_gpu0_fp32.engine successfully
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT data 3x270x480
1 OUTPUT kFLOAT output_cov 4x17x30
2 OUTPUT kFLOAT output_bbox 16x17x30
0:00:24.621066403 880 0x55c783be08f0 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-nvinference-engine> [UID 1]: Load new model:./configs/pgie_config_fd_lpd.txt sucessfully
Pipeline ready
Pipeline running
nvstreammux: Successfully handled EOS for source_id=0
End of stream
The program took 6.10 seconds to redact 1443 frames, pref = 236.51 fps
Returned, stopping playback
Deleting pipeline
DeepStream 6.4 (nvcr.io/nvidia/deepstream:6.4-triton-multiarch)
./deepstream-redaction-app -c ./configs/pgie_config_fd_lpd.txt -i /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -o out.mp4
Now playing: /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1487 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.4/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine open error
0:00:06.642388790 487 0x56060aba2d20 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2080> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.4/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed
0:00:06.868524923 487 0x56060aba2d20 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2185> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.4/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed, try rebuild
0:00:06.868548497 487 0x56060aba2d20 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2106> [UID = 1]: Trying to create engine from model files
Warning, setting batch size to 1. Update the dimension after parsing due to using explicit batch size.
0:00:33.916139450 487 0x56060aba2d20 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2138> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.4/sources/apps/redaction_with_deepstream-master/fd_lpd_model/fd_lpd.caffemodel_b1_gpu0_fp32.engine successfully
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT data 3x270x480
1 OUTPUT kFLOAT output_cov 4x17x30
2 OUTPUT kFLOAT output_bbox 16x17x30
0:00:34.174575073 487 0x56060aba2d20 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-nvinference-engine> [UID 1]: Load new model:./configs/pgie_config_fd_lpd.txt sucessfully
Pipeline ready
Pipeline running
nvstreammux: Successfully handled EOS for source_id=0
End of stream
The program took 6.07 seconds to redact 1443 frames, pref = 237.87 fps
Returned, stopping playback
Deleting pipeline
DeepStream 7.0 (nvcr.io/nvidia/deepstream:7.0-triton-multiarch)
./deepstream-redaction-app -c ./configs/pgie_config_fd_lpd.txt -i /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -o out.mp4
Now playing: /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1494 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-7.0/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine open error
0:00:06.644427918 99 0x555db535ea30 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2083> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-7.0/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed
0:00:06.867416394 99 0x555db535ea30 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2188> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-7.0/sources/apps/redaction_with_deepstream-master/configs/../fd_lpd_model/fd_lpd.caffemodel_b1_fp32.engine failed, try rebuild
0:00:06.867436473 99 0x555db535ea30 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2109> [UID = 1]: Trying to create engine from model files
Warning, setting batch size to 1. Update the dimension after parsing due to using explicit batch size.
0:00:33.652104778 99 0x555db535ea30 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2141> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-7.0/sources/apps/redaction_with_deepstream-master/fd_lpd_model/fd_lpd.caffemodel_b1_gpu0_fp32.engine successfully
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:612 [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT data 3x270x480
1 OUTPUT kFLOAT output_cov 4x17x30
2 OUTPUT kFLOAT output_bbox 16x17x30
0:00:33.902237814 99 0x555db535ea30 INFO nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<primary-nvinference-engine> [UID 1]: Load new model:./configs/pgie_config_fd_lpd.txt sucessfully
Pipeline ready
Pipeline running
nvstreammux: Successfully handled EOS for source_id=0
End of stream
The program took 8.53 seconds to redact 1443 frames, pref = 169.07 fps
Returned, stopping playback
Deleting pipeline