Skip to content

Instantly share code, notes, and snippets.

@sono-bfio
sono-bfio / cuda80.sh
Created August 9, 2017 19:43
nvidai cuda 8 install
export NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5
export NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
apt-key adv --export --no-emit-version -a $NVIDIA_GPGKEY_FPR | tail -n +5 > cudasign.pub
echo "$NVIDIA_GPGKEY_SUM cudasign.pub" | sha256sum -c --strict - && rm cudasign.pub
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list
apt-get update && apt-get install -y --no-install-recommends cuda-8-0*
@sono-bfio
sono-bfio / salt-bootstrap-gpu-worker.sh
Last active May 2, 2017 15:24
Simple Script to provision saltstack on an Ubuntu 16 system
# Ubuntu 16 Verified
apt-get update && apt-get install -y curl apt-transport-https
curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
sh bootstrap-salt.sh -P git v2016.11.4
echo 'file_client: local' > /etc/salt/minion
echo '' >> /etc/salt/minion
echo '' >> /etc/salt/minion
echo 'log_level: info' >> /etc/salt/minion
echo 'log_level_logfile: info' >> /etc/salt/minion
@sono-bfio
sono-bfio / cua8_install.MD
Created January 25, 2017 02:06
Cuda 8.0 Install

Nvidia Repo Setup

NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \
NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80 && \
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub && \
apt-key adv --export --no-emit-version -a $NVIDIA_GPGKEY_FPR | tail -n +2 > cudasign.pub && \
echo "$NVIDIA_GPGKEY_SUM  cudasign.pub" | sha256sum -c --strict - && rm cudasign.pub && \
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 /" > /etc/apt/sources.list.d/cuda.list

Install PyCuda

Option 1:

# As the root user
sudo su -
pip install pycuda
exit

On the G2.8X we have a total of 8 devices. To expose them to Torch set the environment variable.

  • Note: can't scale much past 8 GPUs due to luajit 1G memory limit *
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
th train-on-mnist-with-gpu.lua 

LUA Script to Train the Model below:

@sono-bfio
sono-bfio / bird_classifier.py
Created August 31, 2016 17:10
cifar-10 and tflearn
from __future__ import division, print_function, absolute_import
# Import tflearn and some helpers
import tflearn
from tflearn.data_utils import shuffle
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
@sono-bfio
sono-bfio / boost_cluster_update.md
Created August 27, 2016 13:58
How to update a boost cluster manually

Upgrading the GPU nodes

1. Launch Bitfusion Boost cluster
2. Log into the client node
$ ssh -l ubuntu -i path/to/your_key.pem {IP}
@sono-bfio
sono-bfio / boost_cluster_update.md
Last active August 27, 2016 14:01
Updating a boost cluster

Upgrading the GPU nodes

1. Launch Bitfusion Boost cluster
2. Log into the client node
$ ssh -l ubuntu -i path/to/your_key.pem {IP}
@sono-bfio
sono-bfio / bird_classifier.py
Created August 24, 2016 16:07
tflearn and cifar 10
from __future__ import division, print_function, absolute_import
# Import tflearn and some helpers
import tflearn
from tflearn.data_utils import shuffle
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
@sono-bfio
sono-bfio / tflearn-install.md
Created August 19, 2016 18:28
Installing TF Learn

Installing tf learn - python 2.7

/usr/local/bin/pip2 tflearn

Install tf learn - python 3.4

/usr/local/bin/pip3 tflearn