Host PC problem, with EGL when building the examples

Hi,

I have installed with SDK manager the DRIVE Software 10.0 and DRIVE OS version 5.1.6.1 on the AGX platform.
When I try to go to next step and build the code examples in the host PC in my home area, I get the following errors:

command: $cmake -DCMAKE_BUILD_TYPE=Release …

output: – The C compiler identification is GNU 7.5.0
– The CXX compiler identification is GNU 7.5.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc - works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ - works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found CUDA: /usr/local/cuda-10.2 (found version “10.2”)
– Found PkgConfig: /usr/bin/pkg-config (found version “0.29.1”)
– Could NOT find EGL (missing: EGL_LIBRARY)
– Looking for pthread.h
– Looking for pthread.h - found
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
– Looking for pthread_create in pthreads
– Looking for pthread_create in pthreads - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - found
– Found Threads: TRUE
– Building with TRT version and cudnn version 7.5.1.14
– Building GLFW for X11 (static)
– Found X11: /usr/include
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
– Driveworks Samples install dir: /home/zamanakos/nvidia_samples/build-x86/install
– Driveworks found at: /usr/local/driveworks-2.2/targets/x86_64-Linux
– Found Driveworks
– Configuring done
– Generating done
– Build files have been written to: /home/zamanakos/nvidia_samples/build-x86

and following, in the “$make -j” command, the output is:

[ 58%] Linking CXX shared library libsample_vehicleio_plugin.so
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
src/vehicleio_plugin/CMakeFiles/sample_vehicleio_plugin.dir/build.make:121: recipe for target ‘src/vehicleio_plugin/libsample_vehicleio_plugin.so’ failed
make[2]: *** [src/vehicleio_plugin/libsample_vehicleio_plugin.so] Error 1
CMakeFiles/Makefile2:3646: recipe for target ‘src/vehicleio_plugin/CMakeFiles/sample_vehicleio_plugin.dir/all’ failed
make[1]: *** [src/vehicleio_plugin/CMakeFiles/sample_vehicleio_plugin.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 59%] Linking CXX executable sample_hello_world
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
src/hello_world/CMakeFiles/sample_hello_world.dir/build.make:121: recipe for target ‘src/hello_world/sample_hello_world’ failed
make[2]: *** [src/hello_world/sample_hello_world] Error 1
CMakeFiles/Makefile2:3024: recipe for target ‘src/hello_world/CMakeFiles/sample_hello_world.dir/all’ failed
make[1]: *** [src/hello_world/CMakeFiles/sample_hello_world.dir/all] Error 2

I am demonstrating only a part of the output from make -j command. Let me know if you need the rest.

I have tried to install the following packages with sudo apt-get install as you suggested here: Nsight Eclipse IDE - ./sample_lane_detection fails

libx11-dev
libxrandr-dev
libxcursor-dev
libxxf86vm-dev
libxinerama-dev
libxi-dev
libglu1-mesa-dev
libglew-dev
libgles2-mesa-dev

but the issue remains.

The host machine is Ubuntu 18.04 with a GeForce GTX 750 installed. The cuda version is the 10.2 as installed from the SDK manager.

Please provide the following info (check/uncheck the boxes after clicking “+ Create Topic”):
Software Version
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
other

Target Operating System
Linux
QNX
other

Hardware Platform
NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other

SDK Manager Version
1.5.0.7774
other

Host Machine Version
native Ubuntu 18.04
other

Hi @gzamanak ,

I presume you built for host instead of target.
Did you follow the steps in /usr/local/driveworks/doc/nvsdk_html/dwx_samples_building_x86.html on your host?

Hi @VickNV ,

Yes, the problem regards the host PC.

I did the following steps as mentioned in the guide:
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release /path/to/driveworks/samples/folder
$ make -j

and the output of the last two commands is in my initial post.

Please see if the topic helps on your problem.

The following is my working cmake output. FYR.

– The C compiler identification is GNU 7.5.0
– The CXX compiler identification is GNU 7.5.0
– Check for working C compiler: /usr/bin/gcc
– Check for working C compiler: /usr/bin/gcc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/g++
– Check for working CXX compiler: /usr/bin/g++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found CUDA: /usr/local/cuda (found version “10.2”)
– Found PkgConfig: /usr/bin/pkg-config (found version “0.29.1”)
– Found EGL: /usr/lib/x86_64-linux-gnu/libEGL.so
– Found /usr/lib/x86_64-linux-gnu/libEGL.so:
– - Includes: [/usr/include]
– - Libraries: [/usr/lib/x86_64-linux-gnu/libEGL.so]
– DW_EXPERIMENTAL_FORCE_EGL not set, EGL Support Disabled
– Looking for pthread.h
– Looking for pthread.h - found
– Looking for pthread_create
– Looking for pthread_create - not found
– Looking for pthread_create in pthreads
– Looking for pthread_create in pthreads - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - found
– Found Threads: TRUE
– Building with TRT version and cudnn version 7.5.1.14
– Building GLFW for X11 (static)
– Found X11: /usr/include
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
– Driveworks Samples install dir: /home/vyu/Downloads/build/install
– Driveworks found at: /usr/local/driveworks-2.2/targets/x86_64-Linux
– Found Driveworks
– Configuring done
– Generating done
– Build files have been written to: /home/vyu/Downloads/build

Hi @VickNV ,
Thank you for your help!

In my /usr/lib/x86_64-linux-gnu folder, I was missing both the files libEGL.so and libGL.so, but I have the libEGL.so.1, libEGL.so.1.0.0 and libGL.so.1, libGL.so.1.0.0 files.

The libEGL.so file is needed for the “$cmake -DCMAKE_BUILD_TYPE=Release …” command and the libGL.so file is needed for the “$make -j” command.

To solve the issue, I created two new softlinks for libEGL.so and libGL.so with the two following commands:
$sudo ln -s /usr/lib/x86_64-linux-gnu/libEGL.so.1.0.0 /usr/lib/x86_64-linux-gnu/libEGL.so
and
$sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0 /usr/lib/x86_64-linux-gnu/libGL.so

Now there are no errors and everything is built properly, so this issue is now solved!

Good to hear your problem was fixed.