Building an OpenGL application

Hi!

I have the latest version of Jetpack (24.1), Jetson TX1.
When I try to build an OpenGL application with Nsight Eclipse on Jetson TX1, I get the following “undefined reference” errors. (On host side I can build it successfully.)

../arm-linux-gnueabihf/libGL.so: undefined reference to `drmMap'
../arm-linux-gnueabihf/libGL.so: undefined reference to `drmCloseOnce'
../arm-linux-gnueabihf/libGL.so: undefined reference to `drmUnmap'
../arm-linux-gnueabihf/libGL.so: undefined reference to `drmOpenOnce'
../arm-linux-gnueabihf/libGL.so: undefined reference to `drmCommandWriteRead'

With the previous version of Jetpack, I had no problem building the same program.

Could anyone help me to solve this problem, please?

Hi

We noticed that problem too, while compiling the CUDA samples.
Our solution was to change the Link of the GL library from pointing to “/usr/lib/aarch64-linux-gnu/mesa” to "/usr/lib/aarch64-linux-gnu/tegra.
The first path will be different, depending on your application.

cd /home/ubuntu/NVIDIA_CUDA-7.0_Samples/common/lib/linux/aarch64
rm libGL.so
sudo ln -s /usr/lib/aarch64-linux-gnu/tegra/libGL.so libGL.so

Hi!

You were right!
Changing directly the link file “libGL.so” in /usr/lib/arm-linux-gnueabihf/ to “/usr/lib/arm-linux-gnueabihf/tegra/libGL.so” solved my problem.

Thank you very much! :D

Hi blabla019 and kamm,

Thanks for raising this softlink problem, and given the solution.
We’re investigating this packaging issue to find out if there is way to blacklist mesa drivers.

Thanks

I have the same issue while trying to install gstreamer using:

gst-install --prefix=/home/ubuntu/gst-1.8.2 --version=1.8.2

I think I understand the fix, but cant find where libGL.so is referenced.

How should I install gstreamer on r24.1???

I had a similar issue however I was building dolphin emulator. My solution is similar to what has been presented. There seems to be an issue with the libGL.so provided by mesa. I successfully built dolphin emulator and executed ‘gst-install --prefix=/home/ubuntu/gst-1.8.2 --version=1.8.2’.

cd /usr/lib/aarch64-linux-gnu
sudo rm libGL.so
sudo ln -s /usr/lib/aarch64-linux-gnu/tegra/libGL.so libGL.so

Hopefully this helps in the meantime

This works for me, Thanks!

yet, there is another way

LIBRARIES += -lGL -lGLEW -lGLU -lglut -lX11 -ldrm

direct link the /usr/lib/aarch64-linux-gnu/tegra/libGL.so could disolve it, means, this library could talk to the kernel directly.