Changes between Version 7 and Version 8 of GPUApp


Ignore:
Timestamp:
Jul 2, 2010, 5:14:35 PM (14 years ago)
Author:
Nicolas
Comment:

Formatting: use 3rd level headings instead of bullet list, remove indentation from all paragraphs.

Legend:

Unmodified
Added
Removed
Modified
  • GPUApp

    v7 v8  
    66
    77== Windows == #windows
    8  * '''NVIDIA Cuda''' (BOINC-NVCuda sample app for Windows can be found at "/boinc/samples/nvcuda/")
     8
     9=== NVIDIA Cuda ===
     10
     11BOINC-NVCuda sample app for Windows can be found at "/boinc/samples/nvcuda/".
     12
    913{{{
    1014cuda_kernel.cu; cuda.cu; cuda_config.h
    1115}}}
    12  The example_app_nvcuda.vcproj can be found at "boin/win_build/". Note that NVIDIA Cuda SDK 3.0 or older supports device emulation mode. If your machine doesn't have a Cuda-enabled GPU, then you should build the sample app in the device emulation mode. Do so by setting "Build -> Configuration Manger -> Configuration" to either Emudebug|Emurelease. It comes to our attention that while compiling the sample app, the linker tries to link both the debug and release libraries, and thus causing the following errors:
     16The example_app_nvcuda.vcproj can be found at "boin/win_build/". Note that NVIDIA Cuda SDK 3.0 or older supports device emulation mode. If your machine doesn't have a Cuda-enabled GPU, then you should build the sample app in the device emulation mode. Do so by setting "Build -> Configuration Manger -> Configuration" to either Emudebug|Emurelease. It comes to our attention that while compiling the sample app, the linker tries to link both the debug and release libraries, and thus causing the following errors:
    1317{{{
    1418LIBCMTD.lib(dbgheap.obj) : error LNK2005: __heap_alloc already defined in LIBCMT.lib(malloc.obj)
     
    1721...
    1822}}}
    19  One solution to this problem is to set the Hyprid Cuda/C++ Runtime Library point to "Multi-Threaded Debug (/MTd)". Do so by right click on the project. Set "Properties -> Configuration Properties -> Cuda Build Rule v3.0.14 -> Hybrid CUDA/C++ Options -> Runtime Library" to "Multi-Threaded Debug (/MTd)".
     23One solution to this problem is to set the Hyprid Cuda/C++ Runtime Library point to "Multi-Threaded Debug (/MTd)". Do so by right click on the project. Set "Properties -> Configuration Properties -> Cuda Build Rule v3.0.14 -> Hybrid CUDA/C++ Options -> Runtime Library" to "Multi-Threaded Debug (/MTd)".
    2024
    21  The executable file can be found at "boinc/win_build/Build/Win32/build_mode/" (build_mode could be release, debug, emurelease or emudebug).
     25The executable file can be found at "boinc/win_build/Build/Win32/build_mode/" (build_mode could be release, debug, emurelease or emudebug).
    2226
    23  * '''NVIDIA OpenCL''' (BOINC-NVOpenCL sample app for Windows can be found at "/boin/samples/nvopencl/")
     27=== NVIDIA OpenCL ===
     28
     29BOINC-NVOpenCL sample app for Windows can be found at "/boin/samples/nvopencl/".
     30
    2431{{{
    2532nvopencl.hpp; nvopencl.cpp; nvopencl_kernels.cl
    2633}}}
    27  The example_app_nvopencl.vcproj can be found at "boin/win_build/". OpenCL doesn't have emulation mode, but it could run on CPU alone by specifying CL_DEVICE_TYPE_CPU or CL_DEVICE_TYPE_ALL when creating an OpenCL context.
     34The example_app_nvopencl.vcproj can be found at "boin/win_build/". OpenCL doesn't have emulation mode, but it could run on CPU alone by specifying CL_DEVICE_TYPE_CPU or CL_DEVICE_TYPE_ALL when creating an OpenCL context.
    2835 
    29  The Runtime Library needs to be reset to point to "Multi-threaded Debug (/MTd)" to avoid linking issues. Do so by right click on the project. Set "Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library" to "Multi-threaded Debug (/MTd)".
     36The Runtime Library needs to be reset to point to "Multi-threaded Debug (/MTd)" to avoid linking issues. Do so by right click on the project. Set "Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library" to "Multi-threaded Debug (/MTd)".
    3037
    31  * '''ATI Stream OpenCL''' (BOINC-ATIOpenCL sample app for Windows can be found at "/boin/samples/atiopencl/")
     38=== ATI Stream OpenCL ===
     39
     40BOINC-ATIOpenCL sample app for Windows can be found at "/boin/samples/atiopencl/".
     41
    3242{{{
    3343atiopencl.hpp; atiopencl.cpp; atiopencl_kernels.cl
    3444}}}
    35   The example_app_atiopencl.vcproj can be found at "boin/win_build/". It is identical to NVIDIA OpenCL. Prior to build the app, make sure you have already reset the Runtime Library to point to "Multi-threaded Debug (/MTd)".
     45The example_app_atiopencl.vcproj can be found at "boin/win_build/". It is identical to NVIDIA OpenCL. Prior to build the app, make sure you have already reset the Runtime Library to point to "Multi-threaded Debug (/MTd)".
    3646
    3747== Linux == #linux
    3848
    39  * '''NVIDIA Cuda''' (BOINC-NVCuda sample app for Linux can be found at "/boinc/samples/nvcuda/")
     49=== NVIDIA Cuda ===
     50BOINC-NVCuda sample app for Linux can be found at "/boinc/samples/nvcuda/".
     51
    4052{{{
    4153Makefile; common.mk; cuda_kernel.cu; cuda.cu; cuda_config.h; readme.txt
    4254}}}
    4355 
    44  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:
     56Before 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:
     57
    4558{{{
    46591) Install gcc-4.3 and g++-4.3:
     
    5669   $ ln -s $(which gcc-4.3) gcc
    5770}}}
    58  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.
    5971
    60  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".
     72The 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.
    6173
    62  Also, note that you will need to define some environment variables before running the executable file.
     74What 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".
     75
     76Also, note that you will need to define some environment variables before running the executable file.
    6377{{{
    6478export PATH=/usr/local/cuda/bin:$PATH
     
    6680}}}
    6781
    68  * '''NVIDIA OpenCL''' (BOINC-NVOpenCL sample app for Linux can be found at "/boin/samples/nvopencl/")
     82=== NVIDIA OpenCL ===
     83
     84BOINC-NVOpenCL sample app for Linux can be found at "/boin/samples/nvopencl/".
     85
    6986{{{
    7087Makefile; common_opencl; nvopencl.h; nvopencl.cpp; nvopencl_kernels; readme.txt
    7188}}}
    72  It appears that NVIDIA OpenCL SDK is missing shared library file libOpenCL.so which is needed at compile time. This library file comes with the kernel driver package which can be installed only when your machine has an NVIDIA Cuda-enabled GPU. Thus, any attempt to compile OpenCL sample codes on a non-cuda-enabled GPU machine might result in the following error:
     89It appears that NVIDIA OpenCL SDK is missing shared library file libOpenCL.so which is needed at compile time. This library file comes with the kernel driver package which can be installed only when your machine has an NVIDIA Cuda-enabled GPU. Thus, any attempt to compile OpenCL sample codes on a non-cuda-enabled GPU machine might result in the following error:
    7390{{{
    7491/usr/bin/ld: cannot find -lOpenCL
    7592}}}
    76  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.
     93The 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.
    7794
    78  * '''ATI Stream OpenCL''' (BOINC-ATIOpenCL sample app for Linux can be found at "/boin/samples/atiopencl/")
     95=== ATI Stream OpenCL ===
     96
     97BOINC-ATIOpenCL sample app for Linux can be found at "/boin/samples/atiopencl/".
     98
    7999{{{
    80100Makefile; atiopencl.h; atiopencl.cpp; atiopencl_kernels; readme.txt
    81101}}}
    82  The Makefile for Linux is made with the assumption that the ATI Stream OpenCL SDK version 2.1 for 32-bit Linux and Boinc are installed in the same parent directory, i.e. "ati-stream-sdk-v.2.1-lnx32" directory and "boinc" directory are both installed at "$(ROOT)/home/" directory. If you are using the SDK v2.1 for 64-bit Linux, or if Boinc and the OpenCL SDK are not installed in the same parent directory, then Makefile needs to be edited prior to any compilation. Do so by looking for
     102The Makefile for Linux is made with the assumption that the ATI Stream OpenCL SDK version 2.1 for 32-bit Linux and Boinc are installed in the same parent directory, i.e. "ati-stream-sdk-v.2.1-lnx32" directory and "boinc" directory are both installed at "$(ROOT)/home/" directory. If you are using the SDK v2.1 for 64-bit Linux, or if Boinc and the OpenCL SDK are not installed in the same parent directory, then Makefile needs to be edited prior to any compilation. Do so by looking for
    83103{{{
    84104
     
    95115 in file "Makefile" and replace these paths with appropriate paths on your machine.
    96116
    97  Most problems related to running the ATI Stream OpenCL executable files can be found in ATI_Stream_SDK_Installation_Notes.pdf section 2.2. Here are the two most common run-time errors:
     117Most problems related to running the ATI Stream OpenCL executable files can be found in ATI_Stream_SDK_Installation_Notes.pdf section 2.2. Here are the two most common run-time errors:
    98118
    99119        1) ./atiopencl: error while loading shared libraries: libOpenCL.so: cannot open shared object file: No such file or directory -> Solution:
     
    126146== Mac OS X == #mac
    127147
    128  * '''NVIDIA Cuda''' (BOINC-Cuda sample app for Mac OS X can be found at "/boinc/samples/nvcuda/")
     148=== NVIDIA Cuda ===
     149
     150BOINC-Cuda sample app for Mac OS X can be found at "/boinc/samples/nvcuda/"
     151
    129152{{{
    130153Makefile_mac; common_mac.mk; cuda_kernel_mac.cu; cuda_mac.c; cuda_config.h; readme_mac.txt
    131154}}}
    132155
    133  Unlike Windows and Linux, the 'nvcc' cuda compiler for Mac has some trouble compiling .cu files that
    134  contain both BOINC and Cuda codes. Any attempt to compile such .cu files might result in errors like
    135  these:
     156Unlike Windows and Linux, the 'nvcc' cuda compiler for Mac has some trouble compiling .cu files that
     157contain both BOINC and Cuda codes. Any attempt to compile such .cu files might result in errors like
     158these:
    136159{{{
    137160/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/mmintrin.h(55): error: identifier "__builtin_ia32_emms" is undefined
     
    140163...
    141164}}}
    142  The solution that we came up with is to compile BOINC and Cuda seperately, meaning that compile .c files that have BOINC codes with
    143  gcc and compile .u files that have Cuda codes such as kernel definitions with nvcc (This can simply be done by putting .cu and .c
    144  file names at corresponding "CUFILES := " and "CCFILES := " entries in Makefile_mac). To handle the results computed by the kernels,
    145  you will need to write external functions. The function definitions that make kernel calls will be put in .cu file while the function headers with "extern" prefix are put in .c file and can be called in main function or elsewhere.
     165The solution that we came up with is to compile BOINC and Cuda seperately, meaning that compile .c files that have BOINC codes with
     166gcc and compile .u files that have Cuda codes such as kernel definitions with nvcc (This can simply be done by putting .cu and .c
     167file names at corresponding "CUFILES := " and "CCFILES := " entries in Makefile_mac). To handle the results computed by the kernels,
     168you will need to write external functions. The function definitions that make kernel calls will be put in .cu file while the function headers with "extern" prefix are put in .c file and can be called in main function or elsewhere.
    146169
    147  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 -f Makefile_mac emu=1".
     170What 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 -f Makefile_mac emu=1".
    148171
    149  Also, note that you will need to define some environment variables before running the executable file.
     172Also, note that you will need to define some environment variables before running the executable file.
    150173{{{
    151174export PATH=/usr/local/cuda/bin:$PATH
     
    153176}}}
    154177
    155  One last thing to mention, the makefile for Mac is made with the assumption that the NVIDIA Cuda SDK is installed at the default location: "$ROOT/Developer/GPU Computing/" on Mac. If it is installed at a different location on your machine, then you will need to edit file "common_mac.mk". Do so by looking for "ROOTDIR  ?= /Developer/GPU\ Computing" in file "common_mac.mk" and replace this path with an appropriate path on your machine.
     178One last thing to mention, the makefile for Mac is made with the assumption that the NVIDIA Cuda SDK is installed at the default location: "$ROOT/Developer/GPU Computing/" on Mac. If it is installed at a different location on your machine, then you will need to edit file "common_mac.mk". Do so by looking for "ROOTDIR  ?= /Developer/GPU\ Computing" in file "common_mac.mk" and replace this path with an appropriate path on your machine.