GPU Guide

From Storrs HPC Wiki
Revision as of 16:23, 20 June 2012 by Stc07008 (talk | contribs)
Jump to: navigation, search

The following assumes you are already connected to the cluster.

Basic CUDA compilation

First you need to load the CUDA module:

module load cuda/4.1

If you plan on doing extensive GPU work, you'll want to initadd it, which will load it on every log-in:

module initadd cuda/4.1

To compile with CUDA, using the NVidia CUDA compiler:

nvcc {} -o {OUTPUT_FILE}

Running GPU jobs

There are four GPU nodes, each with 8 NVIDIA Tesla M2050 GPU's. They can be used in EXCLUSIVE mode or SHARED mode. SHARED mode means that GPU's will be shared among those requiring it. It is the default, and satisfactory most of the time. The alternative is EXCLUSIVE mode, which ensures that you are the only user on the GPU nodes you are using. It is only recommended for jobs that utilize the GPUs almost 100% or require a lot of GPU memory. In this case, they may sit in the queue longer, but will provide better performance.

  • Use the following command to use a GPU in SHARED mode:
bsub -a gpushared -q gpu {COMMAND}
  • If you need to use just 1 GPU in EXCLUSIVE mode:
bsub -a gpuexcl_p -q gpu {COMMAND}
  • Else, if you need between 2 or more GPU's in EXCLUSIVE mode:
bsub -a gpuexcl{NUM_GPUS}_p -q gpu {COMMAND}

For example, this will use 8 available GPU's in the cluster in EXCLUSIVE mode:

bsub -a gpuexcl8_p -q gpu {COMMAND}

Other resources