Create a gist now

Instantly share code, notes, and snippets.

Install CUDA, OpenCL, and PyOpenCL on EC2 with Ubuntu 12.04
#!/bin/bash
sudo apt-get update
sudo apt-get install gcc
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_5.5-0_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1204_5.5-0_amd64.deb
sudo apt-get update
sudo apt-get install cuda
export PATH=/usr/local/cuda-5.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:$LD_LIBRARY_PATH
sudo apt-get install opencl-headers python-pip python-dev python-numpy python-mako
wget https://pypi.python.org/packages/source/p/pyopencl/pyopencl-2013.1.tar.gz#md5=c506e4ec5bc56ad85bf005ec40d4783b
tar -vxzf pyopencl-2013.1.tar.gz
cd pyopencl-2013.1
sudo python setup.py install
@soulslicer

FYI:

This doesn't seem to work with cuda 6.0 anymore. Here are some updates after the install cuda step

export PATH=/usr/local/cuda-6.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-6.0/lib64:$LD_LIBRARY_PATH
wget https://pypi.python.org/packages/source/p/pyopencl/pyopencl-2014.1.tar.gz
tar -vxzf pyopencl-2014.1.tar.gz
cd pyopencl-2014.1
sudo cp -R /usr/local/cuda-6.0/lib64/ /usr/lib
sudo ldconfig -v
sudo python setup.py install

@erikhazzard
Owner

Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment