2013년 5월 18일 토요일

opencl sample makefile


Here is the skeleton of my Makefiles for opencl
It almost same as normal unix application Makefile
Add just opencl libs and opencl include directory
It is based on AMD Streaming SDK



Here is the result... I used helloworld sample of opencl programming guide

















 

2013년 5월 11일 토요일

opencl programming guide sample cmake error


env:

ubuntu 10.04
AMD Straming SDK 2.6

CMake shows below error ,
because AMD Straming ASK OpenCl header directory is changed
...
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE):
  Could NOT find OpenCL (missing: OPENCL_INCLUDE_DIRS)
...

Open

opencl-book-samples-read-only/cmake/FindOpenCL.cmake

add AMD straming SDK opencl include path as llike below

FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include" "/opt/AMDAPP/include/")
            FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include" "/opt/AMDAPP/include/")

then cmake

$ cmake ../opencl-book-samples-read-only -G "Eclipse CDT4 - Unix Makefiles"
-- Found OpenCL: /usr/lib/libOpenCL.so
-- Boost version: 1.40.0
-- Found the following Boost libraries:
--   program_options
-- Configuring done
-- Generating done
-- Build files have been written to: /home2/dokyun/dkworks/opencl/build

it is completed

move to chapters 2 sample directory and build , you can find out HelloWorld

$ ls
CMakeFiles  HelloWorld.cl  Makefile  cmake_install.cmake
$ make
Scanning dependencies of target HelloWorld
[100%] Building CXX object src/Chapter_2/HelloWorld/CMakeFiles/HelloWorld.dir/HelloWorld.cpp.o
Linking CXX executable HelloWorld
[100%] Built target HelloWorld
$ ls
CMakeFiles  HelloWorld  HelloWorld.cl  Makefile  cmake_install.cmake


env

windows 7
Nvidia CUDA 5.0


use cmake-gui





























set source code directory and build binary directory , then configure and generate



2013년 5월 10일 금요일

Installing CUDA toolkit


env

OS : window 7
CUDA version : V5.0
Graphic Card : Geforce 9500 GT

- Cuda toolkit download
https://developer.nvidia.com/cuda-downloads

- Cuda sample download
http://docs.nvidia.com/cuda/cuda-samples/index.html

- Supported GPU list
https://developer.nvidia.com/cuda-gpus

Install only CUDA toolkit, it contains everything you need as you can see

























For verifing installation, open a sample and run

For example, in window7, go to
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\1_Utilities\deviceQueryDrv
then open Visual Studio project , build and run





































I used Visual Studio Express 10

You can download here.

http://www.microsoft.com/visualstudio/kor#downloads

Raspberry Pi - cat surveillance system


Install web cam server

http://pingbin.com/2012/12/raspberry-pi-web-cam-server-motion/

I used Logitech C170







 



2013년 5월 3일 금요일

Install opencl with AMD streaming SDK


Installed env:

OS : unbuntu 10.04 , 64bits
Graphic Card : AMD Radeaon HD 4870
AMD Straming SDK 2.6

- AMD driver download

http://support.amd.com/us/gpudownload/linux/legacy/Pages/legacy-radeon_linux.aspx
http://support.amd.com/us/gpudownload/linux/previous/Pages/radeon_linux.aspx

- stream SDK download
http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/

1. Check your Graphic card supports opencl or not
You can check here
http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/system-requirements-driver-compatibility/

if the graphic card is not supported , download lower version and check

AMD-APP-SDK-<version>-RC-lnx64\docsAMD_APP_SDK_Getting_Started_Guide_<version>.pdf

2. install driver and opencl SDK
 unzip SDK package then run Install-AMD-APP.sh with root log-in

3. go to <install_dir>/AMD-APP-SDK-v2.x-RC3-lnx64/samples/opencl then make

 if you do not install openGL you get build error with below message

/opt/AMDAPP/include/GL/glew.h:1138:20: error: GL/glu.h: No such file or directory

in this case install openGL

$ sudo apt-get install freeglut3-dev

then make again, build will be succeeded