OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.

Intel OpenCL r3.0-57406 on Ubuntu 16.04LTS

Seva_G_
Beginner
578 Views

Hi everyone,

I'm going to summarize results of my experiments with Intel OpenCL r3.0-57406 on Ubuntu 16.04 here, in assumption that community would benefit from it, save the CPU cycles etc. All tests were performed on Intel Core i7-6700 Skylake chip, and CPU-only part has been also tested on Intel Core i5-3570K IvyBridge.

To the moment, my findings are as follows:

  • The Intel OpenCL r3.0-57406 GPU ICD is installable and accessible using the kernel patch for 4.4 kernels supplied with the Intel OpenCL 2.0-54425, even though its release notes state that the 4.4 kernels support is deprecated.
  • The contents of the intel-opencl-r3.0-57406.x86_64.tar.xz archive is perfectly relocatable to the standard Debian/Ubuntu tree (i.e. /usr/lib/x86_64-linux-gnu/intel-opencl), except the /opt/intel/opencl/igdclbif.bin file which is hardcoded and therefore must be either kept in /opt/intel/opencl or symlinked there.
  • The libOpenCL.so.1 shared library inside this archive is modified by Intel and incompatible with the one shipped in the standard ocl-icd-libopencl1 package. Being forced to use the packaged version, clinfo doesn't report Intel OpenCL GPU driver available, and using the modified version, the clinfo output is somehow incomplete.
  • The libcommon_clang.so shared library inside this archive is also needed by the Intel OpenCL CPU driver (intel-opencl-cpu-r3.0-57406.x86_64.tar.xz). This is the only dependency, though, so one can safely isolate this file into a standalone intel-opencl-common self-made package (as I did in my setup).
  • The contents of the Intel OpenCL CPU driver archive (mentioned above) is missing the approprate etc/OpenCL/vendors/intel-cpu.icd announcement. Not a big deal, though, as one can simply run a shell command like 'echo /opt/intel/opencl/libintelocl.so > /etc/OpenCL/vendors/intel-cpu.icd' and fix this.
  • This archive also contains TBB shared library which is available through the standard package libtbb2, so one can safely remove the library files using command 'rm /opt/intel/opencl/libtbb*' and stay with the packaged version.
  • The contents of this archive is perfectly relocatable to the /usr/lib/x86_64-linux-gnu/intel-opencl, with no hardcoded paths everywhere.
  • In fact, the Intel OpenCL CPU driver does not need neither modified libOpenCL.so.1, nor modified Linux kernel, it runs smoothly with the generic Ubuntu Linux kernel and packaged ocl-icd-libopencl1, and it does not conflict with the Beignet Intel OpenCL GPU ICD. (I was able to run our computations in parallel using both Beignet OpenCL on GPU device and Intel OpenCL on CPU.)
  • I tried to adjust the kernel-4.7.patch to make it applicable against 4.8 kernels because Ubuntu Yakkety jumped straight to 4.8 kernels from 4.4. on Xenial, and I was able to successfully compile it, but the patched 4.8 kernel didn't complete the boot process with some errors on file system (so that I'm not sure if it is result of bad patching or deep difference between Xenial and Yakkety distros), and I don't have Yakkety here, so I'm ready to pass a token to those who have if anyone dares to give it a try. Ping me if you want to try the patch yourself or install the patched kernel packages.

UPDATE: I've got a working Yakkety box in my hands and successfully booted it with my patched 4.8 kernel. On a negative side, this box is equipped with IvyBridge, hence the OpenCL GPU driver didn't find anything. Need to test in on some Skylake more.

0 Kudos
5 Replies
Chernov__Alexey
Beginner
578 Views

> I tried to adjust the kernel-4.7.patch to make it applicable against 4.8 kernels because Ubuntu Yakkety jumped straight to 4.8 kernels from 4.4. on Xenial, and I was able to successfully compile it, but the patched 4.8 kernel didn't complete the boot process with some errors on file system (so that I'm not sure if it is result of bad patching or deep difference between Xenial and Yakkety distros), and I don't have Yakkety here, so I'm ready to pass a token to those who have if anyone dares to give it a try. Ping me if you want to try the patch yourself or install the patched kernel packages

My solution is to update only i915.ko (only changes in patch) build from 4.7 kernel source with stock 4.8 ubuntu kernel. But for me everything works with 4.4 kernel.

cd linux-4.7.10
make SUBDIRS=drivers/gpu/drm/i915 modules
cd ..
cp linux-4.7.10/drivers/gpu/drm/i915/i915.ko i915_new.ko
strip --strip-debug i915_new.ko

cp --preserve=timestamps /lib/modules/4.8.0-26-generic/kernel/drivers/gpu/drm/i915/i915.ko i915_old.ko
sudo cp --preserve=timestamps i915_new.ko /lib/modules/4.8.0-26-generic/kernel/drivers/gpu/drm/i915/i915.ko

RAtlu1
New Contributor II
578 Views

Hello 

Can you please detail any instructions on how to get it working with 4.8 Kernels?

Seva_G_
Beginner
578 Views

Based on the comment above, you can just use the patched i915 module compiled from the 4.7 kernel source tree.

Alternatively, the following kernel patch can be used: 531082

A good instruction on building custom kernel packages can be found here:

http://www.hiroom2.com/2016/05/19/ubuntu-16-04-rebuild-kernel-with-devscripts/

If you've got the working kernel, but the driver still refuses to find the GPU, I can't help you much because I'm staying on 4.4 kernels, and I hadn't have a time for experiments with 4.8 on Skylake.

RAtlu1
New Contributor II
578 Views

Hello Seva

Thanks for the help. I did try out vanilla 4.8 kernel distro (ubuntu 16.10) and installed the GPU drivers, runtime without any patch. It seems to show me the gpu. I havent really run any tests yet.

The 4.8 kernel seems to have introduced a couple of changes since 4.7. 

Anyway I can stick with 4.4 kernel. If in that case, will the patch meant for 4.7 just apply on 4.4 kernel?

Seva_G_
Beginner
578 Views

Dear Sahil,

In my comment above, you can find the kernel patch adapted for 4.8 branch. The 4.7 kernel patch supplied by Intel won't apply to 4.8 kernels.

Reply