Unable to use deepstream-test1-app on NGC 6.0-devel container

Please provide complete information as applicable to your setup.

**• Hardware Platform **
x86/64 RTX3060
• DeepStream Version
deepstream6.0
• TensorRT Version
8.0.1
**• NVIDIA GPU Driver Version **
470.86
• 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)
xhost +
docker run --gpus all -it -p 8889:8888 -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/bigmao/Downloads:/opt/nvidia/deepstream/deepstream-6.0/Downloads -e DISPLAY=$DISPLAY -w /opt/nvidia/deepstream/deepstream-6.0 nvcr.io/nvidia/deepstream:6.0-devel

python3 -m pip install jupyterlab

cd sources/apps/sample_apps/deepstream-test1
export CUDA_VER=11.4
make

./deepstream-test1-app /opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_720p.h264

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

The following errors are reported:
Now playing: /opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_720p.h264
libEGL warning: DRI2: failed to authenticate
0:00:02.011994838 42 0x557dd9d82b90 INFO nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1900> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-6.0/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:02.012058140 42 0x557dd9d82b90 INFO nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2004> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-6.0/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine

0:00:02.012836196 42 0x557dd9d82b90 INFO nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus: [UID 1]: Load new model:dstest1_pgie_config.txt sucessfully
Running…

cuGraphicsGLRegisterBuffer failed with error(219) gst_eglglessink_cuda_init texture = 1
Frame Number = 0 Number of objects = 13 Vehicle Count = 9 Person Count = 4
0:00:02.250050189 42 0x557dd877f140 WARN nvinfer gstnvinfer.cpp:2288:gst_nvinfer_output_loop: error: Internal data stream error.
0:00:02.250083745 42 0x557dd877f140 WARN nvinfer gstnvinfer.cpp:2288: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(2288): 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 = 11 Vehicle Count = 8 Person Count = 3
Frame Number = 2 Number of objects = 11 Vehicle Count = 7 Person Count = 4
Frame Number = 3 Number of objects = 11 Vehicle Count = 7 Person Count = 4
Frame Number = 4 Number of objects = 11 Vehicle Count = 8 Person Count = 3
Frame Number = 5 Number of objects = 12 Vehicle Count = 8 Person Count = 4
Frame Number = 6 Number of objects = 11 Vehicle Count = 7 Person Count = 4
Deleting pipeline

Update it!
When I install deepstream6.0 on my physical host ,the same error happening when using the sample-test1

I changed sink element to fakesink,then everything look good.It seems that a dependency is missing from my environment

cuGraphicsGLRegisterBuffer failed with error(219) gst_eglglessink_cuda_init texture = 1

Did you install cuda driver?

yes sir,
I installed cuda dirver following the:CUDA Toolkit 11.4 Update 1 Downloads | NVIDIA Developer

cudaErrorInvalidGraphicsContext = 219

ok. can you specify how you install display driver?

OK,sir!
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ ubuntu-drivers devices

$sudo ubuntu-drivers autoinstall

Please download nvidia driver from nvidia websites and install.
https://www.nvidia.com/Download/index.aspx

phew!That’s not easy. Using NVIDIA’s official driver made my ubuntu system stuck in login.

It took me a day to restore the system. At present, deepstream can work in the container, but it cannot display the output on the host.

However, when I execute the xarclock command in the container, I can see the application interface.here is my command:
xhost +
docker run --gpus all -it -p 8889:8888 -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/bigmao/Downloads:/opt/nvidia/deepstream/deepstream-6.0/Downloads -e DISPLAY=$DISPLAY -w /opt/nvidia/deepstream/deepstream-6.0 nvcr.io/nvidia/deepstream:6.0-devel

$ echo $DISPLAY
:0

Did you export DISLAY=:0 or 1 on the host?
xrandr // to check display exported or not.

On the container


On my host

Actually, I don’t have access to the monitor on the server. I use IPMI system to display.I don’t know if that will have an impact

ok. so you connect to desktop via 3rdparty software like vnc or some others? if so that should be fine.
can you get the display through xrandr in the container?
How about not run export DISPLAY in host, and remove option in docker command -e DISPLAY=$DISPLAY?

run xrandr got this:
bash: xrandr: command not found

I installed it with : apt-get install x11-xserver-utils
run xrandr

I still think the problem lies in the host server. Because this problem consumes too much energy, I also deployed deepstream SDK on the host server.

After running test1 app in host, I found the following problems.

The screen is not displayed. At present, test1 app running fine in the container(but no screen output).I find the sink element is fakesink,Sorry! I made a mistake. In fact, the container is also abnormal
Then I created a new container ,run the test1 app and get the same error

I see you got login issue after install nvidia display driver, did the login issue solved? you still have nvidia driver installation issue from the log you pasted.

cudaErrorInvalidGraphicsContext = 219
This indicates an error with the OpenGL or DirectX context.


The login issue has been solved. Do I have to install this version of the driver?

You should install according version driver according to your GPU card series.

Can you specify how you install driver? did it prompt anything like opengl***?

Sorry for the late reply. I’ve been studying the code details these two days.

I use the following command to install the driver:
sudo apt purge nvidia-*
sudo apt-get autoremove
sudo nvidia-uninstall

systemctl stop gdm3
systemctl isolate multi-user.target
modprobe -r nvidia-drm

sudo ./NVIDIA-Linux-x86_64-470.94.run

Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later??
no
Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up.
yes

systemctl start graphical.target
systemctl restart gdm3
sudo init 6

There are also suggestions on the stackoverflow to install driver with parameters:
sudo ./xxxx.run -no-x-check -no-nouveau-check -no-opengl-files

I’m not sure,since the login issue I don’t want to operate too much recently.

Except these two prompts, did it prompt anything like opengl***?

There is no prompt about opengl***
I used a new server to debug,When the official website driver is installed, there will be a login issue。The OS version is Ubuntu 18.04 desktop and GPU is RTX 3060
Here is the information about current server wtih no login issue。