Ubuntu – Install OpenCL on ubuntu 16.04, Intel i5 7th gen Dell Inspiron Laptop

16.04intel-cpuopencl

I recently purchased a Dell Inspiron 3000 series laptop with an Intel i5 7th generation processor. The machine came preloaded with Windows 8 but being an Ubuntu loyalist, I installed Ubuntu 16.04 on it.

I need to work with OpenCL on my laptop for which I have followed the procedure listed out in this thread (OpenCL On ubuntu 16.04, Intel Sandy Bridge CPU) and have installed PyOpenCL (incidentally, this thread worked perfectly for my workstation at work where I have a Xeon machine)

I used the following python script (https://github.com/benshope/PyOpenCL-Tutorial/blob/master/010_introspection.py) to obtain this output on my laptop:

============================================================
OpenCL Platforms and Devices
============================================================
Platform - Name:  Intel Gen OCL Driver
Platform - Vendor:  Intel
Platform - Version:  OpenCL 1.2 beignet 1.1.1
Platform - Profile:  FULL_PROFILE
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)

The same script on my workstation gives me:

============================================================
Platform - Name:  Intel(R) OpenCL
Platform - Vendor:  Intel(R) Corporation
Platform - Version:  OpenCL 2.0 LINUX
Platform - Profile:  FULL_PROFILE
--------------------------------------------------------
Device - Name:  Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
Device - Type:  CPU
Device - Max Clock Speed:  2200 Mhz
Device - Compute Units:  24
Device - Local Memory:  32 KB
Device - Constant Memory:  128 KB
Device - Global Memory: 31 GB
Device - Max Buffer/Image Size: 8013 MB
Device - Max Work Group Size: 8192

lspci gives me:

lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Device 5916 (rev 02)

(On a possibly unrelated note, I also installed a graphics driver on my laptop which was not the case when I first tried installing OpenCL)

Basically, I'm unable to figure out which OpenCL format would be suitable for my hardware.

Any advice would be really great 🙂

Best Answer

Ok so I figured it out. Also, it was NOT rocket-science :/

The link (OpenCL On ubuntu 16.04, Intel Sandy Bridge CPU) I followed earlier was perfect since I was working on a Xeon machine. It would not have worked (big surprise!) on my Laptop since it obviously isn't a Xeon machine.

I needed to use the sdk for linux which is available after filling out the form. Once the form is filled out you get redirected to a page where you can choose the product and the version and download either a .gz file or a .tgz file. The .tgz is for the Yocto OS but during installation you can run it without any loss of generalization for Ubuntu 16.04.

The installation is fairly simple since there is an extremely handy executable install.sh shell script to use.

The general steps to follow are:

  1. extract the folder

    tar -xzvf intel_sdk_for_opencl_2017_yocto_7.0.0.2567_x64.tgz
    
  2. run the shell script

    ./install.sh
    
  3. follow the instructions

The output of the python script then shows:

============================================================
OpenCL Platforms and Devices
============================================================
Platform - Name:  Intel Gen OCL Driver
Platform - Vendor:  Intel
Platform - Version:  OpenCL 1.2 beignet 1.1.1
Platform - Profile:  FULL_PROFILE
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
============================================================
Platform - Name:  Experimental OpenCL 2.1 CPU Only Platform
Platform - Vendor:  Intel(R) Corporation
Platform - Version:  OpenCL 2.1 LINUX
Platform - Profile:  FULL_PROFILE
    --------------------------------------------------------
    Device - Name:  Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Device - Type:  CPU
    Device - Max Clock Speed:  2500 Mhz
    Device - Compute Units:  4
    Device - Local Memory:  32 KB
    Device - Constant Memory:  128 KB
    Device - Global Memory: 8 GB
    Device - Max Buffer/Image Size: 1962 MB
    Device - Max Work Group Size: 8192
============================================================
Platform - Name:  Intel(R) OpenCL
Platform - Vendor:  Intel(R) Corporation
Platform - Version:  OpenCL 2.0 
Platform - Profile:  FULL_PROFILE
    --------------------------------------------------------
    Device - Name:  Intel(R) HD Graphics
    Device - Type:  GPU
    Device - Max Clock Speed:  1000 Mhz
    Device - Compute Units:  23
    Device - Local Memory:  64 KB
    Device - Constant Memory:  3209904 KB
    Device - Global Memory: 6 GB
    Device - Max Buffer/Image Size: 3135 MB
    Device - Max Work Group Size: 256
    --------------------------------------------------------
    Device - Name:  Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Device - Type:  CPU
    Device - Max Clock Speed:  2500 Mhz
    Device - Compute Units:  4
    Device - Local Memory:  32 KB
    Device - Constant Memory:  128 KB
    Device - Global Memory: 8 GB
    Device - Max Buffer/Image Size: 1962 MB
    Device - Max Work Group Size: 8192
Related Question