Can't profile deepstream test1 (python) using nsys

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
RTX3060
• DeepStream Version
nvcr.io/nvidia/deepstream:6.1-triton
• JetPack Version (valid for Jetson only)
• TensorRT Version

• NVIDIA GPU Driver Version (valid for GPU only)
510
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This
Dockerfile (1.1 KB)
run.sh (257 Bytes)
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’ve created a docker image to add python bindings to DS6.x. The Dockerfile is attached.
I’m able to run apps/deepstream_test_1.py and observe the display.

When I try to profile the application using nsys I get unexpected “End of file”

root@dsp-video-c4:/opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1# nsys profile -o log_test1 python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_qHD.h264
End of file

If I delay sampling by adding “-y 1” the application runs but no log is generated:

root@dsp-video-c4:/opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1# nsys profile -o log_test1 -y 1 python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_qHD.h264

...

Frame Number=1799 Number of Objects=11 Vehicle_count=10 Person_count=0
Frame Number=1800 Number of Objects=10 Vehicle_count=9 Person_count=0
Frame Number=1801 Number of Objects=10 Vehicle_count=9 Person_count=0
End-of-stream

Now it just hangs, the application does not end, and no stream recording is generated. If I hit ctrl+c I get “The proxy is not started”.

How can I profile deepstream app using nsys?

I’ve also tried

root@dsp-video-c4:/opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1# nsys launch -w false python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_qHD.h264 &
[1] 442
#The application window is now displayed
root@dsp-video-c4:/opt/nvidia/deepstream/deepstream-
6.1/sources/deepstream_python_apps/apps/deepstream-test1# nsys status
application launched. use the 'start' command to start collecting data
root@dsp-video-c4:/opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1# nsys start
End of file

We will try nsys with python to reproduce this issue

@Fiona.Chen ,

I’m not claiming there is a “general” problem with nsys and python.
I tested a few PyTorch tutorials (like EfficientNet-B0) with nsys and it worked fine straight away.

Deepstream is an example of an application that I couldn’t profile straight away with nsys.

I’ve tried with DeepStream 6.1.1 GA and Nsight 2022.3.4, no error.

/opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1# nsys profile -o log_test1 python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_qHD.h264
WARNING: CPU context switch tracing not supported, disabling.
Try the ‘nsys status --environment’ command to learn more.

WARNING: CPU sampling not supported, disabling.
Try the ‘nsys status --environment’ command to learn more.

0:00:00.863863710 10906 0x2ba7960 WARN nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1170> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5
0:00:03.877284701 10906 0x2ba7960 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1909> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
INFO: …/nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT input_1 3x368x640
1 OUTPUT kFLOAT conv2d_bbox 16x23x40
2 OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40

0:00:03.969471154 10906 0x2ba7960 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2012> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
0:00:03.972193636 10906 0x2ba7960 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus: [UID 1]: Load new model:dstest1_pgie_config.txt sucessfully
Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

Creating EGLSink

Playing file /opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_qHD.h264
Adding elements to Pipeline

Linking elements in the Pipeline

Starting pipeline

Frame Number=0 Number of Objects=6 Vehicle_count=4 Person_count=1
Frame Number=1 Number of Objects=6 Vehicle_count=4 Person_count=1
Frame Number=2 Number of Objects=6 Vehicle_count=4 Person_count=1
Frame Number=3 Number of Objects=6 Vehicle_count=4 Person_count=1
Frame Number=4 Number of Objects=6 Vehicle_count=4 Person_count=1
Frame Number=5 Number of Objects=6 Vehicle_count=4 Person_count=1
Frame Number=6 Number of Objects=6 Vehicle_count=4 Person_count=1
Frame Number=7 Number of Objects=6 Vehicle_count=5 Person_count=1
Frame Number=8 Number of Objects=8 Vehicle_count=7 Person_count=1


Frame Number=1800 Number of Objects=10 Vehicle_count=9 Person_count=0
Frame Number=1801 Number of Objects=10 Vehicle_count=9 Person_count=0
End-of-stream
Generating ‘/tmp/nsys-report-a23f.qdstrm’
Failed to create ‘/opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1/log_test1.nsys-rep’: File exists.
Use --force-overwrite true to overwrite existing files.
[1/1] [========================100%] nsys-report-40b5.nsys-rep
Generated:
/tmp/nsys-report-40b5.nsys-rep

Thanks,
Are you using a Deepstream docker? Did you try with the Dockerfile I’ve attached to this thread?

I tried with the Nvidia deepstream docker. DeepStream | NVIDIA NGC

Thanks @Fiona.Chen,
When upgrading the docker’s Nsight 2022.3.4 recording works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.