cvat
cvat copied to clipboard
Error Shapely M1(Apple Silicon)
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)
- 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.
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.
I would like to test CVAT with m1 as tensorflow v2.4.0 is compatible with Apple Silicon.
I attach the image @bsekachev

The solution is here but it has not yet updated. https://github.com/Toblerity/Shapely/issues/1080
Did somebody make docker build run on an M1 Mac?
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.
The fix is possible by adding this in your Dockerfile
RUN apt-get update && apt-get install -y \ libgeos-dev
@AlexeyAlexeevXperienceAI
Can you share your experience of running on M1?
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?
Did somebody make docker build run on an M1 Mac?
For any easy fix, I've found that adding
platform: linux/x86_64tocvatservice indocker-compose.dev.ymlsolves 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?
or maybe include a separate part into the installation tutorial for Mac m1 users if possible?
Did somebody make docker build run on an M1 Mac?
For any easy fix, I've found that adding
platform: linux/x86_64tocvatservice indocker-compose.dev.ymlsolves 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
and this is how the Docker Desktop looks
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).
Please keep this in mind.
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:
-
Start only the
cvat_serverservice by running:docker compose up -d cvat_server. -
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
- Once the server is up and running, proceed with the usual steps by running
docker compose up -d.
This isn't working in my case. I am again getting the prompt to upgrade when starting the webpage.
- 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
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: debugconfiguration and run it (F5) to run REST server and its workers