-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile.jetson-agx-orin-devkit
94 lines (74 loc) · 3.77 KB
/
Dockerfile.jetson-agx-orin-devkit
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM balenalib/jetson-agx-orin-devkit-ubuntu:focal-run-20221215
WORKDIR /usr/src/app
#OpenDataCam 3.0.2
ENV DEBIAN_FRONTEND noninteractive
# Install CUDA, CUDA compiler and some utilities
RUN \
apt-get update && apt-get install -y nvidia-l4t-cuda nvidia-cuda \
nvidia-cuda-dev libcudnn8 libcudnn8-dev \
lbzip2 git wget unzip jq \
cmake build-essential wget unzip \
libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev \
libwebp-dev libtbb2 libtbb-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-good \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libdc1394-22-dev -y --no-install-recommends && \
echo "/usr/lib/aarch64-linux-gnu/tegra" > /etc/ld.so.conf.d/nvidia-tegra.conf && \
ldconfig && \
wget https://github.com/opencv/opencv/archive/4.5.1.zip && \
unzip 4.5.1.zip && rm 4.5.1.zip
# Set paths
ENV CUDA_HOME=/usr/local/cuda-11.4
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CUDA_HOME}/lib64
ENV PATH=${CUDA_HOME}/bin:${PATH}
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# Download and install BSP binaries for L4T 35.1
RUN \
apt-get update && apt-get install -y tar binutils xz-utils zstd && \
cd /tmp/ && wget https://developer.nvidia.com/embedded/l4t/r35_release_v1.0/release/jetson_linux_r35.1.0_aarch64.tbz2 && \
tar xf jetson_linux_r35.1.0_aarch64.tbz2 && \
cd Linux_for_Tegra && \
sed -i 's/config.tbz2\"/config.tbz2\" --exclude=etc\/hosts --exclude=etc\/hostname/g' apply_binaries.sh && \
sed -i 's/install --owner=root --group=root \"${QEMU_BIN}\" \"${L4T_ROOTFS_DIR}\/usr\/bin\/\"/#install --owner=root --group=root \"${QEMU_BIN}\" \"${L4T_ROOTFS_DIR}\/usr\/bin\/\"/g' nv_tegra/nv-apply-debs.sh && \
sed -i 's/chroot . \// /g' nv_tegra/nv-apply-debs.sh && \
./apply_binaries.sh -r / --target-overlay && cd .. \
rm -rf Linux_for_Tegra && \
echo "/usr/lib/aarch64-linux-gnu/tegra" > /etc/ld.so.conf.d/nvidia-tegra.conf && ldconfig
# Download and install OpenCV 4.5.1
RUN \
wget https://github.com/opencv/opencv_contrib/archive/4.5.1.zip -O opencv_modules.4.5.1.zip && \
unzip opencv_modules.4.5.1.zip && rm opencv_modules.4.5.1.zip && \
mkdir -p opencv-4.5.1/build && cd opencv-4.5.1/build && \
cmake -D WITH_CUDA=ON -D CUDA_ARCH_BIN="5.3" -D BUILD_LIST=cudev,highgui,videoio,cudaimgproc,ximgproc -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.5.1/modules -D CUDA_ARCH_PTX="" -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_TESTS=ON -D BUILD_PERF_TESTS=ON -D BUILD_SAMPLES=ON -D BUILD_EXAMPLES=ON -D CMAKE_BUILD_TYPE=RELEASE -D WITH_GTK=on -D BUILD_DOCS=OFF -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_GENERATE_PKGCONFIG=YES .. && make -j32 && make install && \
rm -rf /usr/src/app/opencv_contrib-4.5.1
WORKDIR /
# Download and build Darknet
RUN \
git clone https://github.com/AlexeyAB/darknet.git
WORKDIR /darknet
COPY ./Makefile.jetson-agx-orin-devkit ./Makefile
RUN make && ldconfig
# get weights and cfg for yolov4/yolov4-tiny
RUN wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights --no-check-certificate > /dev/null 2>&1 && \
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights --no-check-certificate > /dev/null 2>&1
COPY ./yolov4-416x416.cfg /darknet/cfg/yolov4-416x416.cfg
# Download and install OpenDataCam
# first install node.js
RUN \
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && \
apt-get install -y nodejs
RUN \
git clone --depth 1 https://github.com/opendatacam/opendatacam.git /var/local/opendatacam
WORKDIR /var/local/opendatacam
RUN \
npm install && \
npm run build
EXPOSE 8080 8070 8090
COPY config.jetson-agx-orin-devkit config.bak
COPY launch.sh launch.sh
RUN chmod 777 launch.sh
CMD ["./launch.sh"]