Deepstream-test1-app failed due to nveglglessink plugin error

When I run deepstream-test1-app, the error message is like this, it seems that it is related with nveglglessink plugin.

$ ./deepstream-test1-app …/…/…/…/samples/streams/sample_720p.h264
Now playing: …/…/…/…/samples/streams/sample_720p.h264
Creating LL OSD context new
0:00:01.988123903 1267 0xd13f840760 INFO nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger: NvDsInferContext[UID 1]:initialize(): Trying to create engine from model files
0:00:03.277800372 1267 0xd13f840760 WARN nvinfer gstnvinfer.cpp:515:gst_nvinfer_logger: NvDsInferContext[UID 1]:log(): TensorRT was compiled against cuBLAS 10.2.0 but is linked against cuBLAS 10.1.0
0:00:10.123438091 1267 0xd13f840760 WARN nvinfer gstnvinfer.cpp:515:gst_nvinfer_logger: NvDsInferContext[UID 1]:log(): TensorRT was compiled against cuBLAS 10.2.0 but is linked against cuBLAS 10.1.0
0:00:10.156944340 1267 0xd13f840760 INFO nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger: NvDsInferContext[UID 1]:generateTRTModel(): Storing the serialized cuda engine to file at /home/pengxihan/deepstream_sdk_v4.0.1_x86_64/samples/models/Primary_Detector/resnet10.caffemodel_b1_int8.engine
0:00:10.164632026 1267 0xd13f840760 WARN nvinfer gstnvinfer.cpp:515:gst_nvinfer_logger: NvDsInferContext[UID 1]:log(): TensorRT was compiled against cuBLAS 10.2.0 but is linked against cuBLAS 10.1.0
0:00:10.167444664 1267 0xd13f840760 WARN nvinfer gstnvinfer.cpp:515:gst_nvinfer_logger: NvDsInferContext[UID 1]:log(): TensorRT was compiled against cuBLAS 10.2.0 but is linked against cuBLAS 10.1.0
Running…
Creating LL OSD context new
cuGraphicsGLRegisterBuffer failed with error(999) gst_eglglessink_cuda_init texture = 1
Entering osd_sink_pad_buffer_probe
frame_meta = 0x7fd708009020
Frame Number = 0 Number of objects = 5 Vehicle Count = 3 Person Count = 2
0:00:10.860135129 1267 0xd13f75b190 WARN nvinfer gstnvinfer.cpp:1830:gst_nvinfer_output_loop: error: Internal data stream error.
0:00:10.860151744 1267 0xd13f75b190 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

But I use gst-launch command to test decoder and display, it works well.

$ gst-launch-1.0 filesrc location=/home/pengxihan/deepstream_sdk_v4.0.1_x86_64/samples/streams/sample_720p.h264 ! h264parse ! nvv4l2decoder drop-frame-interval=1 ! nvvideoconvert ! video/x-raw,width=1080,height=720,formate=I420 ! queue ! nveglglessink window-x=0 window-y=0 window-width=1080 window-height=720

gst command you used finally convert GPU buffer to CPU buffer for output onto display, while test1 sample finally output buffer from GPU onto display,
from your error,
cuGraphicsGLRegisterBuffer failed with error(999) gst_eglglessink_cuda_init texture = 1
you guess you do not install nvidia opengl while install display driver, am i right? if yes, please reinstall driver with nvidia opengl, and if your card is Tesla series, noted it’s compute card, not for display, you may follow this link for setting up virtual display, https://elinux.org/Deepstream/FAQ, another option, you may change sink type to Fakesink.