-
Notifications
You must be signed in to change notification settings - Fork 62
/
Dockerfile
97 lines (86 loc) · 3.45 KB
/
Dockerfile
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
95
96
97
ARG UBUNTU_VERSION
FROM ubuntu:${UBUNTU_VERSION}
WORKDIR /root/
# Add libcuda dummy dependency
RUN printf "\
Package: libcuda1-dummy\n\
Maintainer: Lambda Labs <[email protected]>\n\
Version: 12.4\n\
Provides: libcuda1 (= 550)\n\
, libcuda-12.4-1\n\
, libnvidia-ml1 (= 550)\n\
" > control
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes equivs && \
equivs-build control && \
dpkg -i libcuda1-dummy_12.4_all.deb && \
rm control libcuda1-dummy_12.4* && \
apt-get remove --yes --purge --autoremove equivs && \
rm -rf /var/lib/apt/lists/*
# Install pre-requisites
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes lsb-release gnupg && \
rm -rf /var/lib/apt/lists/*
# Setup GPG key
RUN printf -- "\
-----BEGIN PGP PUBLIC KEY BLOCK-----\n\
\n\
mQINBFrFv5kBEADLAYqKVCC0T+bOGMQ2duQ/XN/iT/F+I4B/qjPGBNC84oLtTfK7\n\
Ig0ctPKVVbOOKbXD1U/+dy/guJRF2G9nzxrod1n02wonzig3/qDzTS0iaDcBlWF9\n\
sdVWppQ/e7LrCKz+2ywPDnzE1UAf3R8YMiB+Ve6SDndLXpcjdtvx8yhJkNBP6EAA\n\
kfOugrmUBwuEH6mQG0NfrfcybM5KWc1K7NmNgFcH4LnmqyVLTHEIJc2afZl3Q4aa\n\
CKwr2lwwihXQRb47GWaZictFfp2fswWl2HuohTIfTboyzLEE7goqys+KYoy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/cXGcq9ht/a9z4k\n\
JVldCp1+9JAY81UWLZfnid1wcWGOGazztZmbaCHY5d04yA45IqksPFB8I6T3hZuO\n\
D+vS4I2Zxv0kq6qkF+UBdu/jyTHJ887PwFBKKAsZIvxI6U4rWRqexplgaTM8CIx8\n\
8EK3WlhRiW7KTJLd/Hs0iJxVWPEdoY8px8cNrAAovBPgoX8XR9DZEO1UxysIsU2h\n\
vcAqOJpavozl4MwEXd0WBT7cDfmR/xz/tZkuK3TiVp9H\n\
=9oLr\n\
-----END PGP PUBLIC KEY BLOCK-----\n\
" > lambda.gpg
RUN gpg --dearmor -o /etc/apt/trusted.gpg.d/lambda.gpg < lambda.gpg && \
rm lambda.gpg
# Setup repository
RUN printf "\
deb http://archive.lambdalabs.com/ubuntu $(lsb_release -cs) main\n\
" > /etc/apt/sources.list.d/lambda.list
RUN printf "\
Package: *\n\
Pin: origin archive.lambdalabs.com\n\
Pin-Priority: 1001\n\
" > /etc/apt/preferences.d/lambda
# Install lambda-stack packages
RUN apt-get update && \
echo "cudnn cudnn/license_preseed select ACCEPT" | debconf-set-selections && \
DEBIAN_FRONTEND=noninteractive \
apt-get install \
--yes \
--no-install-recommends \
--option "Acquire::http::No-Cache=true" \
--option "Acquire::http::Pipeline-Depth=0" \
lambda-stack-cuda && \
rm -rf /var/lib/apt/lists/*
# Let pip break system packages
RUN printf "\
[global]\n\
break-system-packages = true\n\
" > /etc/pip.conf
# Setup for nvidia-docker
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.4"