Skip to content

Instantly share code, notes, and snippets.

@soulslicer
Created July 9, 2014 21:17
Show Gist options
  • Save soulslicer/be0826d243428e5bae63 to your computer and use it in GitHub Desktop.
Save soulslicer/be0826d243428e5bae63 to your computer and use it in GitHub Desktop.
OpenCL on GPU instance
# This script installs everything you need on an EC2 GPU Instance
# Create an Ubuntu 12.04 GPU Instance with at least 16GB of free space
# Base packages
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install gcc git cmake
# CUDA/Nvidia installations
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_6.0-37_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1204_6.0-37_amd64.deb
sudo apt-get update
sudo apt-get install cuda
sudo apt-get install locate
sudo updatedb
export PATH=/usr/local/cuda-6.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-6.0/lib64:$LD_LIBRARY_PATH
mkdir CUDA
cd CUDA
cuda-install-samples-6.0.sh .
cd NVIDIA_CUDA-6.0_Samples/1_Utilities/deviceQuery
make
./deviceQuery
cd ~/CUDA
# Python OpenCL
sudo apt-get install opencl-headers python-pip python-dev python-numpy python-mako libboost-python-dev
sudo pip install PyOpenGL PyOpenGL_accelerate --upgrade
git clone https://github.com/pyopencl/pyopencl
cd pyopencl
sudo python configure.py --cl-enable-gl
sudo find /usr/local/cuda-6.0/lib64/ -type f -exec cp {} /usr/lib \;
sudo ldconfig -v
sudo python setup.py build
sudo python setup.py install
# X Server
sudo apt-get install xorg openbox libglew-dev mesa-utils python-xdg
cd /etc/X11
sudo wget https://gist.githubusercontent.com/soulslicer/4e61f28345918ddfda36/raw/ed41f3874b4d1bbf0e500443f5176b12e1a82895/xorg.conf
sudo xinit &
cd ~/CUDA
wget https://gist.githubusercontent.com/soulslicer/816d9fcb342981f3870c/raw/8ba31acb2c38db6f09346827edb5874dacd2d77a/TEAPOT.py
sudo nvidia-xconfig
cd ~/CUDA
# OpenCL
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libglib2.0-dev
sudo apt-get install libgtkglext1
sudo apt-get install libgtkglext1-dev
sudo apt-get build-dep ffmpeg
sudo apt-get install ffmpeg
sudo apt-get build-dep vlc
sudo apt-get install vlc
git clone https://github.com/Itseez/opencv.git
cd opencv
git checkout 2.4.9.x-prep
mkdir build
cd build
cmake -D WITH_OPENGL=ON WITH_OPENCL=ON WITH_CUDA=ON -D BUILD_EXAMPLES=ON WITH_FFMPEG=ON ..
sudo make
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment