-
Notifications
You must be signed in to change notification settings - Fork 224
Fix Jetson 6.2.0 builds: Compile GDAL 3.8.5 from source for rasterio compatibility #1695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
alexnorell
wants to merge
12
commits into
main
Choose a base branch
from
fix/jetson-620-rasterio
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+81
−12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of downgrading rasterio, compile GDAL 3.8.5 from source to meet rasterio 1.4.0's requirement for GDAL >= 3.5. Changes: - Compile GDAL 3.8.5 from source in builder stage - Copy GDAL libraries and data to runtime stage - Install required GDAL dependencies - Set GDAL environment variables (GDAL_CONFIG, GDAL_DATA, LD_LIBRARY_PATH) This provides a forward-compatible solution while maintaining compatibility with rasterio 1.4.0 and keeping packages up to date. Jetpack r36.4.0 ships with GDAL 3.4.1, which is incompatible with rasterio 1.4.x (requires >= 3.5). Building from source solves this.
9632306 to
18251de
Compare
Runtime stage only needs the runtime libraries to run GDAL, not the development headers and static libraries. This reduces image size. Changed from: - libproj-dev → libproj25 - libsqlite3-dev → libsqlite3-0 - libtiff-dev → libtiff5 - libcurl4-openssl-dev → libcurl4 - etc. Builder stage keeps -dev packages (needed for compilation).
PawelPeczek-Roboflow
previously approved these changes
Nov 7, 2025
Changed GDAL build from Make to Ninja for faster parallel compilation: - Added -GNinja to cmake to generate Ninja build files - Use 'ninja' instead of 'make -j$(nproc)' - Use 'ninja install' instead of 'make install' Ninja is faster and more efficient for parallel builds. ninja-build package is already installed in dependencies.
Updated from 3.8.5 to 3.11.5 (latest as of Nov 4, 2025). Benefits of 3.11.x: - Latest bug fixes and security updates - Improved performance - New format support - Still meets rasterio 1.4.0 requirement (GDAL >= 3.5)
Changed libproj25 to libproj22 (correct package name for Ubuntu 22.04 Jammy). Build was failing with: E: Unable to locate package libproj25
- Bump pylogix from 1.0.5 to 1.1.3 (latest version) - Add file package to both builder and runtime stages - file command is required by Arena API for binary architecture validation This ensures compatibility with the latest pylogix version and enables proper Arena SDK functionality.
The Dockerfile incorrectly specified torch>=2.8.0 which doesn't exist, causing pip to fall back to CPU-only PyTorch from PyPI instead of using the GPU-enabled version from jetson-ai-lab.io. Changed to torch>=2.0.1,<2.7.0 to match requirements.sam.txt and ensure GPU-enabled PyTorch is installed from the Jetson AI Lab index. This fixes the critical bug where the container had no PyTorch GPU support.
This fulfills the TODO in requirements.sam.txt to update to PyTorch 2.8.0 now that pre-built flash-attn is available on jetson-ai-lab.io. Changes: - PyTorch: >=2.0.1,<2.7.0 → >=2.8.0 - torchvision: >=0.15.2 → >=0.23.0 (latest) - Added: flash-attn>=2.8.2 for SAM2 support This enables full GPU acceleration for SAM2 and other transformer models with flash attention support on Jetson Orin.
Updated requirements.transformers.txt to match requirements.sam.txt: - torch: >=2.0.1,<2.7.0 → >=2.8.0 - torchvision: >=0.15.0 → >=0.23.0 - Added: flash-attn>=2.8.2 This resolves the dependency conflict that was causing builds to fail.
…icts - Remove libgdal-dev from apt-get to prevent conflict with compiled GDAL 3.11.5 - Add GDAL version verification to ensure correct version is available - Pin flash-attn to 2.8.2 to match pre-built wheel on jetson-ai-lab.io Fixes GDAL version detection issue where rasterio was finding system GDAL 3.4.1 instead of compiled 3.11.5, and flash-attn build failures when uv tried to compile 2.8.3 from source.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Jetson 6.2.0 Docker builds are failing with:
Root Cause
Solution
Compile GDAL 3.8.5 from source instead of downgrading rasterio.
This provides a forward-compatible solution that:
Implementation
GDAL_CONFIG,GDAL_DATA,LD_LIBRARY_PATH)Testing
Will be tested via GitHub Actions Depot build on merge.
Related
Fixes all recent Jetson 6.2.0 workflow failures on main branch.