How to install libOpenCL.so on ubuntu
I downloaded intel_sdk_for_opencl_2016_ubuntu_6.0.0.1049_x64, tried to run install.sh but it says Unsupported OS, so I then read somewhere that I needed to make .deb file from one of the RPM files, I did it with 2:
opencl-1.2-devel_6.0.0.1049-2_amd64.deb
opencl-1.2-intel-devel_6.0.0.1049-2_amd64.deb
Installed them both with sudo dpkg -i, but I still don't have the libOpenCL.so that I need
Now I'm stuck... :(
4 Answers
It looks like libOpenCL.so is provided by the ocl-icd-opencl-dev package. To install this package, run:
sudo apt update
sudo apt install ocl-icd-opencl-devNow libOpenCL.so should be located at /usr/lib/x86_64-linux-gnu/libOpenCL.so
The way, suggested by Nick Weinberg, installs a pretty outdated version of the driver, therefore I would suggest to download the one directly from your hardware vendor.
Since you have Intel CPU, do the following
- Open the Intel OpenCL drivers web-page, go to "Intel CPU Runtime for OpenCL™ Applications 18.1 for Linux* OS (64bit only)" and press "Download"
- The web-site will ask you to register and login. This is mandatory. Then you will be directed to the link with tgz-archive.
Download this archive and install it as follows.
tar -pvxf l_opencl_p_18.1.0.013.tgz cd l_opencl_p_18.1.0.013/` sudo ./install.sh`This installation script will write a lot of libraries into
/opt/inteland will create a symbolic link (or replace the old one)/usr/lib/x86_64-linux-gnu/libOpenCL.so.
My understanding of the subject is that the above steps allow OpenCL to access your Intel CPU. But if you have Intel HD Graphics, it makes sense to allow OpenCL to use this integrated graphics too. Then do the following
- Open the Intel OpenCL drivers web-page again, but this time go to "Linux* OS Ubuntu* 16.04.x (deb)" under "Intel® Graphics Technology" section. Then you have two choices: "Download" and "Build". Use the "Download" link, it will bring you to pre-built binaries ("Build" will bring you to the source code at Intel's github, but I have never tried to compile it from source).
Follow instructions given over there. I've just copied these here with one fix - use
sudo aptinstead ofsudo dpkg -i *.debsincedpkgdoes not check dependencies:mkdir neo cd neo wget wget wget wget wget sudo apt install ./*debNote that
.in./*debis important: without this dot you will getUnable to locateandCouldn't finderrors.
P.S. the Intel website lists the suitable CPUs, make sure that yours is in this list.
I wanted to get OpenCL working for darktable on Ubuntu 19.04 x64.
Initially darktable-cltest reports
0.016782 [opencl_init] could not find opencl runtime library 'libOpenCL'
0.016851 [opencl_init] could not find opencl runtime library 'libOpenCL.so'
0.016988 [opencl_init] found opencl runtime library 'libOpenCL.so.1'
0.017020 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded
0.021674 [opencl_init] found 1 platform
0.077428 [opencl_init] found 1 device
0.077458 [opencl_init] discarding device 0 `Intel(R) HD Graphics 5500 BroadWell U-Processor GT2' because the driver `OpenCL 1.2 beignet 1.3' is blacklisted.
0.077464 [opencl_init] no suitable devices found.
0.077469 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
0.077473 [opencl_init] initial status of opencl enabled flag is OFF.But after sudo apt-get install intel-opencl-icd it is working fine.
This thread: resolved my problem.
To do that you just have to go on the official AMD website and look for your drivers and download the correct Linux one, right now the recent version is 18.30, so get it and extract the content in a folder.
Now use the terminal, move inside that folder, and just run ./amdgpu-install --opencl=legacy,pal --headless
I had to do this in addition to installing the ocl-icd-opencl-dev package.