# Can't profile deepstream test1 (python) using nsys

**URL:** <https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340>\
**Category:** DeepStream SDK\
**Tags:** profiling\
**Created:** [August 18, 2022, 12:48pm UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340 "2022-08-18T12:48:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![user98065](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user98065](https://forums.developer.nvidia.com/u/user98065)\
**Post date:** [August 18, 2022, 12:48pm UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/1 "2022-08-18T12:48:47Z")

</div>

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)**  
RTX3060  
**• DeepStream Version**  
[nvcr.io/nvidia/deepstream:6.1-triton](http://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](https://forums.developer.nvidia.com/uploads/short-url/tDLS0fqGB4SQFLsGZYwRsA9TFOK) (1.1 KB)  
 [run.sh](https://forums.developer.nvidia.com/uploads/short-url/gRqELLKYz8RCz53NQ6unUWep13T.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”

```auto
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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![user98065](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user98065](https://forums.developer.nvidia.com/u/user98065)\
**Post date:** [August 18, 2022, 1:02pm UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/2 "2022-08-18T13:02:37Z")

</div>

I’ve also tried

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [August 24, 2022, 1:28am UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/4 "2022-08-24T01:28:58Z")

</div>

We will try nsys with python to reproduce this issue

---

<div class="post-metadata">

**Author:** ![user98065](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user98065](https://forums.developer.nvidia.com/u/user98065)\
**Post date:** [August 29, 2022, 8:04am UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/5 "2022-08-29T08:04:02Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [September 6, 2022, 8:17am UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/6 "2022-09-06T08:17:03Z")

</div>

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

 ![Capture](https://global.discourse-cdn.com/nvidia/original/3X/8/9/899e88f19649338aa4478a41b29803d9012c0360.png)

---

<div class="post-metadata">

**Author:** ![user98065](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user98065](https://forums.developer.nvidia.com/u/user98065)\
**Post date:** [September 7, 2022, 12:38pm UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/7 "2022-09-07T12:38:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [September 8, 2022, 1:46am UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/8 "2022-09-08T01:46:56Z")

</div>

I tried with the Nvidia deepstream docker. [DeepStream | NVIDIA NGC](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/deepstream)

---

<div class="post-metadata">

**Author:** ![user98065](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user98065](https://forums.developer.nvidia.com/u/user98065)\
**Post date:** [September 8, 2022, 9:53am UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/9 "2022-09-08T09:53:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [September 22, 2022, 9:53am UTC](https://forums.developer.nvidia.com/t/cant-profile-deepstream-test1-python-using-nsys/224340/10 "2022-09-22T09:53:39Z")

</div>

Closed on September 22, 2022, 9:53am UTC

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