Amazon EC2: GPU Cluster

From the Linux and Unix Users Group at Virginia Tech Wiki
Jump to: navigation, search

An Amazon EC2: GPU cluster is a remote GPU cluster serive.

Creating a new image

Check which distributions are supported, here. All you are concerned about are the developer drivers. From this point on, we will deal with a SUSE instance, but the general steps will be the same. Only select an instance that can work with CUDA!

  • With the Classic Wizard, select Cluster Instances HVM SUSE Linux Enterprise 11
  • Change the Instance Type from M3 Extra Large to CG1 Cluster GPU (cg1.4xlarge).
  • Enable Termination protection.
  • Make sure you specify that your Elastic Block Storage volume NOT be destroyed when the instance is terminated (or your data will be lost when the instance is terminated, which may happen without your consent if you are using a spot instance and the variable price exceeds your maximum bid).
  • Generate your key pair and allow SSH access to the server.
  • Review the instance type and ensure all details are correct.
  • Pricing information may be found here. "Spot instances" are generally the way to go but be sure to bid with a high enough margin from the current price that you wont be shut down unintentionally. Even double the current spot price is usually lower than the on-demand price.

Installing CUDA

Zypper is Suse's package manager; YaST could alternatively be used if more comfortable with a GUI. First, SSH into the system, update the package cache and upgrade:

SSH -i /PATH/TO/PKEY root@ec2-...-amazonaws.com
zypper ref
zypper up

Install the needed packages and generate needed config:

zypper in gcc kernel-ec2-devel kernel-docs
cd /usr/src/linux
make cloneconfig

Restart the instance:

reboot

You will be booted from the instance, just wait for it to resume again.

Now get the latest CUDA install and run the file:

wget http://developer.download.nvidia.com/compute/cuda/$CUDA_MAJOR_VERSION/$CUDA_MINOR_VERSION/installers/cuda_5.0.35_$(Linux|Windows)_$ARCH_$IMG.run
chmod +x cuda_*.run
./cuda_*.run

We only need the developer drivers. Ensure that the drivers install correctly. Note that it needs to run as root. The cuda dev drivers are already installed in some AMIs (for example the CentOS-GPU image).

oclHashCat-plus

Get oclHashCat:

wget http://hashcat.net/files/oclHashcat-plus-0.14.7z

To extract and use oclHashCat, we must unpackage the 7zip archive. In many distributions 7z is provided by the p7zip package. SUSE users need to download the binaries and extract it:

wget http://downloads.sourceforge.net/project/p7zip/p7zip/9.20.1/p7zip_9.20.1_x86_linux_bin.tar.bz2?r=&ts=1365352571&use_mirror=hivelocity
tar xjvf p7zip_9.20.1_x86_linux_bin.tar.bz2

Unarchive file, extracting full path:

7z x oclHashcat-plus-0.14.7z
cd oclHashcat-plus-0.14

Running oclHashcat-plus (in a screen session):

screen
./cudaHashcat-plus64 $HASHES ($DICTIONARY | -m $hashmask | --rules=$RULES) 

oclHashcat-plus assumes unsalted md5 by default

Tunneling

You can tunnel single ports or run a socks proxy with SSH. Google for SSH forwarding or see the howto below.

See Also

External Links