Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
18251de
Fix Jetson 6.2.0 builds: Compile GDAL 3.8.5 from source
alexnorell Nov 7, 2025
6208035
Use runtime libraries instead of -dev packages in final stage
alexnorell Nov 7, 2025
2381e04
Merge branch 'main' into fix/jetson-620-rasterio
PawelPeczek-Roboflow Nov 7, 2025
d08baea
Use Ninja build system for GDAL compilation
alexnorell Nov 7, 2025
7f19eea
Update GDAL to latest version 3.11.5
alexnorell Nov 7, 2025
b6c5f05
Fix libproj package name for Ubuntu 22.04
alexnorell Nov 7, 2025
507f397
Update pylogix to 1.1.3 and add file package for Arena API support
alexnorell Nov 7, 2025
aa0f3c9
CRITICAL FIX: Correct PyTorch version constraint for Jetson 6.2.0
alexnorell Nov 8, 2025
6e7b94d
Update to PyTorch 2.8.0, torchvision 0.23.0, and add flash-attn 2.8.2
alexnorell Nov 8, 2025
175d61a
Fix PyTorch version conflict in requirements.transformers.txt
alexnorell Nov 8, 2025
2bf9bdb
Remove system GDAL packages and pin flash-attn to prevent build confl…
alexnorell Nov 8, 2025
fbe1e14
Add libopenblas0 for PyTorch dependency in ONNXRuntime build
alexnorell Nov 8, 2025
f92ff0e
Add libopenblas0 to runtime stage for PyTorch support
alexnorell Nov 10, 2025
1a05fcd
Add NumPy <2.0 constraint for PyTorch 2.8.0 compatibility on Jetson
alexnorell Nov 10, 2025
dff3055
Fix NumPy version compatibility for Jetson PyTorch 2.8.0
alexnorell Nov 10, 2025
c56dc0c
Remove standalone numpy argument from uv pip install
alexnorell Nov 10, 2025
2848136
Add cache-busting comment to ensure NumPy fix is applied
alexnorell Nov 10, 2025
6d10413
Fix NumPy version conflict for Jetson 6.2.0 builds
alexnorell Nov 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 79 additions & 6 deletions docker/dockerfiles/Dockerfile.onnx.jetson.6.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,61 @@ RUN apt-get update -y && \
uvicorn \
python3-pip \
git \
libgdal-dev \
libvips-dev \
wget \
rustc \
cargo \
curl \
cmake \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
file \
libopenblas0 \
libproj-dev \
libsqlite3-dev \
libtiff-dev \
libcurl4-openssl-dev \
libexpat1-dev \
libxerces-c-dev \
libnetcdf-dev \
libhdf5-dev \
libpng-dev \
libjpeg-dev \
libgif-dev \
libwebp-dev \
libzstd-dev \
liblzma-dev \
&& \
apt-get remove -y libgdal-dev gdal-bin libgdal30 2>/dev/null || true && \
rm -rf /var/lib/apt/lists/*

# Compile GDAL from source to get version >= 3.5 for rasterio 1.4.0 compatibility
RUN wget https://github.com/OSGeo/gdal/releases/download/v3.11.5/gdal-3.11.5.tar.gz && \
tar -xzf gdal-3.11.5.tar.gz && \
cd gdal-3.11.5 && \
mkdir build && \
cd build && \
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_JAVA_BINDINGS=OFF \
-DBUILD_CSHARP_BINDINGS=OFF \
&& \
ninja && \
ninja install && \
ldconfig && \
cd ../.. && \
rm -rf gdal-3.11.5.tar.gz gdal-3.11.5

ENV GDAL_CONFIG=/usr/local/bin/gdal-config \
GDAL_DATA=/usr/local/share/gdal \
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \
PATH=/usr/local/bin:$PATH

# Verify GDAL installation
RUN gdal-config --version && \
test "$(gdal-config --version | cut -d. -f1,2)" = "3.11" || (echo "GDAL version mismatch!" && exit 1)

RUN wget -q https://github.com/Kitware/CMake/releases/download/v3.30.5/cmake-3.30.5-linux-aarch64.sh && \
chmod +x cmake-3.30.5-linux-aarch64.sh && \
Expand All @@ -30,6 +76,10 @@ RUN wget -q https://github.com/Kitware/CMake/releases/download/v3.30.5/cmake-3.3
RUN curl -LsSf https://astral.sh/uv/install.sh | env INSTALLER_NO_MODIFY_PATH=1 sh && \
ln -s /root/.local/bin/uv /usr/local/bin/uv

# Force cache invalidation for requirements - NumPy 1.x compatibility
ARG CACHE_BUST=20251110-v2
RUN echo "Cache bust: ${CACHE_BUST}"

COPY requirements/requirements.sam.txt \
requirements/requirements.clip.txt \
requirements/requirements.http.txt \
Expand All @@ -46,7 +96,7 @@ COPY requirements/requirements.sam.txt \
./

RUN python3 -m pip install --upgrade pip && \
python3 -m pip install "torch>=2.8.0" "torchvision>=0.15.2" \
python3 -m pip install "torch>=2.8.0" "torchvision>=0.23.0" \
--index-url https://pypi.jetson-ai-lab.io/jp6/cu126

RUN uv pip install --system --break-system-packages --index-strategy unsafe-best-match \
Expand All @@ -66,7 +116,6 @@ RUN uv pip install --system --break-system-packages --index-strategy unsafe-best
jupyterlab \
"setuptools<=75.5.0" \
packaging \
numpy \
&& rm -rf ~/.cache/uv

WORKDIR /tmp
Expand Down Expand Up @@ -106,6 +155,9 @@ WORKDIR /app

COPY --from=builder /usr/local/lib/python3.10 /usr/local/lib/python3.10
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/local/lib/libgdal* /usr/local/lib/
COPY --from=builder /usr/local/include/gdal* /usr/local/include/
COPY --from=builder /usr/local/share/gdal /usr/local/share/gdal

RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
Expand All @@ -114,13 +166,34 @@ RUN apt-get update -y && \
uvicorn \
python3-pip \
git \
libgdal-dev \
libvips-dev \
wget \
rustc \
cargo \
curl \
&& rm -rf /var/lib/apt/lists/*
file \
libopenblas0 \
libproj22 \
libsqlite3-0 \
libtiff5 \
libcurl4 \
libexpat1 \
libxerces-c3.2 \
libnetcdf19 \
libhdf5-103 \
libpng16-16 \
libjpeg8 \
libgif7 \
libwebp7 \
libzstd1 \
liblzma5 \
&& rm -rf /var/lib/apt/lists/* && \
ldconfig

ENV GDAL_CONFIG=/usr/local/bin/gdal-config \
GDAL_DATA=/usr/local/share/gdal \
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \
PATH=/usr/local/bin:$PATH

WORKDIR /build
COPY . .
Expand Down
4 changes: 2 additions & 2 deletions requirements/_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cachetools<6.0.0
cython~=3.0.0
python-dotenv~=1.0.0
fastapi>=0.100,<0.116 # be careful with upper pin - fastapi might remove support for on_event
numpy>=2.0.0,<2.3.0
numpy>=1.26.0,<2.3.0
opencv-python>=4.8.1.78,<=4.10.0.84
opencv-contrib-python>=4.8.1.78,<=4.10.0.84 # Note: opencv-python considers this as a bad practice, but since our dependencies rely on both we pin both here
pillow>=11.0,<12.0
Expand Down Expand Up @@ -41,7 +41,7 @@ tokenizers>=0.19.0,<0.23.0
slack-sdk~=3.33.4
twilio~=9.3.7
httpx~=0.28.1
pylogix==1.0.5
pylogix==1.1.3
pymodbus>=3.6.9,<=3.8.3
backoff~=2.2.0
filelock>=3.12.0,<=3.17.0
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements.jetson.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pypdfium2>=4.11.0,<5.0.0
jupyterlab>=4.3.0,<5.0.0
PyYAML~=6.0.0
numpy<2.0.0 # PyTorch 2.8.0 from jetson-ai-lab.io requires NumPy 1.x
6 changes: 3 additions & 3 deletions requirements/requirements.sam.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ rf-segment-anything==1.0
samv2==0.0.4
rasterio~=1.4.0
pycocotools>=2.0.10
# TODO: update to 2.8.0 once pre-built flashattn is available
torch>=2.0.1,<2.7.0
torchvision>=0.15.2
torch>=2.8.0
torchvision>=0.23.0
flash-attn==2.8.2
2 changes: 1 addition & 1 deletion requirements/requirements.sdk.http.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dataclasses-json~=0.6.0
opencv-python>=4.8.1.78,<=4.10.0.84
pillow>=11.0,<12.0
supervision>=0.26
numpy>=2.0.0,<2.3.0
numpy>=1.26.0,<2.3.0
aiohttp>=3.9.0,<=3.10.11
backoff~=2.2.0
py-cpuinfo~=9.0.0
6 changes: 3 additions & 3 deletions requirements/requirements.transformers.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO: update to 2.8.0 once pre-built flashattn is available
torch>=2.0.1,<2.7.0
torchvision>=0.15.0
torch>=2.8.0
torchvision>=0.23.0
flash-attn==2.8.2
transformers>=4.53.3,<4.57.0
timm~=1.0.0
#accelerate>=0.32,<1.0.0
Expand Down
Loading