[BUG] immich-machine-learning doesn't start on Pi4/aarch64 #805

Closed
opened 2026-02-04 22:46:32 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @arminus on GitHub (Apr 9, 2023).

The bug

With the default docker-compose.yml, immich-machine-learning doesn't start on a Pi4/64 (or rather restarts continuously without any docker logs).

Starting the container manually like this:

docker run --env-file .env --volume ${UPLOAD_LOCATION}:/usr/src/app/upload --volume $(pwd)/modelcache:/cache ghcr.io/immich-app/immich-machine-learning:release /bin/sh -c "while true; do sleep 2; done"

I managed to exec into it and try to start the entrypoint which reveals this:

root@e78f93eee886:/usr/src/app# gunicorn src.main:server
Illegal instruction (core dumped)

Narrowing this down further (inside the container):

root@cbf4faadf806:/usr/src/app# python3
Python 3.10.11 (main, Apr 6 2023, 00:10:13) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.

import os
from flask import Flask, request
from transformers import pipeline
Illegal instruction (core dumped)

This ran ok with images from a couple of weeks ago on the same Pi4.

The OS that Immich Server is running on

RaspberryPi4/aarch64

Version of Immich Server

1.53.0

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

https://github.com/immich-app/immich/blob/main/docker/docker-compose.yml

Your .env content

https://github.com/immich-app/immich/blob/main/docker/example.env

Reproduction steps

1. see above
2.
3.
...

Additional information

No response

Originally created by @arminus on GitHub (Apr 9, 2023). ### The bug With the default docker-compose.yml, immich-machine-learning doesn't start on a Pi4/64 (or rather restarts continuously without any docker logs). Starting the container manually like this: ``` docker run --env-file .env --volume ${UPLOAD_LOCATION}:/usr/src/app/upload --volume $(pwd)/modelcache:/cache ghcr.io/immich-app/immich-machine-learning:release /bin/sh -c "while true; do sleep 2; done" ``` I managed to exec into it and try to start the entrypoint which reveals this: root@e78f93eee886:/usr/src/app# gunicorn src.main:server Illegal instruction (core dumped) Narrowing this down further (inside the container): root@cbf4faadf806:/usr/src/app# python3 Python 3.10.11 (main, Apr 6 2023, 00:10:13) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> from flask import Flask, request >>> from transformers import pipeline Illegal instruction (core dumped) This ran ok with images from a couple of weeks ago on the same Pi4. ### The OS that Immich Server is running on RaspberryPi4/aarch64 ### Version of Immich Server 1.53.0 ### Version of Immich Mobile App N/A ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML https://github.com/immich-app/immich/blob/main/docker/docker-compose.yml ``` ### Your .env content ```Shell https://github.com/immich-app/immich/blob/main/docker/example.env ``` ### Reproduction steps ```bash 1. see above 2. 3. ... ``` ### Additional information _No response_
Author
Owner

@alextran1502 commented on GitHub (Apr 9, 2023):

Duplicated of #2221

@alextran1502 commented on GitHub (Apr 9, 2023): Duplicated of #2221
Author
Owner

@arminus commented on GitHub (Apr 9, 2023):

#2221 seems to be about 32bit? I'm observing this on a 64bit Pi4 ...

❯ hostnamectl
Static hostname: pi4
Icon name: computer
Machine ID: a1115e8649d74ea19711ab2dd9d25466
Boot ID: 521ef3573cbb4644b60fd17592395247
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 5.15.76-v8+
Architecture: arm64

@arminus commented on GitHub (Apr 9, 2023): #2221 seems to be about 32bit? I'm observing this on a 64bit Pi4 ... ❯ hostnamectl Static hostname: pi4 Icon name: computer Machine ID: a1115e8649d74ea19711ab2dd9d25466 Boot ID: 521ef3573cbb4644b60fd17592395247 Operating System: Debian GNU/Linux 11 (bullseye) Kernel: Linux 5.15.76-v8+ Architecture: arm64
Author
Owner

@Lyokovic commented on GitHub (Apr 10, 2023):

I have the same issue on rpi4 with arm64 OS.
This issue has nothing to do with #2221 where there is no docker image available for armv7. Here the docker image is pulled but crashes on startup, as detailed in the initial post.

The docker image on tag v1.51.2 runs well and should have all the required features (just add the NODE_ENV=production env variable in the compose file).
There may be an issue with arm64 on upstream python projects (pytorch/transformers/...) introduced after 2023-03-22.

@Lyokovic commented on GitHub (Apr 10, 2023): I have the same issue on rpi4 with arm64 OS. This issue has nothing to do with #2221 where there is no docker image available for armv7. Here the docker image is pulled but crashes on startup, as detailed in the initial post. The docker image on tag v1.51.2 runs well and should have all the required features (just add the `NODE_ENV=production` env variable in the compose file). There may be an issue with arm64 on upstream python projects (pytorch/transformers/...) introduced after 2023-03-22.
Author
Owner

@arminus commented on GitHub (Apr 10, 2023):

There may be an issue with arm64 on upstream python projects (pytorch/transformers/...) introduced after 2023-03-22.

right, as shown in my original post, python crashes when it tries to import transformers.

@arminus commented on GitHub (Apr 10, 2023): > There may be an issue with arm64 on upstream python projects (pytorch/transformers/...) introduced after 2023-03-22. right, as shown in my original post, python crashes when it tries to import transformers.
Author
Owner

@jon-f-novabackup commented on GitHub (Apr 22, 2023):

I had the opposite on my Raspberry Pi 4b running Ubuntu 22.10 x64, in 1.53 the machine learning container was able to load and run but in 1.54 it just shows constantly restarting the container, when checking with 'docker ps', and doing a docker logs tail on that container doesn't show any status, but docker logs tail on immich_server keeps showing ml is not in a valid state. I had to disable ml from the .yml and the .env file detailed in the FAQ about ml probably needs to be disabled on Rpi4.

@jon-f-novabackup commented on GitHub (Apr 22, 2023): I had the opposite on my Raspberry Pi 4b running Ubuntu 22.10 x64, in 1.53 the machine learning container was able to load and run but in 1.54 it just shows constantly restarting the container, when checking with 'docker ps', and doing a docker logs tail on that container doesn't show any status, but docker logs tail on immich_server keeps showing ml is not in a valid state. I had to disable ml from the .yml and the .env file detailed in the FAQ about ml probably needs to be disabled on Rpi4.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#805