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

MacBook Pro (Retina, Mid 2012) - Catalina 10.15.7 #5752

Open
pilipicus opened this issue Nov 23, 2024 · 7 comments
Open

MacBook Pro (Retina, Mid 2012) - Catalina 10.15.7 #5752

pilipicus opened this issue Nov 23, 2024 · 7 comments
Assignees
Labels
legacy:hands Hand tracking/gestures/etc os:macOS Issues on MacOS platform:c++ Issues specific to C++ framework in mediapipe stat:awaiting response Waiting for user response type:build/install For Build and Installation issues

Comments

@pilipicus
Copy link

OS Platform and Distribution

Mac Pro Catalina 10.15.7

Compiler version

No response

Programming Language and version

C++

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

No response

MediaPipe version

0.10.19

Bazel version

No response

XCode and Tulsi versions (if iOS)

Version 12.4

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

4.10.0

Describe the problem

The provided examples do not run

Complete Logs

My configuration: 
Bazelisk version: 1.24.0
Mediapipe version: 0.10.19
opencv_version: 4.10.0
Xcode version: 1.24.0
clang version: Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix

I've followed the guide for MacOS: https://ai.google.dev/edge/mediapipe/framework/getting_started/install.md#installing_on_macos  and downloaded from git: https://github.com/google/mediapipe.git the examples.


The "HelloWorld" example works. Instead all the others don't! 

To run "HelloWorld" I do this:
$ export GLOG_logtostderr=1

# if you are running on Linux desktop with CPU only
$ bazel run --define MEDIAPIPE_DISABLE_GPU=1 \
    mediapipe/examples/desktop/hello_world:hello_world

I0000 00:00:1732381130.229285 8588331 hello_world.cc:58] Hello World!
I0000 00:00:1732381130.229467 8588331 hello_world.cc:58] Hello World!
...


To run "hand_tracking", that doesn't work at the I do this:

bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu --verbose_failures --sandbox_debug

Th error that I receive is: 
clang: error: unknown argument: '-mavxvnni'
Error in child process '/usr/bin/xcrun'. 1
Target //mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu failed to build
INFO: Elapsed time: 36.360s, Critical Path: 35.94s
INFO: 212 processes: 128 internal, 84 darwin-sandbox.
FAILED: Build did NOT complete successfully
@pilipicus pilipicus added the type:build/install For Build and Installation issues label Nov 23, 2024
@kalyan2789g kalyan2789g added legacy:hands Hand tracking/gestures/etc platform:c++ Issues specific to C++ framework in mediapipe os:macOS Issues on MacOS labels Nov 25, 2024
@kalyan2789g
Copy link
Collaborator

Hi @pilipicus,

Could you please confirm the latest version of the OpenCv in your system? Currently Mediapipe supports OpenCv v4.

Thanks,
@kalyan2789g

@kalyan2789g kalyan2789g added the stat:awaiting response Waiting for user response label Nov 26, 2024
@pilipicus
Copy link
Author

pilipicus commented Nov 26, 2024

Hi @kalyan2789g,

Before it was the OpenCV version 4.10.0. Now, following the guide online (link), but also looking at what was written in the WORSPACE file in the mediapipe folder, I've installed the version of OpenCV 3.4.11.

The error that I've receive is:
ERROR: /private/var/tmp/_bazel_Filippo/a66de5a5c3e5be3ced057a7a2c8bed2c/external/XNNPACK/BUILD.bazel:661:36: Compiling src/qs8-rsum/gen/qs8-rsum-avxvnni-u128-acc2.c failed: (Exit 1): wrapped_clang failed: error executing command (from target @XNNPACK//:avxvnni_prod_microkernels) external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG '-DNS_BLOCK_ASSERTIONS=1' ... (remaining 108 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
clang: error: unknown argument: '-mavxvnni'
Error in child process '/usr/bin/xcrun'. 1
Target //mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 37.144s, Critical Path: 36.79s
INFO: 207 processes: 129 internal, 78 darwin-sandbox.
FAILED: Build did NOT complete successfully

I've also tried to disable AVX-512 modyifing the file .bazelrc , in the root of the MediaPipe project:
build --copt=-DXNN_ENABLE_AVX512FP16=0
build --copt=-DXNN_ENABLE_AVXVNNI=0
build --copt=-DXNN_ENABLE_AVXVNNIINT8=0
build --copt=-DXNN_ENABLE_AVX512AMX=0
build --copt=-mno-avx512f
build --copt=-mno-avx512cd
build --copt=-mno-avx512bw
build --copt=-mno-avx512dq
build --copt=-mno-avx512vl
build --copt=-mno-avx512vnni
build --copt=-mno-gfni
build --copt=-mno-avx512fp16

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Nov 26, 2024
@kuaashish
Copy link
Collaborator

Hi @pilipicus,

Could you please execute the following command to disable "avxvnni" as below and update Clang to version 18.0?

echo "build --define=xnn_enable_avxvnni=false" >> .bazelrc

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Nov 26, 2024
@pilipicus
Copy link
Author

pilipicus commented Nov 27, 2024

Hi @kalyan2789g,

I've installed the version 18.1 because the 18.0 seems not being available or I couldn't find it:

clang --version

clang version 18.1.0rc
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /usr/local/llvm-18.1.0/bin

After, I moved to the folder mediapipe, I run the command echo "build --define=xnn_enable_avxvnni=false" >> .bazelrc and I run again the command bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu --verbose_failures --sandbox_debug

The error that I receive Is still the same:
error: unknown argument: '-mavx512fp16'
Error in child process '/usr/bin/xcrun'. 1
Target //mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu failed to build

Here the screenshot of the error:

error (1)

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Nov 27, 2024
@kuaashish
Copy link
Collaborator

Hi @pilipicus,

This appears to be a different error. Could you try applying a similar approach(Clang 18.1 fine) for that flag using the following command?

echo "build --define=xnn_enable_avx512fp16=false" >> .bazelrc

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Nov 27, 2024
@pilipicus
Copy link
Author

Hi @kalyan2789g,

I've tried your command line and the error that I get is the following one:

er_2

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Nov 27, 2024
@kuaashish
Copy link
Collaborator

@pilipicus,

Please follow the instructions below to disable all flags. Unfortunately, we do not have an older macOS version to reproduce the issue and help with disabling the flags.

clang: error: the clang compiler does not support '-mavxvnniint8’'

This is the flag. So you can disable this by passing –define=xnn_enable_avxvnniint8=false by same command.

@kuaashish kuaashish assigned kuaashish and unassigned kalyan2789g Nov 27, 2024
@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:hands Hand tracking/gestures/etc os:macOS Issues on MacOS platform:c++ Issues specific to C++ framework in mediapipe stat:awaiting response Waiting for user response type:build/install For Build and Installation issues
Projects
None yet
Development

No branches or pull requests

3 participants