-
Notifications
You must be signed in to change notification settings - Fork 0
/
Singularity
45 lines (34 loc) · 1.12 KB
/
Singularity
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
Bootstrap: docker
From: nvidia/cuda:9.0-devel
%help
Container for Tensorflow
To install run:
sudo singularity build tensorflow-gpu.img Singularity
To run
singularity run --nv tensorflow-gpu.img
%labels
MAINTAINER Colin Sauze
%environment
%post
pwd
apt-get update
apt-get -y install unzip wget build-essential git gdal-bin python-numpy python-opencv anaconda
mkdir /usr/lib/nvidia
apt-get -y install libcuda1-396
cd /opt
if [ ! -d "TensorFlow-GPU-Example-Singularity" ] ; then
git clone https://github.com/SupercomputingWales/TensorFlow-GPU-Example-Singularity.git
cd TensorFlow-GPU-Example-Singularity
#git checkout test
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
./tensorflow_setup.sh
#we don't actually need the cuda libraries and the gigabyte of dependencies they installed if we run the container with the --nv option.
apt-get -y purge libcuda1-396
apt-get -y clean
apt-get -y autoclean
apt-get -y --purge autoremove
fi
%runscript
cd /opt/TensorFlow-GPU-Example-Singularity
conda activate tensorflow-gpu
python multilayer_perceptron.py