[Feature] Support for arm64 for CUDA (immich-machine-learning) #10647
Replies: 15 comments 26 replies
-
Good point! We can add arm64 as a target for the CUDA image. |
Beta Was this translation helpful? Give feedback.
-
I would also like to use this on Jetson. I have the newer one (Jetson Orin Nano). 5.15.148-tegra kernel with Jetpack 6.1. |
Beta Was this translation helpful? Give feedback.
-
I have too the old (but cheapest) Jetson Nano 4Gb. |
Beta Was this translation helpful? Give feedback.
-
Also looking forward to this being an option! Jetson Orin NX |
Beta Was this translation helpful? Give feedback.
-
Any update on this? Jetson Xavier AGX |
Beta Was this translation helpful? Give feedback.
-
Would also love this option. Jetson Orin Nano 8GB here. |
Beta Was this translation helpful? Give feedback.
-
Support for this is highly desired. Jetson Orin Nano 8GB |
Beta Was this translation helpful? Give feedback.
-
I also looking forward to this being an option. |
Beta Was this translation helpful? Give feedback.
-
I have Immich running on a Jetson nano. It works very well, even without CUDA support, and responds quickly. I had expected the micro SD card to slow it down but it does not appear to be a problem. |
Beta Was this translation helpful? Give feedback.
-
Also waiting for the ghcr.io/immich-app/immich-machine-learning:release-cuda image build for ARM64. i am running the AI features on the jetson nano 8gb, and the rest on the pi5 |
Beta Was this translation helpful? Give feedback.
-
For NVIDIA Jetson series devices, the standard nvidia/cuda images cannot be used - they require the nvidia/l4t-base as the base image, with versions may tied to specific JetPack SDK releases. I've locally modified the Dockerfile (using l4t-base:r34.1) and successfully tested it on Jetson Xavier NX. However, compatibility with other Jetson products remains to be verified. Importantly, Jetson devices shouldn't simply use the arm64 tag as they have a unique architecture and lack PCIe GPUs, and nvidia-smi is unavailable . but looks like Jetson is the only one arm+cuda devices |
Beta Was this translation helpful? Give feedback.
-
Yes i made it work!What I did:
Dockerfile: ARG DEVICE=cuda
# For JetPack 5.2.x
FROM nvcr.io/nvidia/l4t-base:35.4.1 AS builder
ARG DEVICE
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
VIRTUAL_ENV=/opt/venv \
PATH="/opt/venv/bin:$PATH"
# Install Python 3.11 & g++ from unofficial ppa
RUN apt-get update && \
apt install software-properties-common -y && \
add-apt-repository ppa:deadsnakes/ppa -y && \
add-apt-repository -y ppa:ubuntu-toolchain-r/test -y && \
apt-get install -y --no-install-recommends \
build-essential \
wget \
g++-11 \
python3.11 \
python3.11-dev \
python3.11-venv \
libcudnn8-dev && \
rm -rf /var/lib/apt/lists/*
# Set Python 3.11 as default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
# create vdev and install pip
RUN python3.11 -m venv /opt/venv && \
/opt/venv/bin/pip install --upgrade pip
# install ONNX Runtime GPU for Jetson
RUN wget -q -O onnxruntime_gpu-1.18.0-cp311-cp311-linux_aarch64.whl \
https://nvidia.box.com/shared/static/n6wf6n6vwydgts0ivf7h2479vhghxt02.whl && \
/opt/venv/bin/pip install onnxruntime_gpu-1.18.0-cp311-cp311-linux_aarch64.whl
#&& \
#rm onnxruntime_gpu-1.18.0-cp311-cp311-linux_aarch64.whl
# uv
COPY --from=ghcr.io/astral-sh/uv:latest@sha256:4faec156e35a5f345d57804d8858c6ba1cf6352ce5f4bffc11b7fdebdef46a38 /uv /uvx /bin/
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --extra ${DEVICE} --no-dev --no-editable --no-install-project --compile-bytecode --no-progress --active --link-mode copy
# runtime
FROM nvcr.io/nvidia/l4t-cuda:11.4.19-runtime
# install again ()
RUN apt-get update && \
apt install software-properties-common -y && \
add-apt-repository ppa:deadsnakes/ppa -y && \
add-apt-repository -y ppa:ubuntu-toolchain-r/test -y && \
apt-get install -y --no-install-recommends \
python3.11 \
g++-11 \
libcudnn8-dev \
tini && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# set cuda 11
ENV LD_LIBRARY_PATH=/usr/local/cuda-11/compat:$LD_LIBRARY_PATH \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH="/opt/venv/bin:$PATH" \
PYTHONPATH=/usr/src \
DEVICE=${DEVICE} \
VIRTUAL_ENV=/opt/venv \
MACHINE_LEARNING_CACHE_FOLDER=/cache
COPY --from=builder /opt/venv /opt/venv
# There may be redundancy but the build is not passed in
RUN wget -q -O onnxruntime_gpu-1.18.0-cp311-cp311-linux_aarch64.whl \
https://nvidia.box.com/shared/static/n6wf6n6vwydgts0ivf7h2479vhghxt02.whl && \
/opt/venv/bin/pip install onnxruntime_gpu-1.18.0-cp311-cp311-linux_aarch64.whl
RUN echo "hard core 0" >> /etc/security/limits.conf && \
echo "fs.suid_dumpable 0" >> /etc/sysctl.conf && \
echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile
WORKDIR /usr/src
COPY scripts/healthcheck.py .
COPY immich_ml immich_ml
ARG BUILD_ID
ARG BUILD_IMAGE
ARG BUILD_SOURCE_REF
ARG BUILD_SOURCE_COMMIT
ENV IMMICH_BUILD=${BUILD_ID}
ENV IMMICH_BUILD_URL=https://github.com/immich-app/immich/actions/runs/${BUILD_ID}
ENV IMMICH_BUILD_IMAGE=${BUILD_IMAGE}
ENV IMMICH_BUILD_IMAGE_URL=https://github.com/immich-app/immich/pkgs/container/immich-machine-learning
ENV IMMICH_REPOSITORY=immich-app/immich
ENV IMMICH_REPOSITORY_URL=https://github.com/immich-app/immich
ENV IMMICH_SOURCE_REF=${BUILD_SOURCE_REF}
ENV IMMICH_SOURCE_COMMIT=${BUILD_SOURCE_COMMIT}
ENV IMMICH_SOURCE_URL=https://github.com/immich-app/immich/commit/${BUILD_SOURCE_COMMIT}
ENTRYPOINT ["tini", "--"]
CMD ["python", "-m", "immich_ml"]
HEALTHCHECK CMD python3 healthcheck.py Some notes:
It works, but I don’t think my changes are enough to submit a PR. It would be great if someone can improve it and merge it into the mainline |
Beta Was this translation helpful? Give feedback.
-
EDIT! Please ignore what I wrote below, this project was confused with frigate, apologies. Hey All, just want to point out that in the 1.6 beta versions, JP6 is available. Note that JP5 and JP4 will no longer be supported as they will not run on the latest version of Debian on which the docker image is based. |
Beta Was this translation helpful? Give feedback.
-
I've added the suggested changes above by @minamion to a fork incase anyone else wants to test this. https://github.com/jamesagarside/immich/tree/jetson-ml-image |
Beta Was this translation helpful? Give feedback.
-
I've tested both @jamesagarside and @minamion solutions on my AGX Orin (64GB Version) and sadly, it doesn't work. I get the following log:
If anyone manages to push a working image, i would gladly try that and help debugging. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have searched the existing feature requests to make sure this is not a duplicate request.
The feature
Docker Image for immich-machine-learning-cuda does not support arm64 processors at the moment.
Get the following message when trying to pull
ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-cuda
no matching manifest for linux/arm64/v8 in the manifest list entries
Running immich in arm64 processor with cuda enabled gpus like Nvidia Jetson devices isnt possible and is currently forced to use the cpu instead of gpu.
Can we support a docker image for cuda enabled arm64 processors?
Platform
Beta Was this translation helpful? Give feedback.
All reactions