CUDA: Difference between revisions

From UMIACS
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[http://en.wikipedia.org/wiki/CUDA CUDA] is a programming architecture developed by NVIDIA to allow General Purpose Computing on GPUs or '''"GPGPU"'''.
[http://en.wikipedia.org/wiki/CUDA CUDA] is a programming architecture developed by NVIDIA to allow General Purpose Computing on GPUs or '''"GPGPU"'''.  It requires a specific card and driver to work correctly,  UMIACS has a number of facilities and labs that have Cuda hardware available.


===CUDA Software on Linux===
==CUDA Software on Linux==
The CUDA infrastructure comes in two parts.
 
===RHEL5===
The RHEL5 CUDA infrastructure comes in two parts.


First is the driver which installs libraries in /usr/lib.
First is the driver which installs libraries in /usr/lib.
Line 13: Line 15:


Older versions of the CUDA toolkit are stored in /usr/local/stow/cudatoolkit_X.Y where X.Y is the version number.  So, CUDA 2.2 is stored in /usr/local/stow/cudatoolkit2.2
Older versions of the CUDA toolkit are stored in /usr/local/stow/cudatoolkit_X.Y where X.Y is the version number.  So, CUDA 2.2 is stored in /usr/local/stow/cudatoolkit2.2
===RHEL6===
In RHEL6 we have relocated non-locally compiled software into /opt/common.  This includes the CUDA toolkit.  You can find all the versions available in '''/opt/common/cuda'''.
<pre>
$ ls /opt/common/cuda
cudatoolkit-3.2.16  cudatoolkit-4.0.17  cudatoolkit-4.1.28
</pre>
We will use version 4.1.28 for this example, you can substitute as needed.  You will need to setup a number of environmental variables to get started.
* bash/sh
** export PATH=/opt/common/cuda/cudatoolkit-4.1.28/bin:${PATH}
** export LD_LIBRARY_PATH=/opt/common/cuda/cudatoolkit-4.1.28/lib64:/opt/common/cuda/cudatoolkit-4.1.28/lib:${LD_LIBRARY_PATH}
* tcsh/csh
** setenv PATH /opt/common/cuda/cudatoolkit-4.1.28/bin:${PATH}
** setenv LD_LIBRARY_PATH /opt/common/cuda/cudatoolkit-4.1.28/lib64:/opt/common/cuda/cudatoolkit-4.1.28/lib:${LD_LIBRARY_PATH}
To get started you might want to build and test with the GPU Computing SDK.  You can do this by running '''/opt/common/cuda/cudatoolkit-4.1.28/gpucomputingsdk_4.1.28_linux.run'''.  It will prompt you to where you want to install the SDK.
Once it is installed please apply this patch from the directory you installed the SDK into.
<pre>
patch -p1 < /opt/common/cuda/cudatoolkit-4.1.28/UMIACS-CUDA-SDK-4.1.28.diff
</pre>
You should now be able to run '''make''' and compile all the examples.

Revision as of 18:09, 26 March 2012

CUDA is a programming architecture developed by NVIDIA to allow General Purpose Computing on GPUs or "GPGPU". It requires a specific card and driver to work correctly, UMIACS has a number of facilities and labs that have Cuda hardware available.

CUDA Software on Linux

RHEL5

The RHEL5 CUDA infrastructure comes in two parts.

First is the driver which installs libraries in /usr/lib.

Second is the CUDA toolkit. The currently supported CUDA toolkit is stored under /usr/local. Please change the "common.mk" settings in your CUDA SDK to set the CUDA root directory to "/usr/local"

You will also need to put the CUDA libraries in your LD_LIBRARY_PATH.

  • If you are using a 64-bit machine this will be /usr/local/lib64.
  • If you are using a 32-bit machine this will be /usr/local/lib.

Older versions of the CUDA toolkit are stored in /usr/local/stow/cudatoolkit_X.Y where X.Y is the version number. So, CUDA 2.2 is stored in /usr/local/stow/cudatoolkit2.2

RHEL6

In RHEL6 we have relocated non-locally compiled software into /opt/common. This includes the CUDA toolkit. You can find all the versions available in /opt/common/cuda.

$ ls /opt/common/cuda
cudatoolkit-3.2.16  cudatoolkit-4.0.17  cudatoolkit-4.1.28

We will use version 4.1.28 for this example, you can substitute as needed. You will need to setup a number of environmental variables to get started.

  • bash/sh
    • export PATH=/opt/common/cuda/cudatoolkit-4.1.28/bin:${PATH}
    • export LD_LIBRARY_PATH=/opt/common/cuda/cudatoolkit-4.1.28/lib64:/opt/common/cuda/cudatoolkit-4.1.28/lib:${LD_LIBRARY_PATH}
  • tcsh/csh
    • setenv PATH /opt/common/cuda/cudatoolkit-4.1.28/bin:${PATH}
    • setenv LD_LIBRARY_PATH /opt/common/cuda/cudatoolkit-4.1.28/lib64:/opt/common/cuda/cudatoolkit-4.1.28/lib:${LD_LIBRARY_PATH}

To get started you might want to build and test with the GPU Computing SDK. You can do this by running /opt/common/cuda/cudatoolkit-4.1.28/gpucomputingsdk_4.1.28_linux.run. It will prompt you to where you want to install the SDK.

Once it is installed please apply this patch from the directory you installed the SDK into.

patch -p1 < /opt/common/cuda/cudatoolkit-4.1.28/UMIACS-CUDA-SDK-4.1.28.diff

You should now be able to run make and compile all the examples.