Installing the CUDA SDK

From GPU

Jump to: navigation, search

1. Download CUDA SDK 1.0 into your home folder:

[yourusername@mrf ~]$ wget http://developer.download.nvidia.com/compute/cuda/1_0/linux/sdk/NVIDIA_CUDA_SDK_1.0.run

2. Set the executable permission for the SDK installer:

[yourusername@mrf ~]$ chmod a+x NVIDIA_CUDA_SDK_1.0.run

3. Run the installer (better choose the default directory name):

[yourusername@mrf ~]$ ./NVIDIA_CUDA_SDK_1.0.run

4. Run the makefile to set up the SDK environment:

[yourusername@mrf ~]$ cd NVIDIA_CUDA_SDK
[yourusername@mrf NVIDIA_CUDA_SDK]$ make

5. Switch to the SDK's projects folder:

[yourusername@mrf ~]$ cd NVIDIA_CUDA_SDK/projects/
[yourusername@mrf projects]$ 

6. (optional) Create your own project folder and work from there:

[yourusername@mrf projects]$ mkdir myProject

If you create your project folder somewhere deeper in the hierarchy you need to adapt the path of common.mk in your makefile if you are using some of the other project makefiles as a template, for example:

[yourusername@mrf projects]$ mkdir myProjects
[yourusername@mrf projects]$ cd myProjects
[yourusername@mrf myProjects]$ mkdir specificProject
[yourusername@mrf myProjects]$ cd ..
[yourusername@mrf projects]$

[yourusername@mrf projects]$ cp matrixMul/Makefile myProjects/specificProject/Makefile
[yourusername@mrf projects]$ emacs myProjects/specificProject/Makefile 

Under "#Rules and target" change:

include ../../common/common.mk

to

include ../../../common/common.mk

OR

6. (optional) Check out George's example projects from the last meetings and test them:

[yourusername@mrf projects]$ svn checkout svn://spare.cscamm.umd.edu/GPU<optional: /subfolder> .

Note that George has modified one of Nvidia's examples (matrixMul), you need to rename the original example project first if you want to check out George's version from the SVN repository, otherwise SVN will complain about an already existing folder name. For example:

[yourusername@mrf projects]$ mv matrixMul matrixMulOrig
[yourusername@mrf projects]$ mkdir matrixMul
[yourusername@mrf projects]$ cd matrixMul
[yourusername@mrf matrixMul]$ svn checkout svn://spare.cscamm.umd.edu/GPU/matrixMul .

7. PROTIP: As compiled files land in "../../bin/linux/release/<executablename>" it is wise to create a symbolic link to that file in your individual project folder, for example:

[yourusername@mrf matrixMul]$ ln -s ../../bin/linux/release/matrixMul ./matrixMul

You can then run the file; we kindly ask instrumented users to run the file by invoking the instrumentation's "run" command in front:

[yourusername@mrf matrixMul]$ run ./matrixMul
Personal tools