Getting Started in Linux with Intel® SDK for OpenCL™ Applications

This article is a step by step guide to quickly get started developing using Intel®  SDK for OpenCL™ Applications with the Linux SRB5 driver package.  The OpenCL driver is a prerequisite for using the GPU capabilities of Intel® Computer Vision SDK or Intel® Deep Learning Deployment Toolkit.

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

For SRB4.1 instructions, please see https://software.intel.com/en-us/articles/sdk-for-opencl-gsg-srb41.

Step 1: Install the driver

 

This script covers the steps needed to install the SRB5 driver package in Ubuntu 14.04, Ubuntu 16.04, CentOS 7.2, and CentOS 7.3.

 

To use

$ mv install_OCL_driver.sh_.txt install_OCL_driver.sh
$ chmod 755 install_OCL_driver.sh
$ sudo su
$ ./install_OCL_driver.sh install

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

Experimental: this version of the script has an option to skip the kernel patch/rebuild step. For newer kernels, such as the 4.8 default kernel for Ubuntu 16.04, nearly all of OpenCL passes basic smoke tests. 

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

 

Experimental installation without kernel patch or rebuild:

If using Ubuntu 16.04 with the default 4.8 kernel you may be able to skip the kernel patch and rebuild steps.  This configuration works fairly well but several features (i.e. OpenCL 2.x device-side enqueue and shared virtual memory, VTune GPU support) require patches.  Install without patches has been "smoke test" validated to check that it is viable to suggest for experimental use only, but it is not fully supported or certified.   

 

Step 2: Install the SDK

This script will set up all prerequisites for successful SDK install for Ubuntu. 

$ mv install_SDK_prereq_ubuntu.sh_.txt install_SDK_prereq_ubuntu.sh
$ sudo su
$ ./install_SDK_prereq_ubuntu.sh

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.

For more complete information about compiler optimizations, see our Optimization Notice.

6 comments

Top
li, dandan's picture

I'm trying to run this on Debian Testing but when running "./install.sh install" I get this error:

 

Intel Graphics Driver Installer for OpenCL on CentOS

Running on Generic distribution

The installer will download (unless they already exist):
* OpenCL user-mode driver (87MiB)  
* Linux 4.7 kernel (66MiB)  

Setup requires ~10GiB disk space, and takes ~1h on a 4-cores machine.
(~8.9GiB for building the Linux kernel, ~1GiB for other files)

Do you want to continue? [y/n] y
Found existing workspace at /root/intel-opencl...
~/intel-opencl /home/dandan
Installing user mode driver...
Downloading user mode driver...
SRB5.0_linux64.zip already exists, skipping download...
unzip -o SRB5.0_linux64.zip
Archive:  SRB5.0_linux64.zip
 inflating: intel-opencl-cpu-r5.0-63503.x86_64.rpm   
 inflating: intel-opencl-cpu-r5.0-63503.x86_64.tar.xz   
 inflating: intel-opencl-cpu-r5.0-63503.x86_64.tar.xz.sig   
 inflating: intel-opencl-devel-r5.0-63503.x86_64.rpm   
 inflating: intel-opencl-devel-r5.0-63503.x86_64.tar.xz   
 inflating: intel-opencl-devel-r5.0-63503.x86_64.tar.xz.sig   
 inflating: intel-opencl-r5.0-63503.x86_64.rpm   
 inflating: intel-opencl-r5.0-63503.x86_64.tar.xz   
 inflating: intel-opencl-r5.0-63503.x86_64.tar.xz.sig   
 inflating: vpg_ocl_linux_rpmdeb.public   
Looking for previously installed user-mode driver...
rm -rf /etc/ld.so.conf.d/libintelopencl.conf
rm -rf /etc/OpenCL/vendors/intel.icd
rm -rf /etc/profile.d/libintelopencl.sh
rm -rf /opt/intel/opencl
tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz
tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
cp -R intel-opencl/* /
ldconfig
Downloading Linux kernel 4.7...
linux-4.7.tar.xz already exists, skipping download...
Installing Linux kernel 4.7...
linux-4.7 kernel directory exists, skipping extract...
~/intel-opencl/linux-4.7 ~/intel-opencl /home/dandan
patch -p1 < /opt/intel/opencl/kernel-4.7.patch
can't find file to patch at input line 19
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 18c0bd9224ea2764698bc42ceba47f1be4ed7967 Mon Sep 17 00:00:00 2001
|From: =?UTF-8?q?Micha=C5=82=20Winiarski?= <michal.winiarski@intel.com>
|Date: Wed, 21 Oct 2015 13:11:24 +0200
|Subject: [PATCH 01/17] drm/i915: Add L3_LRA_1 Register to cmdparser whitelist
|MIME-Version: 1.0
|Content-Type: text/plain; charset=UTF-8
|Content-Transfer-Encoding: 8bit
|
|Change-Id: I4fba318061b175d481ea2f2f02593d70930daf23
|Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
|---
| drivers/gpu/drm/i915/i915_cmd_parser.c |    1 +
| 1 files changed, 1 insertions(+), 0 deletions(-)
|
|diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
|index a337f33..85f0f2f 100644
|--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
|+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
--------------------------
File to patch:

 

What do I do with it (what do I enter at "File to patch")?

 

Thanks!

sober, paul's picture

make sure you add your user to video group by:

sudo usermod -a -G video $LOGNAME

siromoni, sandipan's picture

 

in this  article there is 3 part  1) Install the driver 2) install SDK 3) set up Eclipse 

so 1st part I have finished succsssfully , but for 2nd part .i.e. installing SDK i m facing issue 

while installing intel opencl SDK on my system i.e.  while running the script  ./install_GUI.sh   I am getting GPU not supported error

  I have intel i5-3210M processor  and graphics is intel  HD4000 , I am installing all these on centOs core 7.2 

 

can anyone help me on this issue 

jian, liu's picture

 

Ubuntu 16.04 and  the 4.8 kernel.

 

the Hardware readiness checks:
--------------------------
 [ OK ] Processor name: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
--------------------------
OS readiness checks:
--------------------------
 [ OK ] GPU visible to OS
--------------------------
Media Server Studio Install:
--------------------------
 [ ERROR ] user not in video group.  Add with usermod -a -G video {user}
 [ ERROR ] libva.so.1 not found.  Check LD_LIBRARY_PATH contains '/usr/lib64;/usr/local/lib'
 [ ERROR ] libva not loading Intel iHD
 [ ERROR ] vainfo not reporting codec entry points
 [ ERROR ] no libva include files.  Are Intel components installed?
--------------------------
Component Smoke Tests:
--------------------------
 [ ERROR ] no Media SDK include files.  Are Intel components installed?
 [ OK ] OpenCL check:Segmentation fault (core dumped)

 

Hardware readiness checks:
--------------------------
 [ OK ] Processor name: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
--------------------------
OS readiness checks:
--------------------------
 [ OK ] GPU visible to OS
--------------------------
Media Server Studio Install:
--------------------------
 [ ERROR ] user not in video group.  Add with usermod -a -G video {user}
 [ ERROR ] libva.so.1 not found.  Check LD_LIBRARY_PATH contains '/usr/lib64;/usr/local/lib'
 [ ERROR ] libva not loading Intel iHD
 [ ERROR ] vainfo not reporting codec entry points
 [ ERROR ] no libva include files.  Are Intel components installed?
--------------------------
Component Smoke Tests:
--------------------------
 [ ERROR ] no Media SDK include files.  Are Intel components installed?
 [ OK ] OpenCL check:Segmentation fault (core dumped)

 

peter b.'s picture

I followed steps 1) and 2), now I wanna

ioc64 -input=simpleAdd.cl -asm

but I got

ioc64: command not found

how to install ioc64?

root@ubuntu:/home/ubuntu/Downloads# cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 78
model name	: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz

 

dj b.'s picture

1$ mv install_OCL_driver.sh_.txt install_OCL_driver.sh2$ chmod 755 install_OCL_driver.sh3$ sudo su4$ ./install_OCL_driver.sh install

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.