From 3fd36c1be1b2ee9187c5ee7e7cd6ee0680a00889 Mon Sep 17 00:00:00 2001 From: Marcin Tolysz Date: Wed, 9 Oct 2019 09:38:10 +0100 Subject: [PATCH] Merge pull request #15658 from tolysz:patch-1 * Cuda + OpenGL on ARM There might be multiple ways of getting OpenCV compile on Tegra (NVIDIA Jetson) platform, but mainly they modify CUDA(8,9,10...) source code, this one fixes it for all installations. ( https://devtalk.nvidia.com/default/topic/1007290/jetson-tx2/building-opencv-with-opengl-support-/post/5141945/#5141945 et al.). This way is exactly the same as the one proposed but the code change happens in OpenCV. * Updated, The link provided mentions: cuda8 + 9, I have cuda 10 + 10.1 (and can confirm it is still defined this way). NVIDIA is probably using some other "secret" backend with Jetson. --- modules/core/src/opengl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/core/src/opengl.cpp b/modules/core/src/opengl.cpp index 14f5588680..dd6f23862b 100644 --- a/modules/core/src/opengl.cpp +++ b/modules/core/src/opengl.cpp @@ -45,6 +45,13 @@ #ifdef HAVE_OPENGL # include "gl_core_3_1.hpp" # ifdef HAVE_CUDA +# if (defined(__arm__) || defined(__aarch64__)) \ + && !defined(OPENCV_SKIP_CUDA_OPENGL_ARM_WORKAROUND) +# include +# ifndef GL_VERSION +# define GL_VERSION 0x1F02 +# endif +# endif # include # endif #else // HAVE_OPENGL