diff --git a/docker/main/Dockerfile b/docker/main/Dockerfile index 4c3416789..7dc1aeb54 100644 --- a/docker/main/Dockerfile +++ b/docker/main/Dockerfile @@ -142,8 +142,8 @@ RUN apt-get -qq update \ apt-transport-https wget \ && apt-get -qq update \ && apt-get -qq install -y \ - python3 \ - python3-dev \ + python3.11 \ + python3.11-dev \ # opencv dependencies build-essential cmake git pkg-config libgtk-3-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ @@ -157,6 +157,9 @@ RUN apt-get -qq update \ gcc gfortran libopenblas-dev liblapack-dev && \ rm -rf /var/lib/apt/lists/* +# Ensure python3 defaults to python3.11 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 + RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \ && python3 get-pip.py "pip" --break-system-packages diff --git a/docker/main/install_deps.sh b/docker/main/install_deps.sh index db7383af7..4a695f04a 100755 --- a/docker/main/install_deps.sh +++ b/docker/main/install_deps.sh @@ -11,8 +11,8 @@ apt-get -qq install --no-install-recommends -y \ lbzip2 \ procps vainfo \ unzip locales tzdata libxml2 xz-utils \ - python3 \ - python3-pip \ + python3.11 \ + python3.11-dev \ curl \ lsof \ jq \ @@ -21,6 +21,12 @@ apt-get -qq install --no-install-recommends -y \ libglib2.0-0 \ libusb-1.0.0 +# Ensure python3 defaults to python3.11 +update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 + +wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \ + && python3 get-pip.py "pip" + mkdir -p -m 600 /root/.gnupg # install coral runtime @@ -36,14 +42,8 @@ if [[ "${TARGETARCH}" == "amd64" ]]; then fi if [[ "${TARGETARCH}" == "arm64" ]]; then - if [ -e /usr/local/cuda-12.6 ]; then - # Assume Jetson (Python 3.10) - pip3 install --break-system-packages https://github.com/feranick/TFlite-builds/releases/download/v2.17.0/tflite_runtime-2.17.0-cp310-cp310-linux_aarch64.whl - pip3 install --break-system-packages https://github.com/feranick/pycoral/releases/download/2.0.2TF2.17.0/pycoral-2.0.2-cp310-cp310-linux_aarch64.whl - else - pip3 install --break-system-packages https://github.com/feranick/TFlite-builds/releases/download/v2.17.0/tflite_runtime-2.17.0-cp311-cp311-linux_aarch64.whl - pip3 install --break-system-packages https://github.com/feranick/pycoral/releases/download/2.0.2TF2.17.0/pycoral-2.0.2-cp311-cp311-linux_aarch64.whl - fi + pip3 install --break-system-packages https://github.com/feranick/TFlite-builds/releases/download/v2.17.0/tflite_runtime-2.17.0-cp311-cp311-linux_aarch64.whl + pip3 install --break-system-packages https://github.com/feranick/pycoral/releases/download/2.0.2TF2.17.0/pycoral-2.0.2-cp311-cp311-linux_aarch64.whl fi # btbn-ffmpeg -> amd64 diff --git a/docker/tensorrt/Dockerfile.arm64 b/docker/tensorrt/Dockerfile.arm64 index fe4ad6d09..59892b144 100644 --- a/docker/tensorrt/Dockerfile.arm64 +++ b/docker/tensorrt/Dockerfile.arm64 @@ -10,9 +10,15 @@ ARG DEBIAN_FRONTEND # Use a separate container to build wheels to prevent build dependencies in final image RUN apt-get -qq update \ && apt-get -qq install -y --no-install-recommends \ + python3.11 python3.11-dev \ wget build-essential cmake git \ && rm -rf /var/lib/apt/lists/* +# Ensure python3 defaults to python3.11 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 + +RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \ + && python3 get-pip.py "pip" FROM build-wheels AS trt-wheels ARG DEBIAN_FRONTEND @@ -29,11 +35,11 @@ RUN --mount=type=bind,source=docker/tensorrt/detector/build_python_tensorrt.sh,t COPY docker/tensorrt/requirements-arm64.txt /requirements-tensorrt.txt # See https://elinux.org/Jetson_Zoo#ONNX_Runtime -ADD https://nvidia.box.com/shared/static/6l0u97rj80ifwkk8rqbzj1try89fk26z.whl /tmp/onnxruntime_gpu-1.19.0-cp310-cp310-linux_aarch64.whl +ADD https://nvidia.box.com/shared/static/9yvw05k6u343qfnkhdv2x6xhygze0aq1.whl /tmp/onnxruntime_gpu-1.19.0-cp311-cp311-linux_aarch64.whl RUN pip3 uninstall -y onnxruntime-openvino \ && pip3 wheel --wheel-dir=/trt-wheels -r /requirements-tensorrt.txt \ - && pip3 install --no-deps /tmp/onnxruntime_gpu-1.19.0-cp310-cp310-linux_aarch64.whl + && pip3 install --no-deps /tmp/onnxruntime_gpu-1.19.0-cp311-cp311-linux_aarch64.whl FROM build-wheels AS trt-model-wheels ARG DEBIAN_FRONTEND diff --git a/docker/tensorrt/detector/build_python_tensorrt.sh b/docker/tensorrt/detector/build_python_tensorrt.sh index 1c33459ed..1b0133dd3 100755 --- a/docker/tensorrt/detector/build_python_tensorrt.sh +++ b/docker/tensorrt/detector/build_python_tensorrt.sh @@ -8,7 +8,7 @@ if [[ "${TARGETARCH}" == "arm64" ]]; then wget -q https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.3.0/tars/TensorRT-10.3.0.26.l4t.aarch64-gnu.cuda-12.6.tar.gz -O TensorRT.tar.gz tar -zxf TensorRT.tar.gz - mv TensorRT-10.3.0.26/python/tensorrt-10.3.0-cp310-none-linux_aarch64.whl /trt-wheels/ + mv TensorRT-10.3.0.26/python/tensorrt-10.3.0-cp311-none-linux_aarch64.whl /trt-wheels/ rm -rf TensorRT-10.3.0.26 rm -rf TensorRT.tar.gz