Opengles2 sample under X11: binary version works, freshly built - does not

Please provide the following info (check/uncheck the boxes after creating this topic):
Software Version
DRIVE OS Linux 5.2.6
[*] DRIVE OS Linux 5.2.6 and DriveWorks 4.0
DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version

Target Operating System
[*] Linux

Hardware Platform
NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
[*] NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)

SDK Manager Version

Host Machine Version
[*] native Ubuntu 18.04

I have a freshly updated DRIVE AGX with GUI installed (GDM3, Unity) which I’m using remotely (XRDP).
The provided OpenGL example works fine:

nvidia@tegra-ubuntu:~$ drive-t186ref-linux/samples/opengles2/gears/x11/gears
libEGL warning: DRI2: failed to authenticate
 running for 5.000000 seconds...
Total FPS: 161.600006

Obviously, the performance is not great but it works and I can see the three gears rotating.

However, when the same sample does not work if I built it on my own:

nvidia@tegra-ubuntu:~$ ./gears
EGL failed to obtain display.
Usage: gears [options] [runtime]
< ... skip ... >

I built this sample using NVIDIA instructions (which are trivial) without any changes.
Log: make_gears_log (13.0 KB)

Looking at strace output I can see that the working version uses, and but the version built only uses libEGL_nvidia.

It looks like the X11 version was linked not against the generic X11 library but with Nvidia version.
BTW: if I have a monitor connected and it has a GUI on it then my gears app runs within remote window but shows results on the monitor.

Could you please ask your development team to provide a fix to the the built version running in the same way the pre-installed one does?

Dear @user28207,
Did you check ldd output to confirm the linked libs for both? May I know how you confirmed it?

I notice the below linking using ldd on preinstalled binary

nvidia@tegra-ubuntu:~/drive-t186ref-linux/samples/opengles2/gears/x11$ ldd gears (0x0000007fa424c000) => /usr/lib/aarch64-linux-gnu/ (0x0000007fa41e9000) => /usr/lib/aarch64-linux-gnu/ (0x0000007fa41b3000) => /usr/lib/aarch64-linux-gnu/ (0x0000007fa408a000) => /lib/aarch64-linux-gnu/ (0x0000007fa405e000) => /lib/aarch64-linux-gnu/ (0x0000007fa3fa5000) => /lib/aarch64-linux-gnu/ (0x0000007fa3e4b000) => /usr/lib/aarch64-linux-gnu/ (0x0000007fa3d1f000) => /lib/aarch64-linux-gnu/ (0x0000007fa3d0a000)
	/lib/ (0x0000007fa4221000) => /usr/lib/aarch64-linux-gnu/ (0x0000007fa3cda000) => /usr/lib/aarch64-linux-gnu/ (0x0000007fa3cc7000) => /usr/lib/aarch64-linux-gnu/ (0x0000007fa3cb2000) => /lib/aarch64-linux-gnu/ (0x0000007fa3c90000)

@SivaRamaKrishnaNV , I used strace and grep its output for all lib:

strace ./gears 2>&1 | grep lib

Dear @user28207,
I notice strace and ldd outputs of shipped and cross compile sample are different. Could you share the strace and ldd command outputs of shipped and cross compile sample on your side?

Hi @SivaRamaKrishnaNV , here we are: the outputs from strace and ldd commands for the shipped (suffix _good) and cross-compiled (suffix _bad) versions:
ldd_bad (2.1 KB)
ldd_good (1.1 KB)
strace_bad (36.0 KB)
strace_good (1.3 MB)

Dear @SivaRamaKrishnaNV , was there any update on that issue? Do you need any other pieces of information?

Dear @user28207,
I could reproduce the issue and waiting for update from team. Does this issue block your developement?

Dear @SivaRamaKrishnaNV , no, I’m not blocked, thank you for asking. Looking forward for the update from the team. Thanks!

Dear @user28207,
Could you run export DISPLAY=:0 before running the gears executable.

Dear @SivaRamaKrishnaNV ,
Unfortunately, I don’t have access to this setup anymore. But I will do that for sure when it is going to be available.