A quick start on CUDA: Difference between revisions

From Cpre584
Jump to navigation Jump to search
Marinama (talk | contribs)
New page: All machines in coover 2050 are installed with CUDA. Before you run a simple program, you need to: 1) Setting environment variables export PATH=/usr/local/cuda/bin:$PATH export LD_LIB...
 
Marinama (talk | contribs)
No edit summary
Line 2: Line 2:


Before you run a simple program, you need to:
Before you run a simple program, you need to:
1) Setting environment variables
1) Setting environment variables
   export PATH=/usr/local/cuda/bin:$PATH
   export PATH=/usr/local/cuda/bin:$PATH
   export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
   export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
2) go to the directory of your sample code.
2) go to the directory of your sample code.
   For example:
   For example:
   cd /home/username/cuda
   cd /home/username/cuda
3) nvcc hello_world.cu
3) nvcc hello_world.cu
4) You will see the output: a.out
4) You will see the output: a.out
5) ./a.out
5) ./a.out
   It will print the result.
   It will print the result.

Revision as of 23:15, 3 March 2012

All machines in coover 2050 are installed with CUDA.

Before you run a simple program, you need to:

1) Setting environment variables

 export PATH=/usr/local/cuda/bin:$PATH
 export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

2) go to the directory of your sample code.

 For example:
 cd /home/username/cuda

3) nvcc hello_world.cu

4) You will see the output: a.out

5) ./a.out

 It will print the result.