Trying to build opencv_contrib ran into issue of not finding So went to /usr/lib/aarch64-linux-gnu dir and sure enough the softlink was bad. There is no in the tegra directory. Jetpack 4.1.


This is a known issue.
The root cause is that OpenCV includes the headers in an improper order.

It should like this:

# include <GL/gl.h>
# include <cuda_gl_interop.h>

Please check this topic for the solution:


I checked that .h file its correct on cuda 10 on Xavier. What is missing is the actual

Do you have package “libgl1” and “libglvnd-dev” installed? R31.x should have the following provided by that package (either as a file or a sym link to the file):

# dpkg -S /usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu/
libglvnd-dev:arm64: /usr/lib/aarch64-linux-gnu/
libgl1:arm64: /usr/lib/aarch64-linux-gnu/
libgl1:arm64: /usr/lib/aarch64-linux-gnu/

It does seem odd that the “” symbolic link is provided by a different package than the hard link, but that’s part of how Ubuntu 18.04 is packaged. Not sure why it was done that way.

What about using this command ?

sudo ln -s /usr/lib/aarch64-linux-gnu/ /usr/

@ToTheFuture: That location will not work. Perhaps you’re suggesting symlinking to /usr/lib/ ?
However, libraries in /usr/lib/aarch64-linux-glu/ will be picked up by the linker if present.
If you think they’re not being found, “sudo ldconfig” should fix that right up.


We cannot reproduce this issue on environment.

1. Flash Xavier with JetPack4.1:

2. is in our ‘/usr/lib/aarch64-linux-gnu’ folder.
nvidia@jetson-0422418042099:/usr/lib/aarch64-linux-gnu$ ll*
lrwxrwxrwx 1 root root 14 Jun 5 14:16 ->
lrwxrwxrwx 1 root root 14 Jun 5 14:16 ->
-rw-r–r-- 1 root root 972968 Jun 5 14:16

Could you re-flash your device to see if any helps?

Thought it was in the tegra folder. I used the one you refer too and successfully built opencv 3.4. Its always been in the tegra folder on previous machines.

I’m building a docker image for my Jetson AGX. The Jetson AGX Jetpack 4.1.1 OS image is based on Ubuntu-18.04, but the docker image that I need is based on Ubuntu-16.04 due to compatibility reasons for running ROS Kinetic.

I’m currently missing the files in my root filesystem. I have manually applied the driver binaries using the script to an arm64v8/ubuntu:xenial base image using the latest JetPack 4.1.1 driver downloaded from the following location:

The file exists in the 1.1GB rootfs image, but that is for Ubuntu-18.04. Is it possible to get the file for Ubuntu-16.04?

Xavier was never released with 16.04. On the other hand, the base architecture of the TX2 might work, and you could get that from the step of L4T R28.2.1 (if you know which tar file it is in you could just extract that file). I won’t guarantee it works, but you might try that. The R28.2.1 download page is:
(you might need to go there, log in, and then hit the URL a second time before you can see the content)

Thanks. A quick look at one of the earlier JetPack 3.2.1 releases for the tegra driver package shows that and other files are indeed present. I’ll try to build an Ubuntu-16.04 docker image file and see if those driver libraries work on the Jetson AGX.

On a related note, I tried building an Ubuntu-18.04 docker image but the JetPack-4.4.1 supplied tegra driver library does have and other associated files. How can I get the Tegra specific files for Ubuntu-18.04 for Jetson AGX? I think the problem that I’m getting with the Ubuntu-18.04 might be because the current are not provided by tegra but by the mesa Would you happen to know how OpenGL support is supposed to be setup for a new SoC like the Tegra, so that I can build a working Ubuntu-18.04 docker image?

I’ve created a separate post about it here:

I built a docker image using Ubuntu-16.04 and the nvidia drivers contained in the Tegra186_Linux_R28.2.1_aarch64.tbz2 package, and tried to run the image on the Jetson AGX. It still gives me the following error, which correct me if I am wrong is probably related to the nvidia drivers being present in the docker image, but cannot find the GPU ?

LIBGL_DEBUG=verbose glxgears
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  27
  Current serial number in output stream:  28

Are the following /dev nodes the only ones required for GPU control, and used by the Tegra graphics driver, or are more required for the Jetson AGX GPU for control by the tegra driver?

--device /dev/nvhost-as-gpu \
  --device /dev/nvhost-ctrl \
  --device /dev/nvhost-ctrl-gpu \
  --device /dev/nvhost-ctxsw-gpu \
  --device /dev/nvhost-dbg-gpu \
  --device /dev/nvhost-gpu \
  --device /dev/nvhost-prof-gpu \
  --device /dev/nvhost-sched-gpu \
  --device /dev/nvhost-tsg-gpu \
  --device /dev/nvmap \

This is the output of various environment libraries and location of various files in my Ubuntu-16.04 docker image:


$ cd /usr
$ find . -name libGL*

I additionally ran the CUDA deviceQuery sample from within the container and it confirms that the GPU is inaccessible.

./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL

I’ve posted the solution for getting an OpenGL docker image with Ubuntu-16.04 and JetPack-4.4.1 for the Jetson AGX platform here:

Just a thought on the topic which might help in the future. “libgl” is probably distributed in other packages, but “libglx” is specific to the GPU and is a custom file provided by the L4T install (L4T copies this into the sample rootfs). You’ll note that the files specific to the particular Jetson release have checksums listed in “/etc/nv_tegra_release”, and that is provided by NVIDIA, but is not.

libGLX is tied to an ABI in Xorg, and so this is dependent on being both a match to the GPU and to the Xorg ABI. For example:

egrep 'Video Driver:' /var/log/Xorg.0.log

(if one were to port, then Xorg would also have to be ported such that the ABI matches)

Sometimes (not often) a mesa package can overwrite the within the Xorg file tree. On the other hand, the “/usr/lib/aarch64-linux-gnu/tegra/” is untouched by any mesa package, and is a duplicate of the Xorg one. In the case of a failure just copy from the bad location to the good location. Running “sha1sum -c /etc/nv_tegra_release” will indicate which is the bad version and which is the good version.