| 12 | * '''NVIDIA Cuda''' (BOINC-NVCuda sample app for Linux can be found at "/boinc/samples/nvcuda/") |
| 13 | {{{ |
| 14 | Makefile; common.mk; cuda_kernel.cu; cuda.cu; cuda_config.h; readme.txt |
| 15 | }}} |
| 16 | |
| 17 | Before running Makefile, you will need to install gcc 4.3 and g++ 4.3. This is because the NVIDIA Cuda SDK 3.0 has not yet worked with gcc 4.0 and g++ 4.0. There should be no issue compiling cuda files with gcc 4.3 and g++ 4.3 on newer NVIDIA Cuda SDK versions. For a successful compilation, please follow these steps: |
| 18 | {{{ |
| 19 | 1) Install gcc-4.3 and g++-4.3: |
| 20 | $ sudo aptitude install gcc-4.3 g++-4.3 |
| 21 | |
| 22 | 2) Go to SDK source directory: |
| 23 | $ cd ~/NVIDIA_GPU_Computing_SDK/C |
| 24 | |
| 25 | 3) Create a directory and create symlinks to gcc-4.3/g++-4.3 |
| 26 | $ mkdir mygcc |
| 27 | $ cd mygcc |
| 28 | $ ln -s $(which g++-4.3) g++ |
| 29 | $ ln -s $(which gcc-4.3) gcc |
| 30 | }}} |
| 31 | The Makefile for Linux is made with the assumption that the NVIDIA Cuda SDK is installed at the default location "$(ROOT)/home/USER_NAME/NVIDIA_GPU_Computing_SDK/". On my Linux machine, for example, it would be "$(ROOT)/home/tuanle/NVIDIA_GPU_Computing_SDK/". Since the absolute path is used in Makefile, you will probably need to edit file "common.mk" before compiling the sample app. Do so by looking for "/home/tuanle/NVIDIA_GPU_Computing_SDK" in file "common.mk" and replace this path with an appropriate path on your machine. |
| 32 | |
| 33 | What if your machine doesn't have an NVIDIA Cuda-enabled GPU? Then, you can compile and run your app in emulation mode. As far as we know, NVIDIA Cuda SDK 3.1 no longer supports emulation mode. Thus, you will need to install an older Cuda SDK version, like version 3.0, on your machine. To make an executable file in emulation mode, simply type "make emu=1". |
| 34 | |
| 35 | Also, note that you will need to define some environment variables before running the executable file. |
| 36 | {{{ |
| 37 | export PATH=/usr/local/cuda/bin:$PATH |
| 38 | export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH |
| 39 | }}} |
| 40 | |
| 41 | * '''NVIDIA OpenCL''' (BOINC-NVOpenCL sample app for Linux can be found at "/boin/samples/nvopencl/") |
| 42 | {{{ |
| 43 | Makefile; common_opencl; nvopencl.h; nvopencl.cpp; nvopencl_kernels; readme.txt |
| 44 | }}} |