cvat icon indicating copy to clipboard operation
cvat copied to clipboard

Error Shapely M1(Apple Silicon)

Open johnnynunez opened this issue 4 years ago • 12 comments
trafficstars

My actions before raising this issue

  • [ X ] Read/searched the docs
  • [ X ] Searched past issues

Expected Behaviour

Now, I have the new mac m1. There are some issues with some libraries like Shapely.

Current Behaviour

When I'm building the docker, there is an issue with Shapely library.

Possible Solution

The solution is here: https://github.com/Toblerity/Shapely/issues/1080

Steps to Reproduce (for bugs)

  1. Building the docker

Context

I can't work at this moment.

Your Environment

  • Docker
  • MacOS
  • M1 Apple Silicon (ARM)

Next steps

You may join our Gitter channel for community support.

johnnynunez avatar Feb 11 '21 20:02 johnnynunez

Hi @johnnync13

Can you please provide more details on the issue? IMHO M1 is a new CPU which is not fully supported by different dependencies yet. I am not sure it is direct CVAT issue, because CVAT is just a web app built on many 3rdparty components.

bsekachev avatar Feb 12 '21 09:02 bsekachev

I would like to test CVAT with m1 as tensorflow v2.4.0 is compatible with Apple Silicon. I attach the image @bsekachev 107269600-207b2e80-6a4a-11eb-8d43-d3c33b4d143a

The solution is here but it has not yet updated. https://github.com/Toblerity/Shapely/issues/1080

johnnynunez avatar Feb 12 '21 11:02 johnnynunez

Did somebody make docker build run on an M1 Mac?

f4z3k4s avatar Sep 13 '21 10:09 f4z3k4s

Did somebody make docker build run on an M1 Mac?

For any easy fix, I've found that adding platform: linux/x86_64 to cvat service in docker-compose.dev.yml solves the problem for me, and I am able to build on an M1 chip.

f4z3k4s avatar Oct 18 '21 10:10 f4z3k4s

The fix is possible by adding this in your Dockerfile

RUN apt-get update && apt-get install -y \ libgeos-dev

LayBraid avatar Jul 28 '22 07:07 LayBraid

@AlexeyAlexeevXperienceAI

Can you share your experience of running on M1?

bsekachev avatar Sep 02 '22 13:09 bsekachev

I didn't have problems with libgeos in Docker. As I see installing libgeos-dev is added to Dockerfile recently and the issue needs to be checked on the current version.

@johnnynunez Can you please check the current version? Do you still have an error?

If you have issues with tensorflow, maybe version updating of tensorflow in 'cvat/requirements/base.txt' to 2.10.0rc2 can fix it. Also, I found that sometimes version tensorflow-macos=2.9.2 works.

Also for my case I needed update version psycopg2-binary to 2.9.3

After changing to tensorflow-aarch64==2.11.0 in cvat/requirements/base.txt and to psycopg2-binary==2.9.3 in cvat/requirements/production.txt, as proposed by @AlexeyAlexeevXperienceAI, I was able to build CVAT on my arm/aarch64 machine - with one exception: cvat_opa build seems to fail and when I try to run CVAT I get this error:

$ docker-compose up cvat_opa
WARNING: The no_proxy variable is not set. Defaulting to a blank string.
cvat_opa is up-to-date
Attaching to cvat_opa
cvat_opa                | exec /opa: exec format error

It seems, however, that OPA does support the arm achitecture. Any ideas how I can build OPA for CVAT on arm?

haimat avatar Nov 21 '22 19:11 haimat

Did somebody make docker build run on an M1 Mac?

For any easy fix, I've found that adding platform: linux/x86_64 to cvat service in docker-compose.dev.yml solves the problem for me, and I am able to build on an M1 chip.

Hello, does this comment fix the issue? In case could someone share an updated docker-compose.dev.yml for Mac silicon users?

AlessandroMondin avatar Jan 07 '23 14:01 AlessandroMondin

or maybe include a separate part into the installation tutorial for Mac m1 users if possible?

e-velin avatar May 25 '23 14:05 e-velin

Did somebody make docker build run on an M1 Mac?

For any easy fix, I've found that adding platform: linux/x86_64 to cvat service in docker-compose.dev.yml solves the problem for me, and I am able to build on an M1 chip.

It runs for me. but in rosetta emulation. and perhaps because of which I cannot use the tool. http://localhost:8080/ just stays for a while in "connecting" and then displays error message

Screenshot 2023-07-17 at 12 32 09 PM

and this is how the Docker Desktop looks

Screenshot 2023-07-17 at 12 33 37 PM

Razin-Tailor avatar Jul 17 '23 07:07 Razin-Tailor

It seems that during the initial cvat_server migration, the M1(I use M1 Mac Pro 13inch) gets overloaded and ends up killing the cvat_server by itself, and the same happens with clickhouse.

So, I first ran docker compose up only for the cvat_server, and then, after a certain log appeared, I tried running the entire system with docker compose up -d. It worked occasionally, haha (but not always).

스크린샷 2024-01-25 오후 4 11 20

Please keep this in mind.

bigstones avatar Jan 25 '24 08:01 bigstones

It seems that during the initial cvat_server migration, the M1(I use M1 Mac Pro 13inch) gets overloaded and ends up killing the cvat_server by itself, and the same happens with clickhouse.

So, I first ran docker compose up only for the cvat_server, and then, after a certain log appeared, I tried running the entire system with docker compose up -d. It worked occasionally, haha (but not always).

@bigstones' solution for Mac M1 works perfectly for me, without Rosetta! Here's how to implement it:

  1. Start only the cvat_server service by running: docker compose up -d cvat_server.

  2. Wait for the server to start. You can check its status by running docker logs -f cvat_server. You should see the following lines in the logs:

2024-02-26 12:59:02,096 DEBG 'uvicorn-1' stdout output:
INFO:     172.25.0.2:0 - "GET /api/auth/rules HTTP/1.0" 200 OK
  1. Once the server is up and running, proceed with the usual steps by running docker compose up -d.

ellkrauze avatar Feb 26 '24 13:02 ellkrauze

This isn't working in my case. I am again getting the prompt to upgrade when starting the webpage.

  1. Wait for the server to start. You can check its status by running docker logs -f cvat_server. You should see the following lines in the logs:

I am getting the following logs while starting up the cvat_server

2024-03-03 19:13:22,278 INFO success: nginx-0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-03 19:13:22,278 INFO success: smokescreen entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-03 19:13:22,278 INFO success: uvicorn-0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-03 19:13:22,278 INFO success: uvicorn-1 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-03 19:13:23,177 DEBG 'uvicorn-0' stderr output:
INFO:     Started server process [77]

2024-03-03 19:13:23,177 DEBG 'uvicorn-0' stderr output:
INFO:     Waiting for application startup.

2024-03-03 19:13:23,178 DEBG 'uvicorn-0' stderr output:
INFO:     ASGI 'lifespan' protocol appears unsupported.

2024-03-03 19:13:23,178 DEBG 'uvicorn-0' stderr output:
INFO:     Application startup complete.

2024-03-03 19:13:23,181 DEBG 'uvicorn-0' stderr output:
INFO:     Uvicorn running on socket /tmp/uvicorn.sock (Press CTRL+C to quit)

2024-03-03 19:13:23,231 DEBG 'uvicorn-1' stderr output:
INFO:     Started server process [78]

2024-03-03 19:13:23,232 DEBG 'uvicorn-1' stderr output:
INFO:     Waiting for application startup.

2024-03-03 19:13:23,232 DEBG 'uvicorn-1' stderr output:
INFO:     ASGI 'lifespan' protocol appears unsupported.

2024-03-03 19:13:23,233 DEBG 'uvicorn-1' stderr output:
INFO:     Application startup complete.

2024-03-03 19:13:23,235 DEBG 'uvicorn-1' stderr output:
INFO:     Uvicorn running on socket /tmp/uvicorn.sock (Press CTRL+C to quit)

2024-03-03 19:13:24,993 DEBG 'uvicorn-1' stdout output:
INFO:     172.25.0.2:0 - "GET /api/auth/rules HTTP/1.0" 200 OK

2024-03-03 19:13:33,392 DEBG 'uvicorn-0' stdout output:
INFO:     172.25.0.2:0 - "GET /api/auth/rules HTTP/1.0" 304 Not Modified

2024-03-03 19:13:45,395 DEBG 'uvicorn-1' stdout output:
INFO:     172.25.0.2:0 - "GET /api/auth/rules HTTP/1.0" 304 Not Modified

2024-03-03 19:13:58,967 DEBG 'uvicorn-0' stdout output:
INFO:     172.25.0.2:0 - "GET /api/auth/rules HTTP/1.0" 304 Not Modified

2024-03-03 19:14:04,071 DEBG 'uvicorn-0' stdout output:
INFO:     172.25.0.2:0 - "GET /api/auth/rules HTTP/1.0" 304 Not Modified

2024-03-03 19:14:10,382 DEBG 'uvicorn-1' stdout output:
INFO:     172.25.0.2:0 - "GET /api/auth/rules HTTP/1.0" 304 Not Modified

Viditagarwal7479 avatar Mar 03 '24 19:03 Viditagarwal7479

It got fixed by using docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build \ cvat_opa cvat_db cvat_redis_inmem cvat_redis_ondisk cvat_server by setting

export DOCKER_DEFAULT_PLATFORM=linux/amd64

EDIT: Open VSCode and follow this also...

Select server: debug configuration and run it (F5) to run REST server and its workers

Viditagarwal7479 avatar Mar 03 '24 20:03 Viditagarwal7479