I have got the bazel GPU example working by following the instructions for the hello world example. (https://google.github.io/mediapipe/getting_started/install.html#installing-on-debian-and-ubuntu)
bazel run --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 \ mediapipe/examples/desktop/hello_world:hello_world
Yet I kept wondering what these arguments mean. I know -copt is specifying compile options for Bazel. I have tried to find the other 2 arguments but found little results that explain what they do.
The --copt passes options to the c / c++ compilers. EGL_NO_X11 configures the egl Khronos libraries to not include the apis/data structures used to support the X11 protocol which is the rendering system that Linux primarily uses for its user interfaces.
MESA_EGL_NO_X11_HEADERS will configure mesa, a software renderer, to not include the X11 headers but in recent versions of mesa this define no longer has any effect. It was primarily added to support Wayland, the replacement for X11, when using EGL.