A quick start on CUDA: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
Before you run a simple program, you need to: | Before you run a simple program, you need to: | ||
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 | ||
1) go to the directory of your sample code. | |||
cd /home/username/cuda | cd /home/username/cuda | ||
2) nvcc hello_world.cu | |||
3) This will generate an executable file: a.out | |||
5) ./a.out | 5) ./a.out | ||
The cuda sample code can be downloaded from:[http://developer.nvidia.com/cuda-example-introduction-general-purpose-gpu-programming CUDA by example] |
Revision as of 23:26, 3 March 2012
All machines in coover 2050 are installed with CUDA.
Before you run a simple program, you need to:
Setting environment variables export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
1) go to the directory of your sample code.
cd /home/username/cuda
2) nvcc hello_world.cu
3) This will generate an executable file: a.out
5) ./a.out
The cuda sample code can be downloaded from:CUDA by example