Difference between revisions of "GPU"

From Dynamo
Jump to navigation Jump to search
Line 1: Line 1:
 
[[Category:installation]]
 
[[Category:installation]]
GPU stands for "Graphic Processing Unit"
+
GPU stands for "Graphic Processing Unit".
 +
If you have access to a dedicated GPU device, the iteration procedure will run much faster.  While ''Dynamo'' can run its  GPU functionalities in most Nvidia cards, a real advantage will be measured for those cards that are conceived for scientific computation. The Tesla series and the Titan series are examples of this.
  
  
Line 51: Line 52:
 
Go to the ''Computing environment'' GUI.
 
Go to the ''Computing environment'' GUI.
 
Select 'matlab gpu' or 'system gpu'  
 
Select 'matlab gpu' or 'system gpu'  
Set the {{t|gpu identifier set}} field to the device numbers given to your GPUs by the operative system. You can select a subset of the available GPUs.
+
Set the {{t|gpu identifier set}} field to the device numbers given to your GPUs by the operative system. You can select a subset of the available GPUs. If you have a GPU that controls the screen display, you can technically use it for GPU computations, but it is not advisable, as it will be typically much slower than GPUs intended for computation.
  
 
=== With the command line ===
 
=== With the command line ===
 
There are two project parameters related the the GPU: the {{t|destination}} parameter and the {{t|gpu_identifier_set}} parameter.
 
There are two project parameters related the the GPU: the {{t|destination}} parameter and the {{t|gpu_identifier_set}} parameter.
 +
The {{t|destination}} must be set to {{t|matlab_gpu}} (to run projects inside Matlab) or to {{t|system_gpu}}
 +
 +
== Checking your system ==
 +
 +
In a linux machine {{t|nvidia-smi}} will give you a status summary of the installed, reachable GPUs. In the example image, you would use an {{t|identifier_set}} of 1,2 to. Alternatively, you could run different projects on device 1 and 2. In any case, device 0 is not intended for GPU computing.
  
The {{t|destination}} must be set to {{t|matlab_gpu}} (to run projects inside Matlab) or to {{t|system_gpu}}
+
[[File:Nvidia-smi example.png|thumb|right|300px| A screenshot on <tt>nvidia-smi</tt> showing three devices]]

Revision as of 11:48, 22 April 2016

GPU stands for "Graphic Processing Unit". If you have access to a dedicated GPU device, the iteration procedure will run much faster. While Dynamo can run its GPU functionalities in most Nvidia cards, a real advantage will be measured for those cards that are conceived for scientific computation. The Tesla series and the Titan series are examples of this.


Installation

A regular distribution of Dynamo will include GPU precompiled GPU executables. As they need to be linked to libraries that might not be present in your system, it is advised that you recompile them: After untarring the tar package in location DYNAMO_ROOT, go to cd DYNAMO_ROOT and make certain that you have CUDA active in your shell, for instance look for the NVIDIA nvcc compiler. which nvcc If this is succcessful run source config.sh This will automatically edit the makefile file in the folder, informing it on the location of CUDA in your system. Then you can just type make clean to delete the executables in the distribution, and then make all to recompile the executables in your system.

CUDA libraries

You need to have CUDA installed on your system. This might require coordinating with your system administrator.


Versions

Dynamo has been tested with most CUDA versions. CUDA 7.0 was found to show problems in the Fourier transform libraries: don't use it. We advice to use the highest available CUDA libraries, at least CUDA 7.5 per 18/04/2016.

Testing your system

In the Linux shell type: nvidia-smi to get a list of the GPU devices that your system is seeing, their status and the jobs currently running. This order also shows the device number assigned by the system to each device, which you need to enter in a Dynamo project through the parameter gpu_identifier_set

Speed up

This iis of course highly dependent on the system: which GPUs you are comparing against which CPU cores.

It also depends on the particle size and on the number of angles scanned per particle (higher number will yield higher speed up factors, i.e., the more intensive a computation, the more favorable for GPU)

Using the GPU in an alignment project

Your execution environment should include a LD_LIBRARY_PATH environment variable that includes the location of the CUDA libraries. You probably need to inform your UNIX shell with the command:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda75/lib

(replace with the location of the CUDA libraries in your system). Also if you are going to work under Matlab you should update your LD_LIBRARY_PATH variable in the Linux shell before starting Matlab.

With the dcp GUI

Go to the Computing environment GUI. Select 'matlab gpu' or 'system gpu' Set the gpu identifier set field to the device numbers given to your GPUs by the operative system. You can select a subset of the available GPUs. If you have a GPU that controls the screen display, you can technically use it for GPU computations, but it is not advisable, as it will be typically much slower than GPUs intended for computation.

With the command line

There are two project parameters related the the GPU: the destination parameter and the gpu_identifier_set parameter. The destination must be set to matlab_gpu (to run projects inside Matlab) or to system_gpu

Checking your system

In a linux machine nvidia-smi will give you a status summary of the installed, reachable GPUs. In the example image, you would use an identifier_set of 1,2 to. Alternatively, you could run different projects on device 1 and 2. In any case, device 0 is not intended for GPU computing.

A screenshot on nvidia-smi showing three devices