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-jetpack6 2.5 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
  1. # Ultralytics YOLO 🚀, AGPL-3.0 license
  2. # Builds ultralytics/ultralytics:jetson-jetpack6 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
  3. # Supports JetPack6.x for YOLOv8 on Jetson AGX Orin, Orin NX and Orin Nano Series
  4. # Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-jetpack
  5. FROM nvcr.io/nvidia/l4t-jetpack:r36.3.0
  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 dependencies
  16. RUN apt update && \
  17. apt install --no-install-recommends -y git python3-pip libopenmpi-dev libopenblas-base libomp-dev
  18. # Create working directory
  19. WORKDIR /ultralytics
  20. # Copy contents and configure git
  21. COPY . .
  22. RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
  23. ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt .
  24. # Download onnxruntime-gpu 1.18.0 from https://elinux.org/Jetson_Zoo and https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048
  25. ADD https://nvidia.box.com/shared/static/48dtuob7meiw6ebgfsfqakc9vse62sg4.whl onnxruntime_gpu-1.18.0-cp310-cp310-linux_aarch64.whl
  26. # Pip install onnxruntime-gpu, torch, torchvision and ultralytics
  27. RUN python3 -m pip install --upgrade pip wheel
  28. RUN pip install \
  29. onnxruntime_gpu-1.18.0-cp310-cp310-linux_aarch64.whl \
  30. https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.3.0-cp310-cp310-linux_aarch64.whl \
  31. https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.18.0a0+6043bc2-cp310-cp310-linux_aarch64.whl
  32. RUN pip install -e ".[export]"
  33. RUN rm *.whl
  34. # Usage Examples -------------------------------------------------------------------------------------------------------
  35. # Build and Push
  36. # t=ultralytics/ultralytics:latest-jetson-jetpack6 && sudo docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack6 -t $t . && sudo docker push $t
  37. # Run
  38. # t=ultralytics/ultralytics:latest-jetson-jetpack6 && sudo docker run -it --ipc=host $t
  39. # Pull and Run
  40. # t=ultralytics/ultralytics:latest-jetson-jetpack6 && sudo docker pull $t && sudo docker run -it --ipc=host $t
  41. # Pull and Run with NVIDIA runtime
  42. # t=ultralytics/ultralytics:latest-jetson-jetpack6 && 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...