Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gl headers before including cuda_gl_interop.h #8883

Open
SheldonWBM opened this issue Feb 11, 2024 · 1 comment
Open

gl headers before including cuda_gl_interop.h #8883

SheldonWBM opened this issue Feb 11, 2024 · 1 comment

Comments

@SheldonWBM
Copy link

SheldonWBM commented Feb 11, 2024

I am trying to use the latest version (commit: 27b37bf) of Darknet on the Jetson Xavier AGX.
image
image

Upgraded both CUDA and OpenCV (as per the above screenshots).
When I try to build, using cmake, I have the following error.

In file included from /home/<user>/darknet/src/dark_cuda.h:38,
                 from /home/<user>/darknet/src/activations.h:4,
                 from /home/<user>/darknet/src/activation_layer.h:4,
                 from /home/<user>/darknet/src/activation_layer.c:1:
/usr/local/cuda-12.3/targets/sbsa-linux/include/cuda_gl_interop.h:63:2: error: #error Please include the appropriate gl headers before including cuda_gl_interop.h
   63 | #error Please include the appropriate gl headers before including cuda_gl_interop.h
      |  ^~~~~
compilation terminated due to -Wfatal-errors.
make[2]: *** [CMakeFiles/darknet.dir/build.make:90: CMakeFiles/darknet.dir/src/activation_layer.c.o] Error 1

I also have an error when I try make.
I have tried both within a docker container and directly on the host.

The previous version of darknet, commit: 59c8622, is still working properly (in a docker container with cuda 11.7).

@cenit
Copy link
Collaborator

cenit commented May 6, 2024

looks like a bug in the cuda_gl_interop.h distributed on your system?
what if you apply this patch?

diff --git a/src/dark_cuda.h b/src/dark_cuda.h
index ffe3836b..fad213c1 100644
--- a/src/dark_cuda.h
+++ b/src/dark_cuda.h
@@ -34,7 +34,7 @@ extern int gpu_index;
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #endif // _WIN32
-
+#include <GL/gl.h>
 #include <cuda_gl_interop.h>
 #endif // CUDA_OPENGL_INTEGRATION
 //#include <driver_types.h>

Repository owner deleted a comment from stephanecharette May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants