forked from zhuhaijun753/cogwerx-jetson-tx2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.cudabase
48 lines (39 loc) · 2.25 KB
/
Dockerfile.cudabase
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
#FROM aarch64/ubuntu
FROM arm64v8/ubuntu:xenial-20180123
#AUTHOR [email protected]
MAINTAINER [email protected]
# This is the base container for the Jetson TX2 board with drivers (with cuda)
# base URL for NVIDIA libs
ARG URL=https://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/JETPACK_422_b21
# Update packages, install some useful packages
RUN apt-get update && apt-get install -y apt-utils bzip2 curl lbzip2 sudo unp && apt-get clean && rm -rf /var/cache/apt
WORKDIR /tmp
# Install drivers first
RUN curl -sL $URL/P3310/Jetson_Linux_R32.2.1_aarch64.tbz2 | tar xvfj -
RUN chown root /etc/passwd /etc/sudoers /usr/lib/sudo/sudoers.so /etc/sudoers.d/README && \
mkdir /tmp/root && \
cp -ar /etc /tmp/root/ && \
/tmp/Linux_for_Tegra/apply_binaries.sh -r /tmp/root && \
rm /tmp/root/etc/hosts /tmp/root/etc/hostname && \
cp -ar /tmp/root/* / && \
rm -fr /tmp/*
## Pull the rest of the jetpack libs for cuda/cudnn and install
RUN curl $URL/cuda-repo-l4t-10-0-local-10.0.326_1.0-1_arm64.deb -so cuda-repo-l4t_arm64.deb
RUN curl $URL/P3310/libcudnn7_7.5.0.56-1+cuda10.0_arm64.deb -so /tmp/libcudnn_arm64.deb
RUN curl $URL/P3310/libcudnn7-dev_7.5.0.56-1+cuda10.0_arm64.deb -so /tmp/libcudnn-dev_arm64.deb
## Install libs: L4T, CUDA, cuDNN
RUN dpkg -i /tmp/cuda-repo-l4t_arm64.deb
RUN apt-key add /var/cuda-repo-10-0-local-10.0.326/7fa2af80.pub
RUN apt-get update && apt-get install -y cuda-toolkit-10.0
RUN dpkg -i /tmp/libcudnn_arm64.deb
RUN dpkg -i /tmp/libcudnn-dev_arm64.deb
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra
## Re-link libs in /usr/lib/<arch>/tegra
RUN ln -s /usr/lib/aarch64-linux-gnu/tegra/libnvidia-ptxjitcompiler.so.32.2.1 /usr/lib/aarch64-linux-gnu/tegra/libnvidia-ptxjitcompiler.so
RUN ln -s /usr/lib/aarch64-linux-gnu/tegra/libnvidia-ptxjitcompiler.so.32.2.1 /usr/lib/aarch64-linux-gnu/tegra/libnvidia-ptxjitcompiler.so.1
RUN ln -sf /usr/lib/aarch64-linux-gnu/tegra/libGL.so /usr/lib/aarch64-linux-gnu/libGL.so
# D.R. -- need to do this for some strange reason (for jetson tx2)
RUN ln -s /usr/lib/aarch64-linux-gnu/libcuda.so /usr/lib/aarch64-linux-gnu/libcuda.so.1
## Clean up (don't remove cuda libs... used by child containers)
RUN apt-get -y autoremove && apt-get -y autoclean
RUN rm -rf /var/cache/apt