jetson.utils.glDisplay terminates right away without error

Hi,

I have followed dusty-nv’s GitHub to setup and successfully ran the detectnet-console.py script. However, I am not able to use show the GL window by glDisplay. There is no error message but the script terminates right away. There are only 3 lines of log from gl-display-test.py.

./gl-display-test.py
Namespace(a=0.0, b=0.25, g=0.75, r=0.0, title=‘Test OpenGL Display Window’)
[OpenGL] glDisplay – X screen 0 resolution: 1920x1080
[OpenGL] glDisplay – X window resolution: 1280x720
[OpenGL] glDisplay – display device initialized (1280x720)

I am using a Xavier NX (L4T 32.4.3), it looks like display.IsOpen() is never true.

Hi,
Not sure but you probably don’t set export DISPLAY=:0(or 1). If you don’t have any modification to the sample, it should work fine.

I have tried playing with DISPLAY=:0 (or 1). While I use 1 will give X11 error, 0 will give no error but the program still returns right away. I have tried the camera-viewer.py and I experienced similar, below is the output:

./camera-viewer.py ** I have not changed anything of the script
Namespace(camera=‘0’, height=720, width=1280)
[OpenGL] glDisplay – X screen 0 resolution: 1920x1080
[OpenGL] glDisplay – X window resolution: 1920x1080
[OpenGL] glDisplay – display device initialized (1920x1080)
[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstCamera – attempting to create device csi://0
[gstreamer] gstCamera pipeline string:
[gstreamer] nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=30/1, format=(string)NV12 ! nvvidconv flip-method=2 ! video/x-raw ! appsink name=mysink
[gstreamer] gstCamera successfully created device csi://0
[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter1
[gstreamer] gstreamer changed state from NULL to READY ==> nvvconv0
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0
[gstreamer] gstreamer changed state from NULL to READY ==> nvarguscamerasrc0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter1
[gstreamer] gstreamer changed state from READY to PAUSED ==> nvvconv0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> nvarguscamerasrc0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer message new-clock ==> pipeline0
[gstreamer] gstreamer message stream-start ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> nvvconv0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> nvarguscamerasrc0
[gstreamer] gstCamera – stopping pipeline, transitioning to GST_STATE_NULL
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 4
Output Stream W = 1280 H = 720
seconds to Run = 0
Frame Rate = 120.000005
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success
[gstreamer] gstCamera – pipeline stopped

Are you running this directly from the GUI? If so, then use “echo $DISPLAY” to see if it is “:0” or “:1”. Any time you run a GUI (or GPU related) program on any command line, then if you first export DISPLAY=":0" (or whichever the echo showed), and when logged in as the same user, the program should bind to that display (which is why the environment variable has name DISPLAY`).

If you are running your command within the GUI, then you don’t need to “export DISPLAY=”, as this is already set correctly.

If you use ssh, and want to display to that display of the Nano, then be sure you do not use the “-Y” or “-X” option to ssh, but do use the “export DISPLAY=...” prior to running your command.

If you are in doubt, then test with another GUI program. For example:

export DISPLAY=":0"
xterm

If other programs correctly display, then you know the other command has something more than a DISPLAY mismatch going on.

Note that X server logs are named after that same DISPLAY, e.g., “/var/log/Xorg.0.log” is for DISPLAY of “:0”.