Pages

Showing posts with label AMDAPP. Show all posts
Showing posts with label AMDAPP. Show all posts

Tuesday, June 21, 2011

Install OpenCL and PyOpenCL in Ubuntu 10.04 LTS Lucid Lynx 64 bit

After playing with Scientific Linux 6 with OpenCL and PyOpenCL, I decided to bring it into my primary OS, and yes it is Ubuntu 10.04 LTS Lucid Lynx 64 bit.

Searching through the net, I found two ways to install OpenCL

Because my previous experience in SL6 is worked, so i liked to doing so within my ubuntu.

Things that needed by my system for OpenCL(testing that it works by executing 'make all' in your $AMDAPPSDKROOT -> i put it on "/home/user/AMD-APP-SDK-v2.4-lnx64/", this will built samples application that included in samples folder)
  • read the guide AMD_APP_SDK_Installation_Notes.pdf (it just extract and put a conf in /etc dir)
  • install libglu1-mesa-dev (in my case the package(header files) that missing is only this, so might be different on your system!), this needed when build a OpenCL samples
  • also add a AMDAPPSDK in your $PATH in .bashrc file like this
Below are some screenshoot to test sample applications under AMD-APP-SDK-v2.4-lnx64/samples/opencl/bin/x86_64/ directory if the installation of AMDAPPSDK and is working:
test using HelloCL
test using GlobalMemoryBandwidth




and notice if running an OpenCL program using all processor thread(because i didn't have a GPU capable for OpenCL

And now for PyOpenCL(made by Andreas Klöckner at http://mathema.tician.de/software/pyopencl )
To install correctly please enable the internet connectivity its needed to install required python dependency module.

In my system is need to install libboost1.40-all-dev, python-numpy and python-libxslt. (Both are available from ubuntu repository). Using command from terminal -> sudo apt-get install libboost1.40-all-dev python-numpy python-libxslt

Installing PyOpenCl:
  • download PyOpenCL from PyOpenCL
  • Notice when execute configure.py : python configure.py   --cl-inc-dir=$AMDAPPSDKROOT/include   --cl-lib-dir=$AMDAPPSDKROOT/lib/x86_64   --cl-libname=OpenCL
  • then -> python setup.py build
  • finnally -> sudo python setup.py install
test PyOpenCL using examples benchmark-all.py

BTW  I'm just noticed that python in ubuntu is faster than in Scientific Linux 6, and it same 64 bit, same laptop.

    Tuesday, April 19, 2011

    Install OpenCL and PyOpenCL in Scientific Linux 6 (RHEL 6, CEntOS 6)

    My rig is 64 bit system with RedHat 6 based OS, but my fera not supported for OpenCL using VGA(3200), so it using SSE2 from L310 processor  :(

    Note that my Scientific Linux 6 installed from a 64 bit LiveDVD version, so might be a different step if using LiveCD.

    Installing AMD APP:
    Test using a sample
    $ ./HelloCL
    HelloCL!
    Getting Platform Information
    Creating a context AMD platform
    Getting device info
    Loading and compiling CL source
    Running CL program
    Done
    Passed!

    Installing PyOpenCl:
    • download PyOpenCL from PyOpenCL
    • make sure C++ compiler(g++), python, numpy, C++ boost library are installed
    • Tricky when execute configure.py: python configure.py   --cl-inc-dir=$HOME/AMD-APP-SDK-v2.4-lnx64/include   --cl-lib-dir=$HOME/AMD-APP-SDK-v2.4-lnx64/lib/x86_64   --cl-libname=OpenCL
    • then just make -> su -c "make install"

    Result Test Running examples benchmark-all.py
    $ ./benchmark-all.py
    ('Execution time of test without OpenCL: ', 34.952448844909668, 's')
    =============================================
    ('Platform name:', 'AMD Accelerated Parallel Processing')
    ('Platform profile:', 'FULL_PROFILE')
    ('Platform vendor:', 'Advanced Micro Devices, Inc.')
    ('Platform version:', 'OpenCL 1.1 AMD-APP-SDK-v2.4 (595.10)')
    ---------------------------------------------------------------
    ('Device name:', 'AMD Athlon(tm) X2 Dual Core Processor L310')
    ('Device type:', 'CPU')
    ('Device memory: ', 3706, 'MB')
    ('Device max clock speed:', 1200, 'MHz')
    ('Device compute units:', 2)
    Execution time of test: 0.00733989 s
    Results OK