Cannot build OpenCV with OpenGL support on Orin Nano

Hi there,

I’m using a Jetson Orin Nano 8GB module flashed with Jetpack 6.1 and am attempting to install OpenCV 4.9.0 with OpenGL support. Is there anything I should know about this not working? I have attempted numerous builds and yet every “General Configuration” report that cmake displays, even after specifying -D WITH_OPENGL=ON in the cmake command, it ends up turning support off.

I made sure to install all dependencies, and even (after trying without the specific paths) specified the OpenGL libs specifically in my build flags:

cmake -D CMAKE_BUILD_TYPE=Release \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
      -D WITH_CUDA=ON \
      -D CUDA_ARCH_BIN=7.2 \
      -D WITH_CUDNN=ON \
      -D WITH_LIBV4L=ON \
      -D WITH_V4L=ON \
      -D BUILD_opencv_python2=OFF \
      -D BUILD_opencv_python3=ON \
      -D BUILD_opencv_apps=OFF \
      -D BUILD_opencv_ts=OFF \
      -D BUILD_opencv_js=OFF \
      -D BUILD_opencv_world=OFF \
      -D WITH_TBB=ON \
      -D OPENGL_gl_LIBRARY=/lib/aarch64-linux-gnu/ \
      -D OPENGL_glu_LIBRARY=/lib/aarch64-linux-gnu/ \
      -D OPENGL_opengl_LIBRARY=/usr/lib/aarch64-linux-gnu/ \
      -D OPENGL_glx_LIBRARY=/usr/lib/aarch64-linux-gnu/ \
      -D OPENGL_INCLUDE_DIR=/usr/include \
      -D WITH_QT=OFF \
      -D WITH_GTK=ON \
      -D WITH_EIGEN=ON \

I also attempted Qengineering’s script (Install-OpenCV-Jetson-Nano/ at main · Qengineering/Install-OpenCV-Jetson-Nano · GitHub) which I’ve had success with before, but added the “-D WITH_OPENGL=ON” flag to the build options.

After multiple builds, the configuration review at the end of the process shows “OpenGL Support: No”.

Any help would be hugely appreciated, as I am having trouble displaying my fullscreen application (using a OpenCV window set to fullscreen) without significant tearing and have seen evidence that using an OpenGL window may be the solution.

Thank you in advance.

We have tried to enable CUDA and there is a script:
JEP/script/ at master · AastaNV/JEP · GitHub

You may base on it to enable OpenGL and see if it works. We don’t have experience in this setup and it would need other users to share experience.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.