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.
1719 Discussions

SDK for OpenCL Applications 2014 Beta - Ubuntu Installation Issue

bmeardon
Novice
955 Views

Hello,

I just downloaded the latest SDK for OpenCL Applications 2014 Beta for Ubuntu, but I'm experiencing an issue that is not allowing me to successfully complete installation of the software.  My environment is as follows:

CPU: Intel Core i7-3612QM (Ivy Bridge)
OS: Ubuntu 14.04 (LTS) x64
OpenCL 2014 Beta SDK: 4.0.1.17537 x64

After unpacking the tgz, I successfully installed the first two packages from the install-cpu.sh file: opencl-1.2-base-4.0.1.17537-1.x86_64.deb and opencl-1.2-devel-4.0.1.17537-1.x86_64.deb.  However, the third package (opencl-1.2-intel-cpu-4.0.1.17537-1.x86_64.deb) fails to install with an error message that doesn't provide much insight into what went wrong.  Below is the exact command line and output:

sudo dpkg -i opencl-1.2-intel-cpu-4.0.1.17537-1.x86_64.deb 
(Reading database ... 208132 files and directories currently installed.)
Preparing to unpack opencl-1.2-intel-cpu-4.0.1.17537-1.x86_64.deb ...
/var/lib/dpkg/info/opencl-intel-cpu.prerm: 1: /var/lib/dpkg/info/opencl-intel-cpu.prerm: /usr/sbin/update-alternatives: not found
Unpacking opencl-intel-cpu (1.2-4.0.1.17537) over (1.2-4.0.1.17537) ...
Setting up opencl-intel-cpu (1.2-4.0.1.17537) ...
/var/lib/dpkg/info/opencl-intel-cpu.postinst: 2: /var/lib/dpkg/info/opencl-intel-cpu.postinst: [[: not found
/var/lib/dpkg/info/opencl-intel-cpu.postinst: 18: /var/lib/dpkg/info/opencl-intel-cpu.postinst: /usr/sbin/update-alternatives: not found
dpkg: error processing package opencl-intel-cpu (--install):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 opencl-intel-cpu

Any help would be most appreciated!

Thanks,
Brandon

0 Kudos
1 Solution
bmeardon
Novice
955 Views

I had a chance over the weekend to revisit my issue and as it turns out resolve it myself.  After having a closer look at the dpkg output, I noticed that one of those lines was complaining about the post install script not being able to find /usr/sbin/update-alternatives, which on my system is located at /usr/bin/update-alternatives and I had no symbolic link in /usr/sbin to it.  Simply adding the appropriate symbolic link in /usr/sbin fixed my issue and all seems to be running fine.

However, I don't believe this is a fix to John I's issue - as I didn't see any dpkg output indicating an issue with finding update-alternatives.

Regards,
Brandon

View solution in original post

0 Kudos
9 Replies
john_l_3
Beginner
955 Views

I'm getting a similar problem on an Elitebook 2540p running LXDE wheezy

Error

In case of failure, refer to release notes at https://software.intel.com/en-us/vcsource/tools/opencl-sdk
Selecting previously unselected package opencl-base.
(Reading database ... 177420 files and directories currently installed.)
Unpacking opencl-base (from opencl-1.2-base-4.4.0.117-1.x86_64.deb) ...
Selecting previously unselected package opencl-intel-cpu.
Unpacking opencl-intel-cpu (from opencl-1.2-intel-cpu-4.4.0.117-1.x86_64.deb) ...
Selecting previously unselected package opencl-devel.
Unpacking opencl-devel (from opencl-1.2-devel-4.4.0.117-1.x86_64.deb) ...
Selecting previously unselected package opencl-intel-devel.
Unpacking opencl-intel-devel (from opencl-1.2-intel-devel-4.4.0.117-1.x86_64.deb) ...
Selecting previously unselected package opencl-intel-devel-android.
Unpacking opencl-intel-devel-android (from opencl-1.2-intel-devel-android-4.4.0.117-1.x86_64.deb) ...
Setting up opencl-base (1.2-4.4.0.117) ...
/var/lib/dpkg/info/opencl-base.postinst: 2: /var/lib/dpkg/info/opencl-base.postinst: [[: not found
update-alternatives: warning: priority is out of range: -2147489036 clamped to -2147483648
update-alternatives: using /opt/intel/opencl-1.2-4.4.0.117/lib64/libOpenCL.so to provide /usr/lib/x86_64-linux-gnu/libOpenCL.so (opencl-libOpenCL.so) in auto mode
update-alternatives: error: error creating symbolic link `/usr/lib/x86_64-linux-gnu/libOpenCL.so.dpkg-tmp': No such file or directory
dpkg: error processing opencl-base (--install):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of opencl-intel-cpu:
 opencl-intel-cpu depends on opencl-base (>= 1.2-4.4.0.117); however:
  Package opencl-base is not configured yet.

dpkg: error processing opencl-intel-cpu (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of opencl-devel:
 opencl-devel depends on opencl-base (>= 1.2-4.4.0.117); however:
  Package opencl-base is not configured yet.

dpkg: error processing opencl-devel (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of opencl-intel-devel:
 opencl-intel-devel depends on opencl-base (>= 1.2-4.4.0.117); however:
  Package opencl-base is not configured yet.
 opencl-intel-devel depends on opencl-intel-cpu (>= 1.2-4.4.0.117); however:
  Package opencl-intel-cpu is not configured yet.

dpkg: error processing opencl-intel-devel (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of opencl-intel-devel-android:
 opencl-intel-devel-android depends on opencl-base (>= 1.2-4.4.0.117); however:
  Package opencl-base is not configured yet.
 opencl-intel-devel-android depends on opencl-intel-cpu (>= 1.2-4.4.0.117); however:
  Package opencl-intel-cpu is not configured yet.

dpkg: error processing opencl-intel-devel-android (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 opencl-base
 opencl-intel-cpu
 opencl-devel
 opencl-intel-devel
 opencl-intel-devel-android

0 Kudos
bmeardon
Novice
956 Views

I had a chance over the weekend to revisit my issue and as it turns out resolve it myself.  After having a closer look at the dpkg output, I noticed that one of those lines was complaining about the post install script not being able to find /usr/sbin/update-alternatives, which on my system is located at /usr/bin/update-alternatives and I had no symbolic link in /usr/sbin to it.  Simply adding the appropriate symbolic link in /usr/sbin fixed my issue and all seems to be running fine.

However, I don't believe this is a fix to John I's issue - as I didn't see any dpkg output indicating an issue with finding update-alternatives.

Regards,
Brandon

0 Kudos
Nuno_B_
Beginner
955 Views

I have the exact same problem as John. The same error... At this time, I cannot afford to do a clean system install also.

0 Kudos
Yuri_K_Intel
Employee
955 Views
Hi John and Nuno, What is the version of Ubuntu that you're using? We don't observe this issue on officialy supported version - 12.04. Thanks, Yuri
0 Kudos
David_J_3
Beginner
955 Views

This appears to be a bug in the .deb installation scripts.  Specifically, if I look into the extracted file /var/lib/dpkg/info/opencl-base.postinst, I see this line:

update-alternatives \

--install "/usr/lib/x86_64-linux-gnu/libOpenCL.so" opencl-libOpenCL.so "/opt/intel/opencl-1.2-4.4.0.117/lib64/libOpenCL.so" -2147489036 \

--slave "/usr/lib/x86_64-linux-gnu/libOpenCL.so.1" opencl-libOpenCL.so.1 "/opt/intel/opencl-1.2-4.4.0.117/lib64/libOpenCL.so.1" \

--slave "/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.2" opencl-libOpenCL.so.1.2 "/opt/intel/opencl-1.2-4.4.0.117/lib64/libOpenCL.so.1.2"

Just as the error message says, that priority (-2147489036) is out of range. Changing it to -1147489036 seems to avoid the error (though I don't know how to make that change int he .deb file in order to complete the installation :( )

0 Kudos
Adam_Strzelecki
Beginner
955 Views

Hello Intel staff and fellow users,

I wish to express my feedback regarding Ubuntu packages for OpenCL SDK 2014, which we are using targeting Xeon Phi.

Long story short, they are BROKEN. Seems they were just ported using "alien" from RPM packages, but there are couple of caveats:

  1. On Ubuntu path for update-alternatives is /usr/bin/update-alternatives while your DEB postinst and postrm scripts refer to /usr/sbin/update-alternatives which is Fedora/RedHat specific, I presume you may just refer w/o full path as /usr/bin and /usr/sbin will be in PATH for these scripts anyway, this will make scripts portable.
     
  2. All calls to update-alternatives use priority of -2147489036 while minimum allowed for Ubuntu is INT_MIN = -2147483648. Frankly I dunno where -2147489036 came from :>
     
  3. Ubuntu uses Dash for non-interactive scripts which does not support several "bashisms" (https://wiki.ubuntu.com/DashAsBinSh#A.5B.5B) used in your DEB scripts, i.e.:
    1. opencl-1.2-base-4.4.0.117-1.x86_64.deb/DEBIAN/postinst
      [[ -e etc/OpenCL/ ]] & chmod -R 755 /etc/OpenCL
      should become:
      [ -e etc/OpenCL/ ] && chmod -R 755 /etc/OpenCL
      Please note single & which is also obvious error in script.
    2. opencl-1.2-intel-cpu-4.4.0.117-1.x86_64.deb/DEBIAN/postinst
      if [[ "/opt/intel/opencl-1.2-4.4.0.117" != "/opt/intel/opencl-1.2-4.4.0.117" ]]; then
      This is "bashism" and it is always FALSE! This if clause should be completely removed as it doesn't make sense.

I would appreciate if you fix these bugs. If there is any issue tracker I would be much appreciated too.

0 Kudos
Bojan_B_
Beginner
955 Views

Dear Adam, 

did you manage to implement these fixes on your own Ubuntu-distro to get OpenCL working? I'm currently experiencing problems similar to the ones described in this thread. I have found several guides regarding fixes, but these all apply to the previous OpenCL-package which isn't up for download anymore. 

Kind regards,

0 Kudos
Yuri_K_Intel
Employee
955 Views
Hello All, We plan to refactor Ubuntu installation package to include fixes for mentioned issues and add support for Ubuntu 14.04. Thanks, Yuri
0 Kudos
Feng_X_
Beginner
955 Views

I have fixed some bugs and re-packaged and uploaded these debs on my [blog](http://xfanzone.me/fixing-opencl-deb.html).

Now it is working.

0 Kudos
Reply