Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile-jetson-jetpack5 2.9 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  1. # Ultralytics YOLO 🚀, AGPL-3.0 license
  2. # Builds ultralytics/ultralytics:jetson-jetson-jetpack5 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
  3. # Supports JetPack5.x for YOLO11 on Jetson Xavier NX, AGX Xavier, AGX Orin, Orin Nano and Orin NX
  4. # Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-pytorch
  5. FROM nvcr.io/nvidia/l4t-pytorch:r35.2.1-pth2.0-py3
  6. # Set environment variables
  7. ENV PYTHONUNBUFFERED=1 \
  8. PYTHONDONTWRITEBYTECODE=1 \
  9. PIP_NO_CACHE_DIR=1 \
  10. PIP_BREAK_SYSTEM_PACKAGES=1
  11. # Downloads to user config dir
  12. ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
  13. https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
  14. /root/.config/Ultralytics/
  15. # Install linux packages
  16. # g++ required to build 'tflite_support' and 'lap' packages
  17. # libusb-1.0-0 required for 'tflite_support' package when exporting to TFLite
  18. # pkg-config and libhdf5-dev (not included) are needed to build 'h5py==3.11.0' aarch64 wheel required by 'tensorflow'
  19. RUN apt-get update && \
  20. apt-get install -y --no-install-recommends \
  21. gcc git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 \
  22. && rm -rf /var/lib/apt/lists/*
  23. # Create working directory
  24. WORKDIR /ultralytics
  25. # Copy contents and configure git
  26. COPY . .
  27. RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
  28. ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
  29. # Remove opencv-python from Ultralytics dependencies as it conflicts with opencv-python installed in base image
  30. RUN sed -i '/opencv-python/d' pyproject.toml
  31. # 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
  32. ADD https://nvidia.box.com/shared/static/mvdcltm9ewdy2d5nurkiqorofz1s53ww.whl onnxruntime_gpu-1.15.1-cp38-cp38-linux_aarch64.whl
  33. # Install pip packages manually for TensorRT compatibility https://github.com/NVIDIA/TensorRT/issues/2567
  34. RUN python3 -m pip install --upgrade pip wheel
  35. RUN pip install onnxruntime_gpu-1.15.1-cp38-cp38-linux_aarch64.whl
  36. RUN pip install -e ".[export]"
  37. # Remove extra build files
  38. RUN rm -rf *.whl /root/.config/Ultralytics/persistent_cache.json
  39. # Usage Examples -------------------------------------------------------------------------------------------------------
  40. # Build and Push
  41. # t=ultralytics/ultralytics:latest-jetson-jetpack5 && sudo docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack5 -t $t . && sudo docker push $t
  42. # Run
  43. # t=ultralytics/ultralytics:latest-jetson-jetpack5 && sudo docker run -it --ipc=host $t
  44. # Pull and Run
  45. # t=ultralytics/ultralytics:latest-jetson-jetpack5 && sudo docker pull $t && sudo docker run -it --ipc=host $t
  46. # Pull and Run with NVIDIA runtime
  47. # t=ultralytics/ultralytics:latest-jetson-jetpack5 && sudo docker pull $t && sudo docker run -it --ipc=host --runtime=nvidia $t
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...