-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtf2v9
More file actions
157 lines (134 loc) · 4.74 KB
/
tf2v9
File metadata and controls
157 lines (134 loc) · 4.74 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
BootStrap: docker
From: ubuntu:bionic
%help
Container for
tensorflor-gpu=2.8.0
torch1.11.0+cu113
cudatoolkit=11.4.2
cudnn=8.2.4
jupyter
jupyterlab
tensorRT=8.2.3
no nvidia-driver 470
ubuntu 18.04
python 3.8
enable x-forwarding
%environment
# Set system locale, cuDNN has to be downloaded locally
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
CUDA=/usr/local/cuda/lib64:/usr/local/cuda-11.4/lib64:/usr/local/cuda-11.4/targets/x86_64-linux/lib/
LD_LIBRARY_PATH=/.singularity.d/libs:$CUDA
PYTHONPATH=modules:/usr/local/lib/python3.8/dist-packages/:/usr/bin/python3.8
LANG=C.UTF-8 LC_ALL=C.UTF-8
%post
# Change to tmp directory to download temporary files.
#echo 'Dpkg::Post-Invoke {"/bin/chown -R root:root /var/lib/apt /var/cache/apt";};' > /etc/apt/apt.conf.d/singularity-chown
cd /tmp
# Install essential software, languages and libraries.
#apt-get -o Acquire::GzipIndexes=false -o APT::Sandbox::User=root update
apt-get update
export DEBIAN_FRONTEND=noninteractive
apt-get -qq install -y --no-install-recommends tzdata apt-utils
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata
apt-get -qq -y update
apt-get -qq install -y --no-install-recommends \
autoconf \
automake \
build-essential \
bzip2 \
ca-certificates \
cmake \
gcc \
g++ \
gfortran \
git \
gnupg2 \
libtool \
libjpeg-dev \
zlib1g-dev \
libeigen3-dev \
libcupti-dev \
libssl-dev \
libxt-dev \
neovim \
openjdk-8-jdk \
python \
python-pip \
python-dev \
python3-dev \
python3-pip \
python3.8 \
python3-wheel \
swig \
vim \
less \
wget \
xvfb \
xfonts-base \
zip \
xauth \
xorg \
openbox \
x11-apps \
xserver-xorg-core \
xserver-xorg \
lynx
export LANG=C.UTF-8 LC_ALL=C.UTF-8
apt-get install -y --no-install-recommends zlib1g
apt-get install -y --no-install-recommends dialog apt-utils
apt-get update
# install cudatoolkits 11-4 that operate in x86-64, 18.04-Ubuntu, deb (local) installer type
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin > cuda-ubuntu1804.pin
mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
#wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda-repo-ubuntu1804-11-4-local_11.4.2-470.57.02-1_amd64.deb
dpkg -i cuda-repo-ubuntu1804-11-4-local_11.4.2-470.57.02-1_amd64.deb
apt-key add /var/cuda-repo-ubuntu1804-11-4-local/7fa2af80.pub
apt-get update
apt-get install -y cuda-11-4
#apt-get install -y nvidia-driver-470
dpkg -i libcudnn8_8.2.4.15-1+cuda11.4_amd64.deb
dpkg -i libcudnn8-dev_8.2.4.15-1+cuda11.4_amd64.deb
dpkg -i libcudnn8-samples_8.2.4.15-1+cuda11.4_amd64.deb
apt-get update
#install runtime library
apt-get install -y libcudnn8=8.2.4.15-1+cuda11.4
apt-get install -y libcudnn8-dev=8.2.4.15-1+cuda11.4
apt-get install -y libcudnn8-samples=8.2.4.15-1+cuda11.4
# Install TensorRT 8.2.3. Requires that libcudnn8 is installed above.
# pkg was retrieved locally due to registration limit
Os="ubuntu1804"
Tag="cuda11.4-trt8.2.3.0-ga-20220113"
dpkg -i nv-tensorrt-repo-${Os}-${Tag}_1-1_amd64.deb
apt-key add /var/nv-tensorrt-repo-${Os}-${Tag}/7fa2af80.pub
apt-get update
apt-get install -y tensorrt
# Update python pip.
python3.8 -m pip install --upgrade pip
python3.8 -m pip --no-cache-dir install setuptools --upgrade
python -m pip --no-cache-dir install setuptools --upgrade
python3.8 -m pip install tensorflow-gpu==2.8.0
python3.8 -m pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
python3.8 -m pip install jupyter
python3.8 -m pip install jupyterlab
apt-get install -y python3-libnvinfer-dev
# going to use tensorRT with tensorflow
python3 -m pip install --no-dependencies protobuf
apt-get install -y --no-install-recommends uff-converter-tf
# Cleanup
apt-get -qq clean
rm -rf /tmp/mpi
rm -rf /var/lib/apt/lists/*
%test
python3 -V
pip -V
grep -q NAME=\"Ubuntu\" /etc/os-release
if [ $? -eq 0 ]; then
echo "Container base is Ubuntu as expected."
else
echo "Container base is not Ubuntu."
exit 1
fi
%labels
Author yinuo
Version v0.0.1