DeepStream4.0 container run test problem

I run below command on ubuntu 16.04+1080ti
xhost +
sudo docker run --gpus all -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=:0 -w /root -v /home/yangjeff/Deepstream:/root/Deepstream nvcr.io/nvidia/deepstream:4.0.1-19.09-devel /bin/bash
In the container:
cd deepstream_sdk_v4.0.1_x86_64/sources/apps/sample_apps/deepstream-test1
make

root@fffb3e25bbb7:~/deepstream_sdk_v4.0.1_x86_64/sources/apps/sample_apps/deepst
ream-test1# ls
Makefile deepstream-test1-app deepstream_test1_app.o
README deepstream_test1_app.c dstest1_pgie_config.txt

Then I run :

root@fffb3e25bbb7:~/deepstream_sdk_v4.0.1_x86_64/sources/apps/sample_apps/deepst
ream-test1# deepstream-test1-app /root/deepstream_sdk_v4.0.1_x86_64/samples/streams/sample_1080p_h264.mp4
Now playing: /root/deepstream_sdk_v4.0.1_x86_64/samples/streams/sample_1080p_h264.mp4
libEGL warning: DRI2: failed to authenticate
Creating LL OSD context new
0:00:00.244291338 822 0x55c1f7168440 INFO nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger: NvDsInferContext[UID 1]:initialize(): Trying to create engine from model files
0:00:08.583324340 822 0x55c1f7168440 INFO nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger: NvDsInferContext[UID 1]:generateTRTModel(): Storing the serialized cuda engine to file at /root/deepstream_sdk_v4.0.1_x86_64/samples/models/Primary_Detector/resnet10.caffemodel_b1_int8.engine
Running…

No error but no window display.
I tried :gst-launch-1.0 videotestsrc ! nveglglessink could display.

When I tried use another file .h264:
root@fffb3e25bbb7:~/deepstream_sdk_v4.0.1_x86_64/sources/apps/sample_apps/deepst
ream-test1# deepstream-test1-app /root/deepstream_sdk_v4.0.1_x86_64/samples/streams/sample_720p.h264
Now playing: /root/deepstream_sdk_v4.0.1_x86_64/samples/streams/sample_720p.h264
libEGL warning: DRI2: failed to authenticate
Creating LL OSD context new
0:00:00.249249047 844 0x562925d51640 INFO nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger: NvDsInferContext[UID 1]:initialize(): Trying to create engine from model files
0:00:08.583012758 844 0x562925d51640 INFO nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger: NvDsInferContext[UID 1]:generateTRTModel(): Storing the serialized cuda engine to file at /root/deepstream_sdk_v4.0.1_x86_64/samples/models/Primary_Detector/resnet10.caffemodel_b1_int8.engine
Running…
Creating LL OSD context new
cuGraphicsGLRegisterBuffer failed with error(304) gst_eglglessink_cuda_init texture = 1
Frame Number = 0 Number of objects = 5 Vehicle Count = 3 Person Count = 2
0:00:08.890750270 844 0x56291f81ed90 WARN nvinfer gstnvinfer.cpp:1830:gst_nvinfer_output_loop: error: Internal data stream error.
0:00:08.890759321 844 0x56291f81ed90 WARN nvinfer gstnvinfer.cpp:1830: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(1830): gst_nvinfer_output_loop (): /GstPipeline:dstest1-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 = 6 Vehicle Count = 4 Person Count = 2
Frame Number = 3 Number of objects = 6 Vehicle Count = 4 Person Count = 2
Frame Number = 4 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Frame Number = 5 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Frame Number = 6 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Frame Number = 7 Number of objects = 6 Vehicle Count = 4 Person Count = 2
Deleting pipeline

Use gst cmd also couldn’t work
root@fffb3e25bbb7:~/deepstream_sdk_v4.0.1_x86_64/sources/apps/sample_apps/deepst
ream-test1# gst-launch-1.0 filesrc location=/root/deepstream_sdk_v4.0.1_x86_64/samples/streams/sample_720p.h264 ! h264parse ! nvv4l2decoder ! .sink_0 nvstreammux batch-size=1 width=1280 height=720 ! nvvideoconvert ! nveglglessink
Setting pipeline to PAUSED …
libEGL warning: DRI2: failed to authenticate
Pipeline is PREROLLING …
Got context from element ‘eglglessink0’: gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
cuGraphicsGLRegisterBuffer failed with error(304) gst_eglglessink_cuda_init texture = 1
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
Freeing pipeline …

From error log - cuGraphicsGLRegisterBuffer failed with error(304) , seems you run into the same issue as - Deepstream2.0 samples is not getting compiled! It shows some failure due to gstreamer

Could you check ?

Thanks!

Hi mchi,
Thank you for your reply.
I checked lsmod | grep nouveau and nothing show.
Actually I could run
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2, width=640, height=480, framerate=25/1 ! videoconvert ! “video/x-raw, format=NV12” ! nvvideoconvert ! nveglglessink –e
But when I couldn’t run below pipeline :
gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw,format=YUY2, width=640, height=480, framerate=25/1” ! videoconvert ! “video/x-raw,format=NV12,width=640, height=480, framerate=25/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM),width=640, height=480, framerate=25/1, format=NV12” ! nveglglessink –e
Got context from element ‘eglglessink0’: gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING …
New clock: GstSystemClock
cuGraphicsGLRegisterBuffer failed with error(304) gst_eglglessink_cuda_init texture = 1
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.

And I found if I removed the “video/x-raw(memory:NVMM),width=640, height=480, framerate=25/1, format=NV12” ,it could run. I check gst-inspect-1.o nveglglessink, it showed it has the Capabilities:
video/x-raw(memory:NVMM)
format: { (string)BGRx, (string)RGBA, (string)I420, (string)NV12, (string)BGR, (string)RGB }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
So do you know why I couldn’t add this caps-filter before nveglgssink?

Hi Jeff_Bond,
Sorry for late!

Being trying to reproduce your issue, but meet some setup issue.

Could you share me the “nvidia-smi” output? And, could you also help check if replacing “video/x-raw(memory:NVMM)” with “video/x-raw”, can the pipeline run?

And, are you sure your system is using the GPU 1080Ti to render?

Thanks!

Hi mchi,
Thanks for your reply
Yes, if i replace with video/x-raw ,it could run.
gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw,format=YUY2, width=640, height=480, framerate=25/1” ! videoconvert ! “video/x-raw,format=NV12,width=640, height=480, framerate=25/1” ! nvvideoconvert ! “video/x-raw,width=640, height=480, framerate=25/1, format=NV12” ! nveglglessink –e

I also checked rtsp and fakesink,both could run. Maybe nveglglessink should run on gpu card but when the card is used by other plugin(e.g nvvideoconver) ,it meet issue. Is my understanding right.
Refer to https://elinux.org/Deepstream/FAQ
5A,
Additional:gst-launch-1.0 v4l2src ! nveglglessink —work ok
nvidia-smi
Fri Apr 3 01:09:55 2020
±----------------------------------------------------------------------------+
| NVIDIA-SMI 440.44 Driver Version: 440.44 CUDA Version: 10.2 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 108… Off | 00000000:01:00.0 On | N/A |
| 23% 31C P5 11W / 250W | 334MiB / 11177MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
±----------------------------------------------------------------------------+

HI Jeff_Bond,
I’m afraid your display does not do renderring on the 1080Ti GPU.
Below nvidia-smi log shows the Xorg running on GPU#1, but there is not display process on your GPU.

$ nvidia-smi
Fri Apr 3 09:47:52 2020
±----------------------------------------------------------------------------+
| NVIDIA-SMI 440.33.01 Driver Version: 440.33.01 CUDA Version: 10.2 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla T4 On | 00000000:03:00.0 Off | 0 |
| N/A 35C P8 15W / 70W | 0MiB / 15109MiB | 0% Default |
±------------------------------±---------------------±---------------------+
| 1 Tesla P4 On | 00000000:04:00.0 Off | 0 |
| N/A 26C P8 10W / 75W | 309MiB / 7611MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 1 4389 G /usr/lib/xorg/Xorg 176MiB |
| 1 5462 G compiz 132MiB |
±----------------------------------------------------------------------------+

Hi mchi,
Sorry for miss understanding,i run the nvidia-smi when not run displaying.
Ok , I run :gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=YUY2, width=640, height=480, framerate=25/1 ! videoconvert ! nvvideoconvert ! nveglglessink –e and input nvidia-smi
nvidia-smi
Fri Apr 3 10:26:52 2020
±----------------------------------------------------------------------------+
| NVIDIA-SMI 440.44 Driver Version: 440.44 CUDA Version: 10.2 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 108… Off | 00000000:01:00.0 On | N/A |
| 23% 37C P0 56W / 250W | 345MiB / 11177MiB | 9% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 27603 G /usr/lib/xorg/Xorg 332MiB |
±----------------------------------------------------------------------------+

So I think the display renderring on the gpu when the command could run .
Additional I could run deepstream-app -c source1_usb_dec_infer_resnet_int8.txt via rtsp and fakesink except nveglgssink. As my understanding, when the card used as compute card, it should use a virtual display.
If i am wrong,please correct it.