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

macOS arm64 (lack of) support should be documented #2798

Closed
justin-f-perez opened this issue Nov 19, 2021 · 7 comments
Closed

macOS arm64 (lack of) support should be documented #2798

justin-f-perez opened this issue Nov 19, 2021 · 7 comments
Assignees
Labels
task::all All tasks of MediaPipe type:docs-feature Doc issues for new solution, or clarifications about functionality

Comments

@justin-f-perez
Copy link

justin-f-perez commented Nov 19, 2021

URL(s) with the issue:

https://github.com/google/mediapipe/blob/master/docs/getting_started/python.md
https://github.com/google/mediapipe/blob/master/docs/getting_started/ios.md
https://github.com/google/mediapipe/blob/master/docs/getting_started/install.md#installing-on-macos

Description of issue (what needs changing):

On some paths through the Getting Started documentation, it's not clear that arm64 macs are unsupported at the moment. For example, the Android docs send you to install on mac which has you try- and fail- to build and run the C++ Hello World demo.

It seems arm64 macOS is unsupported, but that information isn't easy to find in the docs.

Current state

This is a common and unexpected outcome for new developers

❯ git clone https://github.com/google/mediapipe.git && cd mediapipe
❯ bazel --version # or <anything> - the release doesn't exist. This always fails.
2021/11/13 18:45:31 Downloading https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-arm64...
2021/11/13 18:45:32 could not download Bazel: HTTP GET https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-arm64 failed with error 404

PRs adding M1 support but

MediaPipe with its TensorFlow dependence needs Bazel to build everything from scratch. I don't think bazel already supports M1 yet: bazelbuild/bazel#11628.
11 months ago #1514
and
tensorflow must upgrade first

Getting Started > Python docs

MediaPipe currently doesn't support arm macOS.
5 months ago

The wheels are for x86_64 only.
9 months ago

install on macos without conda

see this thread for how to install without conda

install on macos with conda

These instructions assume conda is already installed (e.g. via brew install --cask miniconda && conda init && exec zsh)

  1. create environment.yml file:
name: mediapipe-x86
channels:
  - defaults
dependencies:
  - python=3.9
  - pip
  - pip:
    - mediapipe>=0.8.9
variables:
  CONDA_SUBDIR: osx-64
  1. create env (installs dependencies, including python and mediapipe)
$ conda env create --file environment.yml
$ conda activate mediapipe-x86

# test installation
$ python3 -c 'print("this make take a few moments..."); import mediapipe; import cv2; print("ok");'

Installation > macOS docs

For example the following text could be added to the Installing on macOS section instructing users to attempt to build 'Hello world', "x86_64 only; macOS arm64 is currently unsupported. Please refer to the manufacturer documentation for running in x86_64 emulation mode."

@sgowroji sgowroji added task::all All tasks of MediaPipe stat:awaiting googler Waiting for Google Engineer's Response type:docs-feature Doc issues for new solution, or clarifications about functionality labels Nov 19, 2021
@sgowroji sgowroji assigned chuoling and unassigned sgowroji Nov 19, 2021
@justin-f-perez
Copy link
Author

Closing since I've moved on to other projects and won't be able to keep this issue up to date

@sgowroji sgowroji removed the stat:awaiting googler Waiting for Google Engineer's Response label Jan 25, 2022
@sureshdagooglecom
Copy link

Hi @justin-f-perez ,
We don't support to support MAC OS Arm64 in MediaPipe due to limited support we have but sharing this with internal team.

@sureshdagooglecom sureshdagooglecom added stat:awaiting response Waiting for user response and removed stat:awaiting response Waiting for user response labels Mar 10, 2022
@justin-f-perez
Copy link
Author

justin-f-perez commented Mar 10, 2022

Hi @justin-f-perez ,
We don't support to support MAC OS Arm64 in MediaPipe due to limited support we have but sharing this with internal team.

many thanks. In retrospect, mediapipe works normally as long as you find a way to advertise as x86_64. I updated the last sentence of the issue. (To suggest referencing the manufacturer docs instead of "try again later")

overall problem isnt that mediapipe and other projects can't run on these machines- it's that they refuse to, because it appears to be an unsupported platform. If the user tricks the build tools into thinking they're running on x86_64, the emulator works well.

@albert239825
Copy link

Hello, I would just like to express my interest in this feature. I have an M1 Macbook Pro and I'm trying to figure out a method to use the mediapipe library in a python project. Any help would be greatly appreciated. Thanks!

@justin-f-perez
Copy link
Author

justin-f-perez commented Apr 7, 2022

@albert239825

# create the environment using x86_64 python3
❯ conda create --name=my_mediapipe_environment --override-channels --channel='conda-forge/osx-64' python

# below line causes 'conda activate <env name>' to export CONDA_SUBDIR=osx-64
# this causes conda to look exclusively for x86_64 packages while the environment
# is active (thus, 'conda install' you do while the environment is active is sure
# to use the same architecture as your python)
❯ conda env config vars set --name=my_mediapipe_environment CONDA_SUBDIR=osx-64

# activate the environment
❯ conda activate my_mediapipe_environment

# install meidapipe, it works!
❯ pip install mediapipe

# test import mediapipe just be sure
❯ python -c 'import mediapipe'

# NOTE: it does *actually* work beyond just importing

The alternative is to install an x86_64 python yourself and manually manage the environment. I don't recommend it. If you don't have conda, you can get it through homebrew via brew install miniconda

@ah3243
Copy link

ah3243 commented May 15, 2022

@albert239825

# create the environment using x86_64 python3
❯ conda create --name=my_mediapipe_environment --override-channels --channel='conda-forge/osx-64' python

# below line causes 'conda activate <env name>' to export CONDA_SUBDIR=osx-64
# this causes conda to look exclusively for x86_64 packages while the environment
# is active (thus, 'conda install' you do while the environment is active is sure
# to use the same architecture as your python)
❯ conda env config vars set --name=my_mediapipe_environment CONDA_SUBDIR=osx-64

# activate the environment
❯ conda activate my_mediapipe_environment

# install meidapipe, it works!
❯ pip install mediapipe

# test import mediapipe just be sure
❯ python -c 'import mediapipe'

# NOTE: it does *actually* work beyond just importing

The alternative is to install an x86_64 python yourself and manually manage the environment. I don't recommend it. If you don't have conda, you can get it through homebrew via brew install miniconda

You have no idea how long I've been looking or trying different solutions for this. I kept and old macbook just to debug mediapipe applications. Incredible thank you!

@justin-f-perez
Copy link
Author

justin-f-perez commented May 17, 2022

Glad it helped! It looks like you may be able to install natively on M1 now too thanks to a community member building arm64 wheels under a different package name: #3277 I haven't tried this yet though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task::all All tasks of MediaPipe type:docs-feature Doc issues for new solution, or clarifications about functionality
Projects
None yet
Development

No branches or pull requests

6 participants