-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.cudasamples
66 lines (50 loc) · 2.37 KB
/
Dockerfile.cudasamples
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
FROM balenalib/jetson-nano-ubuntu:bionic as buildstep
WORKDIR /usr/src/app
COPY ./cuda-repo-l4t-10-0-local-10.0.166_1.0-1_arm64.deb .
COPY ./libcudnn7_7.3.1.28-1+cuda10.0_arm64.deb .
COPY ./libcudnn7-dev_7.3.1.28-1+cuda10.0_arm64.deb .
ENV DEBIAN_FRONTEND noninteractive
RUN \
dpkg -i cuda-repo-l4t-10-0-local-10.0.166_1.0-1_arm64.deb \
libcudnn7_7.3.1.28-1+cuda10.0_arm64.deb \
libcudnn7-dev_7.3.1.28-1+cuda10.0_arm64.deb && \
apt-key add /var/cuda-repo-10-0-local-10.0.166/*.pub && \
apt-get update && \
apt-get install cuda-compiler-10-0 cuda-samples-10-0 -y && \
rm -rf *.deb && \
dpkg --remove cuda-repo-l4t-10-0-local-10.0.166 && \
dpkg -P cuda-repo-l4t-10-0-local-10.0.166 && \
echo "/usr/lib/aarch64-linux-gnu/tegra" > /etc/ld.so.conf.d/nvidia-tegra.conf && \
ldconfig
RUN \
export SMS=53 && \
cd /usr/local/cuda-10.0/samples/0_Simple/clock/ && make -j8 && \
cd /usr/local/cuda-10.0/samples/1_Utilities/deviceQuery/ && make -j8 && \
cd /usr/local/cuda-10.0/samples/2_Graphics/simpleTexture3D/ && make -j8 && \
cd /usr/local/cuda-10.0/samples/2_Graphics/simpleGL/ && make -j8 && \
cd /usr/local/cuda-10.0/samples/3_Imaging/postProcessGL/ && make -j8 && \
cd /usr/local/cuda-10.0/samples/5_Simulations/smokeParticles && make -j8
# Some CUDA libraries are very large and not
# all examples need them. Free up some more space
RUN \
rm -rf /usr/local/cuda-10.0/targets && \
rm -rf /usr/local/cuda-10.0/doc
FROM balenalib/jetson-nano-ubuntu:bionic as final
COPY --from=buildstep /usr/local/cuda-10.0 /usr/local/cuda-10.0
# If planning to only use GPU API, without CUDA runtime API,
# the two lines below can be commented out
COPY --from=buildstep /usr/lib/aarch64-linux-gnu /usr/lib/aarch64-linux-gnu
COPY --from=buildstep /usr/local/lib /usr/local/lib
COPY ./nvidia_drivers.tbz2 .
COPY ./config.tbz2 .
ENV DEBIAN_FRONTEND noninteractive
# If planning to do only headles GPU computing, without video
# display do not install xorg
RUN apt-get update && apt-get install lbzip2 xorg -y && \
tar xjf nvidia_drivers.tbz2 -C / && \
tar xjf config.tbz2 -C / --exclude=etc/hosts --exclude=etc/hostname && \
echo "/usr/lib/aarch64-linux-gnu/tegra" > /etc/ld.so.conf.d/nvidia-tegra.conf && ldconfig && \
rm -rf *.tbz2
ENV UDEV=1
WORKDIR /usr/local/cuda-10.0/samples/bin/aarch64/linux/release
CMD [ "sleep", "infinity" ]