mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-06 05:24:11 +03:00
Fix jetson build (#20808)
* Fix jetson build * Set numpy version in model wheels * Use constraint instead * Simplify
This commit is contained in:
parent
9f0b6004f2
commit
043bd9e6ee
@ -5,21 +5,27 @@ set -euxo pipefail
|
|||||||
SQLITE3_VERSION="3.46.1"
|
SQLITE3_VERSION="3.46.1"
|
||||||
PYSQLITE3_VERSION="0.5.3"
|
PYSQLITE3_VERSION="0.5.3"
|
||||||
|
|
||||||
|
# Install libsqlite3-dev if not present (needed for some base images like NVIDIA TensorRT)
|
||||||
|
if ! dpkg -l | grep -q libsqlite3-dev; then
|
||||||
|
echo "Installing libsqlite3-dev for compilation..."
|
||||||
|
apt-get update && apt-get install -y libsqlite3-dev && rm -rf /var/lib/apt/lists/*
|
||||||
|
fi
|
||||||
|
|
||||||
# Fetch the pre-built sqlite amalgamation instead of building from source
|
# Fetch the pre-built sqlite amalgamation instead of building from source
|
||||||
if [[ ! -d "sqlite" ]]; then
|
if [[ ! -d "sqlite" ]]; then
|
||||||
mkdir sqlite
|
mkdir sqlite
|
||||||
cd sqlite
|
cd sqlite
|
||||||
|
|
||||||
# Download the pre-built amalgamation from sqlite.org
|
# Download the pre-built amalgamation from sqlite.org
|
||||||
# For SQLite 3.46.1, the amalgamation version is 3460100
|
# For SQLite 3.46.1, the amalgamation version is 3460100
|
||||||
SQLITE_AMALGAMATION_VERSION="3460100"
|
SQLITE_AMALGAMATION_VERSION="3460100"
|
||||||
|
|
||||||
wget https://www.sqlite.org/2024/sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION}.zip -O sqlite-amalgamation.zip
|
wget https://www.sqlite.org/2024/sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION}.zip -O sqlite-amalgamation.zip
|
||||||
unzip sqlite-amalgamation.zip
|
unzip sqlite-amalgamation.zip
|
||||||
mv sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION}/* .
|
mv sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION}/* .
|
||||||
rmdir sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION}
|
rmdir sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION}
|
||||||
rm sqlite-amalgamation.zip
|
rm sqlite-amalgamation.zip
|
||||||
|
|
||||||
cd ../
|
cd ../
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,7 @@ RUN apt-get update \
|
|||||||
&& apt-get install -y protobuf-compiler libprotobuf-dev \
|
&& apt-get install -y protobuf-compiler libprotobuf-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
RUN --mount=type=bind,source=docker/tensorrt/requirements-models-arm64.txt,target=/requirements-tensorrt-models.txt \
|
RUN --mount=type=bind,source=docker/tensorrt/requirements-models-arm64.txt,target=/requirements-tensorrt-models.txt \
|
||||||
pip3 wheel --wheel-dir=/trt-model-wheels -r /requirements-tensorrt-models.txt
|
pip3 wheel --wheel-dir=/trt-model-wheels --no-deps -r /requirements-tensorrt-models.txt
|
||||||
|
|
||||||
FROM wget AS jetson-ffmpeg
|
FROM wget AS jetson-ffmpeg
|
||||||
ARG DEBIAN_FRONTEND
|
ARG DEBIAN_FRONTEND
|
||||||
@ -145,7 +145,8 @@ COPY --from=trt-wheels /etc/TENSORRT_VER /etc/TENSORRT_VER
|
|||||||
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
||||||
--mount=type=bind,from=trt-model-wheels,source=/trt-model-wheels,target=/deps/trt-model-wheels \
|
--mount=type=bind,from=trt-model-wheels,source=/trt-model-wheels,target=/deps/trt-model-wheels \
|
||||||
pip3 uninstall -y onnxruntime \
|
pip3 uninstall -y onnxruntime \
|
||||||
&& pip3 install -U /deps/trt-wheels/*.whl /deps/trt-model-wheels/*.whl \
|
&& pip3 install -U /deps/trt-wheels/*.whl \
|
||||||
|
&& pip3 install -U /deps/trt-model-wheels/*.whl \
|
||||||
&& ldconfig
|
&& ldconfig
|
||||||
|
|
||||||
WORKDIR /opt/frigate/
|
WORKDIR /opt/frigate/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user