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

Migrating to Bazel v4.2.x #2516

Closed
vidheyoza opened this issue Sep 7, 2021 · 9 comments
Closed

Migrating to Bazel v4.2.x #2516

vidheyoza opened this issue Sep 7, 2021 · 9 comments
Assignees
Labels
type:build/install For Build and Installation issues

Comments

@vidheyoza
Copy link

Please make sure that this is a feature request.

System information (Please provide as much relevant information as possible)

  • MediaPipe Solution (you are using): Iris Tracking, Face Tracking
  • Programming language : Python/Java
  • Are you willing to contribute it (Yes/No): No

Describe the feature and the current behavior/state:

Since the launch of the M1 Mac machines, there has been a lot of discrepancies with building natively with different tools including Bazel, which is justified since it is a relatively new architecture. However, Bazel has started giving full support for M1 machines since v4.2.x. With that spirit in mind, I would like to know how easy/difficult it would be to get mediapipe to build with v4.2.x which released not more than a month ago (and move away from the current 3.7.2 which has been the version for almost a year).

Will this change the current api? How?

I'm not sure, but I don't think it will.

Who will benefit with this feature?

Everyone using mediapipe natively and wanting to build it from scratch will benefit from it. On top of that, any docker container running on M1 is also benefitted from it since docker also requires some degree of support from M1 which in turn requires bazel v4.2.x.

Please specify the use cases for this feature:

As described above, any native or dockerized mediapipe install benefits from moving to v4.2.x.

@vidheyoza vidheyoza added the type:feature Enhancement in the New Functionality or Request for a New Solution label Sep 7, 2021
@sgowroji sgowroji added platform:bazel stat:awaiting googler Waiting for Google Engineer's Response labels Sep 8, 2021
@sgowroji sgowroji assigned mgyong and unassigned sgowroji Sep 8, 2021
@sgowroji
Copy link

Hi @vidheyoza, Have you tried running on the Bazel 4.2.x versions ? Did you face any errors with the above version ? Please let us know with the error logs. Thanks!

@sgowroji sgowroji added stat:awaiting response Waiting for user response and removed stat:awaiting googler Waiting for Google Engineer's Response labels Sep 23, 2021
@vidheyoza
Copy link
Author

I tried running 3.7.2 and 4.2.1, but both give me the same error. There is an open issue on Bazel's public repo here where I talk about the error in more detail.

Briefly, when I try installing bazel on the platform with either x64, I am getting errors with my tensorflow installation, so I have to stick to arm64, for which bazel doesn't have a direct installer script. When I use amd64, I can install tensorflow 1.14.0 needed for my fork of media pipe. Bazel installation doesn't throw any errors as well, but when I use it to build my fork of mediapipe, I get the following error:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Opening zip "/proc/self/exe": lseek(): Bad file descriptor
[FATAL 21:37:43.679 src/main/cpp/archive_utils.cc:51] Failed to open '/proc/self/exe' as a zip file: (error: 9): Bad file descriptor

Devs at bazel recommended downloading the binary for the required version directly into the location needed, but my docker container can't find that bazel executable even after changing permissions for its directory or even itself directly. I get this error when trying to use the directly downloaded bazel binary (for 3.7.2 as well as 4.2.1):

docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "bazel": executable file not found in $PATH: unknown.
ERRO[0001] error waiting for container: context canceled

The devs said 4.2.x should be working with M1 Macs, but there still needs to be some bugs ironed out I suppose. the issue linked above has an ongoing discussion with them about this, so please do have a look at it since I think it will be helpful.

@sgowroji sgowroji assigned jiuqiant and unassigned mgyong Sep 24, 2021
@sgowroji sgowroji added type:build/install For Build and Installation issues and removed type:feature Enhancement in the New Functionality or Request for a New Solution labels Sep 24, 2021
@vidheyoza
Copy link
Author

vidheyoza commented Sep 24, 2021

UPDATE: as linked in the issue above, there was a problem with the installation of bazel, so they guided me with solutions and one of them worked. I am now working with solving the problem of tensorflow. Does mediapipe require a tensorflow==1.14.0 installation?

pip install tensorflow==1.14.0 or normal pip install tensorflow both don't seem to work. Is there a wheel file I can use to install tensorflow directly? If not, what would be the best way to install tensorflow on an arm64 linux container?

@sgowroji sgowroji added stat:awaiting googler Waiting for Google Engineer's Response and removed stat:awaiting response Waiting for user response labels Sep 27, 2021
@HieuNT1998
Copy link

I also had the same problem. Is there any update ?

@vidheyoza
Copy link
Author

One of the authors linked @jiuqiant and @mgyong on this, but I'm not sure if they've had time to look at this.

@sgowroji
Copy link

sgowroji commented Nov 6, 2021

MediaPipe will not upgrade to bazel 4.2 until tensorflow does so.

@sgowroji sgowroji removed the stat:awaiting googler Waiting for Google Engineer's Response label Nov 6, 2021
@sgowroji sgowroji assigned sgowroji and unassigned jiuqiant Nov 6, 2021
@sgowroji sgowroji closed this as completed Nov 6, 2021
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@justin-f-perez
Copy link

justin-f-perez commented Nov 14, 2021

(that last link is broken) https://github.com/tensorflow/tensorflow/blob/master/.bazelversion

@sgowroji
Copy link

Bazel version is updated to 4.2.1 https://github.com/google/mediapipe/releases/tag/v0.8.9

@sgowroji sgowroji added the type:others issues not falling in bug, perfromance, support, build and install or feature label Dec 14, 2021
@sgowroji sgowroji removed the type:others issues not falling in bug, perfromance, support, build and install or feature label Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build/install For Build and Installation issues
Projects
None yet
Development

No branches or pull requests

6 participants