Skip to content

Instantly share code, notes, and snippets.

@gkthiruvathukal
Created March 24, 2019 17:06
Show Gist options
  • Select an option

  • Save gkthiruvathukal/8fc9262ec1b594e9c4d280df60f5e327 to your computer and use it in GitHub Desktop.

Select an option

Save gkthiruvathukal/8fc9262ec1b594e9c4d280df60f5e327 to your computer and use it in GitHub Desktop.
singularity recipe and how to build/run for YOLOv3/darknet
To run this gist, you need to have the singularity container framework installed on your computer.
The host system must have a GPGPU.
sudo singularity build darknet-singularity.simg darknet-singularity.recipe
Bootstrap: docker
From: nvidia/cuda:9.0-cudnn7-devel-centos7
%help
Centos7 with cuda9.0 cudnn7
To start your container simply try
singularity exec THIS_CONTAINER.simg bash
To use GPUs, try
singularity exec --nv THIS_CONTAINER.simg bash
%environment
# for system
export CUDA_DEVICE_ORDER=PCI_BUS_ID
# Add cupti to the path for profiling:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64
source scl_source enable devtoolset-4
%post
# yum basics
yum update -y
yum groupinstall -y "Development Tools"
yum install -y epel-release
yum install -y centos-release-scl
yum install -y devtoolset-4
yum install -y wget emacs vim
yum install -y emacs vim openssh-clients zip
yum install -y python-devel python-pip python-setuptools
yum install -y hdf5
yum install -y opencv opencv-devel opencv-python
# pip basics
pip --no-cache-dir --disable-pip-version-check install --upgrade setuptools
pip --no-cache-dir --disable-pip-version-check install future
pip --no-cache-dir --disable-pip-version-check install 'matplotlib<3.0' # for python2.7
pip --no-cache-dir --disable-pip-version-check install 'ipython<6.0' # for python2.7
pip --no-cache-dir --disable-pip-version-check install 'ipykernel<5.0' # for python2.7
pip --no-cache-dir --disable-pip-version-check install numpy wheel zmq six pygments pyyaml cython gputil psutil humanize h5py tqdm scipy seaborn tables
pip --no-cache-dir --disable-pip-version-check install pandas scikit-image scikit-learn Pillow opencv-python
pip --no-cache-dir --disable-pip-version-check install jupyter notebook
# verify OpenCV
pkg-config --modversion opencv
# YOLO
git clone https://github.com/pjreddie/darknet
cd darknet
make
singularity run darknet-singularity.simg darknet/darknet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment