mirror of
https://github.com/ultralytics/ultralytics.git
synced 2025-09-15 15:48:41 +08:00
Improve JetPack5 Dockerfile for NVIDIA Jetson (#18334)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
e48ef8ba61
commit
66487e5451
@ -1,9 +1,9 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:jetson-jetson-jetpack5 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Supports JetPack5.x for YOLO11 on Jetson Xavier NX, AGX Xavier, AGX Orin, Orin Nano and Orin NX
|
||||
# Supports JetPack5.1.2 for YOLO11 on Jetson Xavier NX, AGX Xavier, AGX Orin, Orin Nano and Orin NX
|
||||
|
||||
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-pytorch
|
||||
FROM nvcr.io/nvidia/l4t-pytorch:r35.2.1-pth2.0-py3
|
||||
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-jetpack
|
||||
FROM nvcr.io/nvidia/l4t-jetpack:r35.4.1
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
@ -16,13 +16,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
# g++ required to build 'tflite_support' and 'lap' packages
|
||||
# libusb-1.0-0 required for 'tflite_support' package when exporting to TFLite
|
||||
# pkg-config and libhdf5-dev (not included) are needed to build 'h5py==3.11.0' aarch64 wheel required by 'tensorflow'
|
||||
# Install dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
gcc git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 \
|
||||
git python3-pip libopenmpi-dev libopenblas-base libomp-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create working directory
|
||||
@ -33,15 +30,13 @@ COPY . .
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
|
||||
|
||||
# Remove opencv-python from Ultralytics dependencies as it conflicts with opencv-python installed in base image
|
||||
RUN sed -i '/opencv-python/d' pyproject.toml
|
||||
|
||||
# Download onnxruntime-gpu 1.15.1 for Jetson Linux 35.2.1 (JetPack 5.1). Other versions can be seen in https://elinux.org/Jetson_Zoo#ONNX_Runtime
|
||||
ADD https://nvidia.box.com/shared/static/mvdcltm9ewdy2d5nurkiqorofz1s53ww.whl onnxruntime_gpu-1.15.1-cp38-cp38-linux_aarch64.whl
|
||||
|
||||
# Install pip packages manually for TensorRT compatibility https://github.com/NVIDIA/TensorRT/issues/2567
|
||||
# Pip install onnxruntime-gpu, torch, torchvision and ultralytics
|
||||
RUN python3 -m pip install --upgrade pip uv
|
||||
RUN uv pip install --system onnxruntime_gpu-1.15.1-cp38-cp38-linux_aarch64.whl
|
||||
RUN uv pip install --system \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.18.0-cp38-cp38-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.1.0a0+41361538.nv23.06-cp38-cp38-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.16.2+c6f3977-cp38-cp38-linux_aarch64.whl
|
||||
|
||||
RUN uv pip install --system -e ".[export]"
|
||||
|
||||
# Remove extra build files
|
||||
|
||||
Loading…
Reference in New Issue
Block a user