mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
Updated dockerfiles to be able to build for Jetpack 6
This commit is contained in:
parent
386ffbf5a6
commit
e9435364f9
@ -115,6 +115,11 @@ FROM base AS wheels
|
|||||||
ARG DEBIAN_FRONTEND
|
ARG DEBIAN_FRONTEND
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install software-properties-common -y && \
|
||||||
|
add-apt-repository ppa:deadsnakes/ppa -y && \
|
||||||
|
apt-get update
|
||||||
|
|
||||||
# Use a separate container to build wheels to prevent build dependencies in final image
|
# Use a separate container to build wheels to prevent build dependencies in final image
|
||||||
RUN apt-get -qq update \
|
RUN apt-get -qq update \
|
||||||
&& apt-get -qq install -y \
|
&& apt-get -qq install -y \
|
||||||
@ -130,12 +135,13 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y \
|
&& apt-get -qq install -y \
|
||||||
python3.9 \
|
python3.9 \
|
||||||
python3.9-dev \
|
python3.9-dev \
|
||||||
|
python3.9-distutils \
|
||||||
# opencv dependencies
|
# opencv dependencies
|
||||||
build-essential cmake git pkg-config libgtk-3-dev \
|
build-essential cmake git pkg-config libgtk-3-dev \
|
||||||
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
|
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
|
||||||
libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
|
libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
|
||||||
gfortran openexr libatlas-base-dev libssl-dev\
|
gfortran openexr libatlas-base-dev libssl-dev\
|
||||||
libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \
|
libtbb2 libtbb-dev libdc1394-dev libopenexr-dev \
|
||||||
libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \
|
libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \
|
||||||
# scipy dependencies
|
# scipy dependencies
|
||||||
gcc gfortran libopenblas-dev liblapack-dev && \
|
gcc gfortran libopenblas-dev liblapack-dev && \
|
||||||
@ -184,7 +190,7 @@ RUN --mount=type=bind,source=docker/main/install_deps.sh,target=/deps/install_de
|
|||||||
|
|
||||||
RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \
|
RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \
|
||||||
python3 -m pip install --upgrade pip && \
|
python3 -m pip install --upgrade pip && \
|
||||||
pip3 install -U /deps/wheels/*.whl
|
pip3 install --ignore-installed -U /deps/wheels/*.whl
|
||||||
|
|
||||||
COPY --from=deps-rootfs / /
|
COPY --from=deps-rootfs / /
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,10 @@ set -euxo pipefail
|
|||||||
|
|
||||||
apt-get -qq update
|
apt-get -qq update
|
||||||
|
|
||||||
|
apt-get -qq install software-properties-common -y
|
||||||
|
add-apt-repository ppa:deadsnakes/ppa -y
|
||||||
|
apt-get update -qq
|
||||||
|
|
||||||
apt-get -qq install --no-install-recommends -y \
|
apt-get -qq install --no-install-recommends -y \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
gnupg \
|
gnupg \
|
||||||
@ -11,6 +15,7 @@ apt-get -qq install --no-install-recommends -y \
|
|||||||
procps vainfo \
|
procps vainfo \
|
||||||
unzip locales tzdata libxml2 xz-utils \
|
unzip locales tzdata libxml2 xz-utils \
|
||||||
python3.9 \
|
python3.9 \
|
||||||
|
python3.9-distutils \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
curl \
|
curl \
|
||||||
jq \
|
jq \
|
||||||
@ -35,7 +40,16 @@ fi
|
|||||||
# coral drivers
|
# coral drivers
|
||||||
apt-get -qq update
|
apt-get -qq update
|
||||||
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
||||||
libedgetpu1-max python3-tflite-runtime python3-pycoral
|
libedgetpu1-max
|
||||||
|
|
||||||
|
# apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
||||||
|
# libedgetpu1-max python3-tflite-runtime python3-pycoral
|
||||||
|
|
||||||
|
pip3 install --extra-index-url https://google-coral.github.io/py-repo/ tflite_runtime
|
||||||
|
|
||||||
|
apt install gdal-bin python3-gdal -y
|
||||||
|
|
||||||
|
pip3 install --extra-index-url https://google-coral.github.io/py-repo/ pycoral
|
||||||
|
|
||||||
# btbn-ffmpeg -> amd64
|
# btbn-ffmpeg -> amd64
|
||||||
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
||||||
|
|||||||
@ -7,10 +7,15 @@ ARG BASE_IMAGE
|
|||||||
FROM ${BASE_IMAGE} AS build-wheels
|
FROM ${BASE_IMAGE} AS build-wheels
|
||||||
ARG DEBIAN_FRONTEND
|
ARG DEBIAN_FRONTEND
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install software-properties-common -y && \
|
||||||
|
add-apt-repository ppa:deadsnakes/ppa -y && \
|
||||||
|
apt-get update
|
||||||
|
|
||||||
# Use a separate container to build wheels to prevent build dependencies in final image
|
# Use a separate container to build wheels to prevent build dependencies in final image
|
||||||
RUN apt-get -qq update \
|
RUN apt-get -qq update \
|
||||||
&& apt-get -qq install -y --no-install-recommends \
|
&& apt-get -qq install -y --no-install-recommends \
|
||||||
python3.9 python3.9-dev \
|
python3.9 python3.9-dev python3.9-distutils \
|
||||||
wget build-essential cmake git \
|
wget build-essential cmake git \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
@ -25,6 +30,15 @@ FROM build-wheels AS trt-wheels
|
|||||||
ARG DEBIAN_FRONTEND
|
ARG DEBIAN_FRONTEND
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
|
RUN apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc
|
||||||
|
|
||||||
|
RUN echo "deb https://repo.download.nvidia.com/jetson/common r36.3 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
|
||||||
|
RUN echo "deb https://repo.download.nvidia.com/jetson/t234 r36.3 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
|
||||||
|
RUN echo "deb https://repo.download.nvidia.com/jetson/ffmpeg r36.3 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
|
||||||
|
|
||||||
|
RUN mkdir -p /opt/nvidia/l4t-packages/
|
||||||
|
RUN touch /opt/nvidia/l4t-packages/.nv-l4t-disable-boot-fw-update-in-preinstall
|
||||||
|
|
||||||
# python-tensorrt build deps are 3.4 GB!
|
# python-tensorrt build deps are 3.4 GB!
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y ccache cuda-cudart-dev-* cuda-nvcc-* libnvonnxparsers-dev libnvparsers-dev libnvinfer-plugin-dev \
|
&& apt-get install -y ccache cuda-cudart-dev-* cuda-nvcc-* libnvonnxparsers-dev libnvparsers-dev libnvinfer-plugin-dev \
|
||||||
|
|||||||
@ -10,6 +10,14 @@ FROM ${TRT_BASE} AS trt-deps
|
|||||||
|
|
||||||
ARG COMPUTE_LEVEL
|
ARG COMPUTE_LEVEL
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install software-properties-common -y && \
|
||||||
|
add-apt-repository ppa:deadsnakes/ppa -y && \
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
RUN echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list
|
||||||
|
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y git build-essential cuda-nvcc-* cuda-nvtx-* libnvinfer-dev libnvinfer-plugin-dev libnvparsers-dev libnvonnxparsers-dev \
|
&& apt-get install -y git build-essential cuda-nvcc-* cuda-nvtx-* libnvinfer-dev libnvinfer-plugin-dev libnvparsers-dev libnvonnxparsers-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
@ -14,7 +14,21 @@ apt-get -qq install -y --no-install-recommends libx264-dev libx265-dev
|
|||||||
pushd /tmp
|
pushd /tmp
|
||||||
|
|
||||||
# Install libnvmpi to enable nvmpi decoders (h264_nvmpi, hevc_nvmpi)
|
# Install libnvmpi to enable nvmpi decoders (h264_nvmpi, hevc_nvmpi)
|
||||||
if [ -e /usr/local/cuda-10.2 ]; then
|
if [ -e /usr/local/cuda-12.2 ]; then
|
||||||
|
# assume Jetpack 6.X
|
||||||
|
apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc
|
||||||
|
|
||||||
|
echo "deb https://repo.download.nvidia.com/jetson/common r36.3 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
|
||||||
|
echo "deb https://repo.download.nvidia.com/jetson/t234 r36.3 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
|
||||||
|
echo "deb https://repo.download.nvidia.com/jetson/ffmpeg r36.3 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
|
||||||
|
|
||||||
|
mkdir -p /opt/nvidia/l4t-packages/
|
||||||
|
touch /opt/nvidia/l4t-packages/.nv-l4t-disable-boot-fw-update-in-preinstall
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
apt-get install nvidia-l4t-jetson-multimedia-api -o Dpkg::Options::="--force-confold" --force-yes -y
|
||||||
|
elif [ -e /usr/local/cuda-10.2 ]; then
|
||||||
# assume Jetpack 4.X
|
# assume Jetpack 4.X
|
||||||
wget -q https://developer.nvidia.com/embedded/L4T/r32_Release_v5.0/T186/Jetson_Multimedia_API_R32.5.0_aarch64.tbz2 -O jetson_multimedia_api.tbz2
|
wget -q https://developer.nvidia.com/embedded/L4T/r32_Release_v5.0/T186/Jetson_Multimedia_API_R32.5.0_aarch64.tbz2 -O jetson_multimedia_api.tbz2
|
||||||
else
|
else
|
||||||
|
|||||||
@ -12,7 +12,7 @@ if [[ "${TARGETARCH}" == "arm64" ]]; then
|
|||||||
# Get python-tensorrt source
|
# Get python-tensorrt source
|
||||||
mkdir /workspace
|
mkdir /workspace
|
||||||
cd /workspace
|
cd /workspace
|
||||||
git clone -b ${TENSORRT_VER} https://github.com/NVIDIA/TensorRT.git --depth=1
|
git clone -b release/8.6 https://github.com/NVIDIA/TensorRT.git --depth=1
|
||||||
|
|
||||||
# Collect dependencies
|
# Collect dependencies
|
||||||
EXT_PATH=/workspace/external && mkdir -p $EXT_PATH
|
EXT_PATH=/workspace/external && mkdir -p $EXT_PATH
|
||||||
@ -22,7 +22,7 @@ if [[ "${TARGETARCH}" == "arm64" ]]; then
|
|||||||
|
|
||||||
# Build wheel
|
# Build wheel
|
||||||
cd /workspace/TensorRT/python
|
cd /workspace/TensorRT/python
|
||||||
EXT_PATH=$EXT_PATH PYTHON_MAJOR_VERSION=3 PYTHON_MINOR_VERSION=9 TARGET_ARCHITECTURE=aarch64 /bin/bash ./build.sh
|
EXT_PATH=$EXT_PATH PYTHON_MAJOR_VERSION=3 PYTHON_MINOR_VERSION=9 TARGET_ARCHITECTURE=aarch64 TENSORRT_MODULE=tensorrt /bin/bash ./build.sh
|
||||||
mv build/dist/*.whl /trt-wheels/
|
mv build/bindings_wheel/dist/*.whl /trt-wheels/
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user