[ERROR] (NvEglRenderer.cpp:204) <renderer0> Unable to initialize egl library

hello, I log in to jetson tx2 remotely and execute the program which fetch stream to play the video, but it was faild which the reason “[ERROR] (NvEglRenderer.cpp:204) Unable to initialize egl library”,When I execute this program directly on TX2, it plays well, Do you know what the problem is ?

Hi,
Maybe you simply miss

$ export DISPLAY=:1

after use “export DISPLAY=:1”, it has a new error ,“[ERROR] (NvEglRenderer.cpp:97) Error in opening display”,tx2 is connected to monitor, I’m connecting to TX2 remotely via CRT, and then starting the program, Is this not supported?

Hi,
Please also try

$ export DISPLAY=:0

It should work fine if you log in via ssh and export DISPLAY correctly.

It still doesn’t work,The running information is as follows
root@tegra-ubuntu:/sunmnet/bin# export DISPLAY=:0
root@tegra-ubuntu:/sunmnet/bin# ./recordmain.bin
Creating a logger for file “/sunmnet/html/log/server_2019513174317.log”
No protocol specified
[ERROR] (NvEglRenderer.cpp:97) Error in opening display
[ERROR] (NvEglRenderer.cpp:152) Got ERROR closing display
Failed to query video capabilities: Inappropriate ioctl for device
NvMMLiteOpen : Block : BlockType = 4
===== MSENC =====

If you run a program directly on a Jetson with a GUI session open, then the GPU and software on the Jetson itself automatically associates with that display. The export of “:0” or “:1” is an example of manually associating a display (sometimes the display is “:0”, other times it is “:1”…depends on which release). When using remote network access, then the export is used because association is not automatic, but you still need a GUI running on the Jetson.

If you want to have the software run on the Jetson and use the Jetson’s GPU from a remote login, then you need to install a virtual X server. When you log in remotely and associate with “export DISPLAY=” type setup the software won’t care that it is a virtual GUI and not a real GUI.

Also, this need for an X display is not entirely as the name suggests…X is used for more than display. X is a protocol and is what the GPU driver loads into. Things like windows and toolbars are not provided by X, that is the window manager. So don’t think of “X11” as the window environment, it is not…X11 provides the support and protocols which allow software like window managers and much of the CUDA software to talk to the GPU.

If you run a command on your host PC while logged in remotely to the Jetson, then it can be possible to forward X events to your host PC and let the PC do the graphics and CUDA work…but then all requirements go to the host PC instead of the Jetson, and the Jetson GPU is ignored.

Hi,
On r28.3, please log in with user nvidia.

$ ssh nvidia@10.19.106.112
nvidia@10.19.106.112's password:
Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.159-tegra aarch64)

 * Documentation:  https://help.ubuntu.com/

697 packages can be updated.
400 updates are security updates.

New release '18.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Last login: Tue May 14 01:34:04 2019 from 10.19.92.235
nvidia@jetson-0321117079444:~$ export DISPLAY=:0
nvidia@jetson-0321117079444:~$ ./tegra_multimedia_api/samples/00_video_decode/video_decode H264 ./tegra_multimedia_api/data/Video/sample_outdoor_car_1080p_10fps.h264
Set governor to performance before enabling profiler
Creating decoder in blocking mode
Failed to query video capabilities: Inappropriate ioctl for device
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
TVMR: NvMMLiteTVMRDecBlockOpen: 7648: NvMMLiteBlockOpen
NvMMLiteBlockCreate : Block : BlockType = 261
Starting decoder capture loop thread
TVMR: cbBeginSequence: 1179: BeginSequence  1920x1088, bVPR = 0
TVMR: LowCorner Frequency = 0
TVMR: cbBeginSequence: 1529: DecodeBuffers = 5, pnvsi->eCodec = 4, codec = 0
TVMR: cbBeginSequence: 1600: Display Resolution : (1920x1080)
TVMR: cbBeginSequence: 1601: Display Aspect Ratio : (1920x1080)
TVMR: cbBeginSequence: 1669: ColorFormat : 5
TVMR: cbBeginSequence:1683 ColorSpace = NvColorSpace_YCbCr601
TVMR: cbBeginSequence: 1809: SurfaceLayout = 3
TVMR: cbBeginSequence: 1905: NumOfSurfaces = 12, InteraceStream = 0, InterlaceEnabled = 0, bSecure = 0, MVC = 0 Semiplanar = 1, bReinit = 1, BitDepthForSurface = 8 LumaBitDepth = 8, ChromaBitDepth = 8, ChromaFormat = 5
TVMR: cbBeginSequence: 1907: BeginSequence  ColorPrimaries = 2, TransferCharacteristics = 2, MatrixCoefficients = 2
Video Resolution: 1920x1080
[INFO] (NvEglRenderer.cpp:109) <renderer0> Setting Screen width 1920 height 1080
Input file read complete
TVMR: NvMMLiteTVMRDecDoWork: 6532: NVMMLITE_TVMR: EOS detected
Query and set capture successful
TVMR: FrameRate = 10.000000
TVMR: FrameRate = 10.000000
TVMR: FrameRate = 10.000000
TVMR: FrameRate = 10.000000
TVMR: TVMRBufferProcessing: 5487: Processing of EOS
TVMR: TVMRBufferProcessing: 5564: Processing of EOS Done
Exiting decoder capture loop thread
TVMR: TVMRFrameStatusReporting: 6133: Closing TVMR Frame Status Thread -------------
TVMR: TVMRVPRFloorSizeSettingThread: 5943: Closing TVMRVPRFloorSizeSettingThread -------------
TVMR: TVMRFrameDelivery: 5983: Closing TVMR Frame Delivery Thread -------------
TVMR: NvMMLiteTVMRDecBlockClose: 7816: Done
App run was successful