Difference between revisions of "GPU Guide"

From Storrs HPC Wiki
Jump to: navigation, search
Line 1: Line 1:
==Very basic GPU Guide==
+
The following assumes you are already [[HPC Getting Started | connected to the cluster]].
 
 
 
===Basic CUDA compilation===
 
===Basic CUDA compilation===
 
First you need to load the CUDA module:
 
First you need to load the CUDA module:
Line 17: Line 16:
 
  bsub -a gpushared -q gpu {COMMAND}
 
  bsub -a gpushared -q gpu {COMMAND}
  
* If you need to use between 1 and 8 GPU's in EXCLUSIVE mode:
+
* 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}
 
  bsub -a gpuexcl{NUM_GPUS}_p -q gpu {COMMAND}
For example, use the following command to use 1 available GPU in the cluster in EXCLUSIVE mode:
+
For example, this will use 8 available GPU's in the cluster in EXCLUSIVE mode:  
bsub -a gpuexcl_p -q gpu {COMMAND}
 
and the following command to use 8 available GPU's in the cluster in EXCLUSIVE mode:  
 
 
  bsub -a gpuexcl8_p -q gpu {COMMAND}
 
  bsub -a gpuexcl8_p -q gpu {COMMAND}
  

Revision as of 16:23, 20 June 2012

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 {MYFILE.cu} -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