Getting Started with Intel® SDK for OpenCL™ Applications (Linux SRB4.1)

Published: 06/30/2017  

Last Updated: 12/29/2016

By Jeffrey McAllister

This article is a step by step guide to quickly get started developing applications using Intel®  SDK for OpenCL™ Applications in Linux for SRB4.1.  This is now a legacy release.  For instructions to install the latest release please see https://software.intel.com/articles/sdk-for-opencl-gsg.

  1. Install the driver
  2. Install the SDK
  3. Set up Eclipse

 

Step 1: Install the driver

To run applications using OpenCL kernels on the Intel Processor Graphics GPU device with the latest features for the newest processors, you will need a driver package from here: /content/www/us/en/develop/articles/opencl-drivers.html.

(If your target processor does not include Intel Processor Graphics, install the latest runtime package instead.)

This script covers the steps needed to install the SRB4 driver package on Ubuntu 14.04.

To use

$ tar -xvf install_OCL_driver_ubuntu.tgz
$ sudo su
$ ./install_OCL_driver_ubuntu.sh

 

This script automates downloading prerequisites, installing the user-mode components, patching the 4.7 kernel, and building it. 

 

You can check your progress with the System Analyzer Utility.  If successful, you should see smoke test results looking like this at the bottom of the the system analyzer output:

--------------------------
Component Smoke Tests:
--------------------------
 [ OK ] OpenCL check:platform:Intel(R) OpenCL GPU OK CPU OK

 

 

Step 2: Install the SDK

This script will set up all prerequisites for successful SDK install for Ubuntu.  After this, run the SDK installer.

Here is a kernel to test the SDK install:

__kernel void simpleAdd( 
                       __global int *pA,                       
                       __global int *pB,                       
                       __global int *pC)                       
{                                                               
    const int id = get_global_id(0);                                  
    pC[id] = pA[id] + pB[id];                                  
}                               

Check that the command line compiler ioc64 is installed with

$ ioc64 -input=simpleAdd.cl -asm

(expected output)
No command specified, using 'build' as default
OpenCL Intel(R) Graphics device was found!
Device name: Intel(R) HD Graphics
Device version: OpenCL 2.0 
Device vendor: Intel(R) Corporation
Device profile: FULL_PROFILE
fcl build 1 succeeded.
bcl build succeeded.

simpleAdd info:
	Maximum work-group size: 256
	Compiler work-group size: (0, 0, 0)
	Local memory size: 0
	Preferred multiple of work-group size: 32
	Minimum amount of private memory: 0

Build succeeded!

 

Step 3: Set up Eclipse

Intel SDK for OpenCL applications works with Eclipse Mars and Neon.

After installing, copy the CodeBuilder*.jar file from the SDK eclipse-plug-in folder to the Eclipse dropins folder.

$ cd eclipse/dropins
$ find /opt/intel -name 'CodeBuilder*.jar' -exec cp {} . \;

Start Eclipse.  Code-Builder options should be available in the main menu.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.