Get Started with Intel® SDK for OpenCL™ Applications for Linux*

This article is a step by step guide to quickly get started using Intel®  SDK for OpenCL™ applications with the Intel® Graphics Compute Runtime for OpenCL™ and Linux SRB5 driver packages.  An OpenCL driver is a prerequisite for using the GPU capabilities of OpenVINO™ toolkit or Intel® Deep Learning Deployment Toolkit.

  1. Install an OpenCL driver
  2. Install the Intel SDK for OpenCL applications
  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 a driver

To install the Intel Graphics Compute Runtime for OpenCL driver, see the following links:

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 (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 Intel SDK for OpenCL Applications

This script shows install steps for prerequisites required for Intel SDK for OpenCL applications install on Ubuntu. It was last checked with Ubuntu 16.04.4 (linux 4.13.0-36-generic).

Summary of script operations:

  • Install oracle-java8-installer
  • Install mono
  • Install the appropriate libicu version (for Intel® Code Builder for OpenCL™ API plugin support)
  • Install dkms and lsb-core for driver support
  • Note: Update tools need to go out to the web. If your system requires a proxy for the web, make sure your environment variables are visible as root user.
$ mv install_SDK_prereq_ubuntu.sh_.txt install_SDK_prereq_ubuntu.sh
$ sudo su
$ ./install_SDK_prereq_ubuntu.sh

After this, run the Intel SDK for OpenCL applications standalone version installer. You can also run the Intel® System Studio installer, choose the Intel SDK for OpenCL applications there, and install it.

Here is a kernel to test the Intel SDK for OpenCL applications 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 MarsNeon, and Oxygen.

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

Note: This is for Intel SDK for OpenCL applications standalone version only. For Intel System Studio, it is done automatically. 

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

Start Eclipse. Intel Code Builder for OpenCL API options should be available in Tools > Intel Code Builder for OpenCL API.

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

14 comments

Top
peter b.'s picture

I have followed the steps and not installed :(

step 2) just install prerequisites - how to install driver itself? Since I am still have

"ioc64: command not found"

and where can I find "CodeBuilder*.jar" since I want to do an integration with Eclipse.

Thanks. 

 

gagliano, luca's picture

Hi I cannot manage to perform step 1 of the installation process, I get the error:

 

ERROR: failed to run apt-get update
Problem (or disk space)?
                sudo -E ./install_OCL_driver.sh
2. Verify that you have enough disk space, and run the script again.

 

But I checked space available, and it is more than enough.

Any clue?

gagliano, luca's picture

Hi, Trying to install opencl according to the instruction provided. In step 1 when I run the script I have the error below, however I checked the space available and it is more than enough. Any suggestions?

ERROR: failed to run apt-get update
Problem (or disk space)?
                sudo -E ./install_OCL_driver.sh
2. Verify that you have enough disk space, and run the script again.
Hal G. (Intel)'s picture

Questions regarding  Intel® SDK for OpenCL™ Applications should be posted to the forums here: https://software.intel.com/en-us/forums/opencl

Questions posted to Articles may or may not be responded to.

Regards, Hal

Intel(R) Developer Zone Support

https://software.intel.com
*Other names and brands may be claimed as the property of others.

Questions regarding Intel® Visual Fortran Compiler for Windows* should be posted to the forums here: https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows

 

Questions posted to Articles may or may not be responded to.

 

Regards, Hal

Intel(R) Developer Zone Support

https://software.intel.com
*Other names and brands may be claimed as the property of others.

sanivarapu, aditya's picture

I followed steps 1 and 2  and now tried the below command.

ioc64 -input=simpleAdd.cl -asm

but I got

ioc64: command not found

how to install ioc64?

melnikov, andrey's picture

How do you do!

I have successfully completed all the steps listed above. When running neon.3 eclipse I have got the following message:

"Cannot get platform list:

Could not load required libraries; please make sure to set the correct path under the Code Builder for OpenCL preference page."

python sys_analyzer output:

"

--------------------------
Hardware readiness checks:
--------------------------
 [ OK ] Processor name: Intel(R) Core(TM) i3-4010U CPU @ 1.70GHz
--------------------------
OS readiness checks:
--------------------------
 [ OK ] GPU visible to OS
--------------------------
Media Server Studio Install:
--------------------------
 [ OK ] user in video group
 [ 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 libdrm include files. Are Intel components installed?
--------------------------
Component Smoke Tests:
--------------------------
 [ ERROR ] no Media SDK include files.  Are Intel components installed?
 [ OK ] OpenCL check:platform:Intel(R) OpenCL GPU OK CPU OK
platform:Experimental OpenCL 2.1 CPU Only Platform GPU OK CPU OK

"

from the command line if you type:

echo $LD_LIBRARY_PATH

then the output is:
/etc/alternatives/opencl-intel-tools/lib64;/etc/alternatives/opencl-intel-tools/bin;/usr/lib64;/usr/local/lib

 

 

What is wrong?

Can you help, please?

Thank you.

Andrey M.

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 

Pages

Add a Comment

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