Skip to content

GPU support for macOS Metal? #5656

Open
@yiyinglai

Description

@yiyinglai

OS Platform and Distribution

macOS Somona 14.6

Compiler version

clang 15.0.0

Programming Language and version

C++(demo code)

Installed using virtualenv? pip? Conda?(if python)

No response

MediaPipe version

No response

Bazel version

No response

XCode and Tulsi versions (if iOS)

No response

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

No response

Describe the problem

no member named 'GetCVPixelBufferRef' in namespace 'mediapipe' when building desktop hand tracking gpu

Complete Logs

Following this guide https://ai.google.dev/edge/mediapipe/framework/getting_started/cpp, I can run desktop hand tracking cpu with no issue, but desktop hand tracking gpu could not be compiled, logs:

(base) yiyinglai@MacBook-Air mediapipe % bazel build -c opt --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 \
  mediapipe/examples/desktop/hand_tracking:hand_tracking_gpu
WARNING: /Users/yiyinglai/workspace/github/mediapipe/mediapipe/framework/BUILD:69:24: in cc_library rule //mediapipe/framework:calculator_cc_proto: target '//mediapipe/framework:calculator_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
WARNING: /Users/yiyinglai/workspace/github/mediapipe/mediapipe/framework/tool/BUILD:204:24: in cc_library rule //mediapipe/framework/tool:field_data_cc_proto: target '//mediapipe/framework/tool:field_data_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
INFO: Analyzed target //mediapipe/examples/desktop/hand_tracking:hand_tracking_gpu (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
INFO: From Linking mediapipe/modules/palm_detection/palm_detection_model_loader_graph_text_to_binary_graph [for tool]:
ld: warning: ignoring duplicate libraries: '-lc++', '-lm', '-lpthread'
INFO: From Linking mediapipe/modules/hand_landmark/hand_landmark_tracking_gpu_graph_text_to_binary_graph [for tool]:
ld: warning: ignoring duplicate libraries: '-lc++', '-lm', '-lpthread'
INFO: From Linking mediapipe/modules/hand_landmark/palm_detection_detection_to_roi_graph_text_to_binary_graph [for tool]:
ld: warning: ignoring duplicate libraries: '-lc++', '-lm', '-lpthread'
INFO: From Linking mediapipe/graphs/hand_tracking/subgraphs/hand_renderer_gpu_graph_text_to_binary_graph [for tool]:
ld: warning: ignoring duplicate libraries: '-lc++', '-lm', '-lpthread'
INFO: From Linking mediapipe/modules/palm_detection/palm_detection_gpu_graph_text_to_binary_graph [for tool]:
ld: warning: ignoring duplicate libraries: '-lc++', '-lm', '-lpthread'
INFO: From Linking mediapipe/modules/hand_landmark/hand_landmark_model_loader_graph_text_to_binary_graph [for tool]:
ld: warning: ignoring duplicate libraries: '-lc++', '-lm', '-lpthread'
INFO: From Linking mediapipe/modules/hand_landmark/hand_landmark_gpu_graph_text_to_binary_graph [for tool]:
ld: warning: ignoring duplicate libraries: '-lc++', '-lm', '-lpthread'
INFO: From Linking mediapipe/modules/hand_landmark/hand_landmark_landmarks_to_roi_graph_text_to_binary_graph [for tool]:
ld: warning: ignoring duplicate libraries: '-lc++', '-lm', '-lpthread'
ERROR: /Users/yiyinglai/workspace/github/mediapipe/mediapipe/gpu/BUILD:945:11: Compiling mediapipe/gpu/MPPMetalHelper.cc failed: (Exit 1): wrapped_clang_pp failed: error executing command (from target //mediapipe/gpu:MPPMetalHelper) external/local_config_cc/wrapped_clang_pp '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG ... (remaining 78 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
mediapipe/gpu/MPPMetalHelper.cc:140:46: error: no member named 'GetCVPixelBufferRef' in namespace 'mediapipe'
  CVPixelBufferRef pixel_buffer = mediapipe::GetCVPixelBufferRef(gpuBuffer);
                                  ~~~~~~~~~~~^
mediapipe/gpu/MPPMetalHelper.cc:188:18: error: no member named 'GetCVPixelBufferRef' in namespace 'mediapipe'
      mediapipe::GetCVPixelBufferRef(gpuBuffer), NULL, metalPixelFormat, width,
      ~~~~~~~~~~~^
2 errors generated.
Error in child process '/usr/bin/xcrun'. 1
Target //mediapipe/examples/desktop/hand_tracking:hand_tracking_gpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 356.539s, Critical Path: 353.42s
INFO: 680 processes: 129 internal, 551 darwin-sandbox.
FAILED: Build did NOT complete successfully

Metadata

Metadata

Assignees

Labels

legacy:handsHand tracking/gestures/etcos:macOSIssues on MacOSplatform:c++Issues specific to C++ framework in mediapipetype:build/installFor Build and Installation issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions