Deepstream-test3 deepstream-5.0

Please provide complete information as applicable to your setup.

•Hardware Platform ( GPU)GeForce GTX 1660
•DeepStream Versiondeepstream-5.0_5.0.0-1_amd64.deb
•TensorRT Versiontrt7.0.0.11
•NVIDIA GPU Driver VersionNVIDIA-SMI 440.33.01
•CUDA Version10.2
• CUDNN Version7.6.5
• Issue Type( questions, new requirements, bugs)questions
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
command used is as below.

  1. cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test3/
  2. make
  3. ./deepstream-test3-app file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4

Hi Guys,

I am trying to run deepstream-test3-app with video. I can not get it to work normally. The output of demo is shown as below.

./deepstream-test3-app file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
Now playing: file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4,
libEGL warning: DRI2: failed to authenticate
WARNING: …/nvdsinfer/nvdsinfer_func_utils.cpp:34 [TRT]: Current optimization profile is: 0. Please ensure there are no enqueued operations pending in this context prior to switching profiles
0:00:01.023123404 31307 0x556eff8c5100 INFO nvinfer gstnvinfer.cpp:602:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1577> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
INFO: …/nvdsinfer/nvdsinfer_model_builder.cpp:685 [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:01.023162946 31307 0x556eff8c5100 INFO nvinfer gstnvinfer.cpp:602:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1681> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
0:00:01.023631034 31307 0x556eff8c5100 INFO nvinfer gstnvinfer_impl.cpp:311:notifyLoadModelStatus: [UID 1]: Load new model:dstest3_pgie_config.txt sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
Running…
Decodebin child added: qtdemux0
Decodebin child added: multiqueue0
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Decodebin child added: aacparse0
Decodebin child added: avdec_aac0
Decodebin child added: nvv4l2decoder0
In cb_newpad
In cb_newpad
cuGraphicsGLRegisterBuffer failed with error(304) gst_eglglessink_cuda_init texture = 1
Frame Number = 0 Number of objects = 6 Vehicle Count = 4 Person Count = 2
0:00:01.234093157 31307 0x556eff3f8ca0 WARN nvinfer gstnvinfer.cpp:1946:gst_nvinfer_output_loop: error: Internal data stream error.
0:00:01.234101349 31307 0x556eff3f8ca0 WARN nvinfer gstnvinfer.cpp:1946:gst_nvinfer_output_loop: error: streaming stopped, reason not-negotiated (-4)
ERROR from element primary-nvinference-engine: Internal data stream error.
Error details: gstnvinfer.cpp(1946): gst_nvinfer_output_loop (): /GstPipeline:dstest3-pipeline/GstNvInfer:primary-nvinference-engine:
streaming stopped, reason not-negotiated (-4)
Returned, stopping playback
Frame Number = 1 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Frame Number = 2 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Frame Number = 3 Number of objects = 6 Vehicle Count = 4 Person Count = 2
Frame Number = 4 Number of objects = 7 Vehicle Count = 4 Person Count = 3
Frame Number = 5 Number of objects = 6 Vehicle Count = 4 Person Count = 2
Frame Number = 6 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Deleting pipeline

Before this, I have run sucessfully this demo in jetson nano with deepstrem 5.0. However, curious about how to use deepstream5.0 in x86 platform with gpu.

Please help me out.

Thanks.

HI,
Sorry for the delay.
You need to use nvidia GPU as display.

Sorry for not understanding what you say. GeForce GTX 1660 can not use deepstream? However, I find that gtx 1660 can work in this post Why the fps is not crossing 35 even though free GPU space available - #6 by Fiona.Chen. Can you show available gpu list?

Thanks!

I mean you use another non nvidia GPU as display. you can use geforce 1660 for deepstream, but you may use non nvidia GPU as display. please check your setup.

I have just one gpu, and there is not integrated gpu in intel cpu. how to check my setup.
Thank you for your help

Oh, ok. can you login to desktop? or you can export the display from remote terminal.
export DISPLAY=:0 or 1 // xrandr to check if export success
please let me know if this works. if still not work, should be your display driver installation issue.

it still does not work. command and output is shown below.

root@pysoft:/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test3# export DISPLAY=:0
root@pysoft:/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test3# echo $DISPLAY
:0
root@pysoft:/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test3# xrandr
Invalid MIT-MAGIC-COOKIE-1 keyCan’t open display :0
root@pysoft:/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test3# export DISPLAY=:1
root@pysoft:/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test3# xrandr
Screen 0: minimum 8 x 8, current 1440 x 900, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 410mm x 260mm
1440x900 59.89*+ 74.98
1920x1080 59.94
1280x1024 75.02 60.02
1280x960 60.00
1280x720 59.94
1152x864 75.00
1024x768 75.03 70.07 60.00
800x600 75.00 60.32 56.25
720x480 59.94 59.94
640x480 75.00 59.94
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)

Can you share how you install the display driver?

step1: install display driver
NVIDIA-Linux-x86_64-450.51.run is installed.
sudo ./NVIDIA-Linux-x86_64-450.51.run

step2: install cuda
sudo dpkg -i cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda

sudo dpkg -i cuda-repo-ubuntu1804-10-2-local_10.2.1-1_amd64
sudo dpkg -i cuda-repo-ubuntu1804-10-2-local_10.2.2-1_amd64

after step1, nvidia-smi show that verison of display driver is 450.51.
however, after step2, nvidia-smi show that verison of display driver is 440.33.01.

I find post suffix of cuda10.2 is 440.33.01, but I just see the only cuda10.2 version.

please make sure cuda version and display driver version match. try with cuda 11.0.2

wget http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run
sudo sh cuda_11.0.2_450.51.05_linux.run

Thanks for your help. It works. but I still have a question how to save image based on deepstream-test3 with gtx1660.
Before, I use below code to sucess to save opencv Mat with jetson nano. Now, how should I do. Thank you!

  • GstPadProbeReturn nvosd_src_pad_buffer_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_data)

  • {

  • GstBuffer *buf = (GstBuffer *)info->data;
    
  • NvDsMetaList *l_frame = NULL;
    
  • NvDsMetaList *l_user_meta = NULL;
    
  • GstMapInfo in_map_info;
    
  • char *src_data = NULL;
    
  • if (!gst_buffer_map(buf, &in_map_info, GST_MAP_READ))
    
  • {
    
  •     g_print("Error: Failed to map gst buffer\n");
    
  •     gst_buffer_unmap(buf, &in_map_info);
    
  •     return GST_PAD_PROBE_OK;
    
  • }
    
  • NvBufSurface *surface = (NvBufSurface *)in_map_info.data;
    
  • NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta(buf);
    
  • for (l_frame = batch_meta->frame_meta_list; l_frame != NULL; l_frame = l_frame->next)
    
  • {   
    
  •     NvDsFrameMeta *frame_meta = (NvDsFrameMeta *)(l_frame->data);
    
  •     src_data = (char *)malloc(surface->surfaceList[frame_meta->batch_id].dataSize);
    
  •     if (src_data == NULL)
    
  •     {
    
  •         g_print("Error: failed to malloc src_data \n");
    
  •         continue;
    
  •     }
    
  •     NvBufSurfaceMap(surface, -1, -1, NVBUF_MAP_READ);
    
  •     NvBufSurfacePlaneParams *pParams = &surface->surfaceList[frame_meta->batch_id].planeParams;
    
  •     unsigned int offset = 0;
    
  •     for (unsigned int num_planes = 0; num_planes < pParams->num_planes; num_planes++)
    
  •     {
    
  •         if (num_planes > 0)
    
  •             offset += pParams->height[num_planes - 1] * (pParams->bytesPerPix[num_planes - 1] * pParams->width[num_planes - 1]);
    
  •         for (unsigned int h = 0; h < pParams->height[num_planes]; h++)
    
  •         {
    
  •             memcpy((void *)(src_data + offset + h * pParams->bytesPerPix[num_planes] * pParams->width[num_planes]),
    
  •                    (void *)((char *)surface->surfaceList[frame_meta->batch_id].mappedAddr.addr[num_planes] + h * pParams->pitch[num_planes]),
    
  •                    pParams->bytesPerPix[num_planes] * pParams->width[num_planes]);
    
  •         }
    
  •     }
    
  •     NvBufSurfaceSyncForDevice(surface, -1, -1);
    
  •     NvBufSurfaceUnMap(surface, -1, -1);
    
  •     gint frame_width = (gint)surface->surfaceList[frame_meta->batch_id].width;
    
  •     gint frame_height = (gint)surface->surfaceList[frame_meta->batch_id].height;
    
  •     gint frame_step = surface->surfaceList[frame_meta->batch_id].pitch;
    
  •     cv::Mat frame = cv::Mat(frame_height, frame_width, CV_8UC4, src_data, frame_step);
    
  •     cv::Mat out_mat = cv::Mat(cv::Size(frame_width, frame_height), CV_8UC3);
    
  •     cv::cvtColor(frame, out_mat, COLOR_RGBA2BGR);
    
  • if (src_data != NULL)

  •     {
    
  •         free(src_data);
    
  •         src_data = NULL;
    
  •     }
    
  • }
    
  • gst_buffer_unmap(buf, &in_map_info);
    
  • return GST_PAD_PROBE_OK;
    
  • }

Hi,
Please refer to this topic, there one workable save image for dGPU.
RTSP camera access frame issue - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums