74

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... :(

edwinksl
  • 24,109
Badjano
  • 903

5 Answers5

103

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-dev

Now libOpenCL.so should be located at /usr/lib/x86_64-linux-gnu/libOpenCL.so

13

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

  1. 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"

  2. The web-site will ask you to register and login. This is mandatory. Then you will be directed to the link with tgz-archive.

  3. 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/intel and 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

  1. 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).

  2. Follow instructions given over there. I've just copied these here with one fix - use sudo apt instead of sudo dpkg -i *.deb since dpkg does not check dependencies:

    mkdir neo
    cd neo
    wget https://github.com/intel/compute-runtime/releases/download/19.14.12751/intel-gmmlib_19.1.1_amd64.deb
    wget https://github.com/intel/compute-runtime/releases/download/19.14.12751/intel-igc-core_19.11.1622_amd64.deb
    wget https://github.com/intel/compute-runtime/releases/download/19.14.12751/intel-igc-opencl_19.11.1622_amd64.deb
    wget https://github.com/intel/compute-runtime/releases/download/19.14.12751/intel-opencl_19.14.12751_amd64.deb
    wget https://github.com/intel/compute-runtime/releases/download/19.14.12751/intel-ocloc_19.14.12751_amd64.deb
    sudo apt install ./*deb
    

Note that . in ./*deb is important: without this dot you will get Unable to locate and Couldn't find errors.

P.S. the Intel website lists the suitable CPUs, make sure that yours is in this list.

2

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.

Adam
  • 121
0

This thread: https://einsteinathome.org/content/quick-guide-how-install-opencl-amd-gpus-linux-kubuntu-1804-and-similar-distro resolved my problem.

To do that you just have to go on the official AMD website and look for your drivers https://www.amd.com/en/support 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.

0

UPDATE for people visiting this in 2025: newer releases from Intel seem to no longer support full hardware acceleration in ”legacy” (i.e. commonplace) user hardware per this GitHub issue, so here’s what to do:

  • If you have a brand new Xenon server (I’m guessing that’s Intel’s new target audience), try installing the latest release:

    # NEWEST version for brand new servers
    RVER=v2.5.6 IVER=2_2.5.6+18417 EVER=24.52.32224.5 LVER=1.6.32224.5
    COMPILER=https://github.com/intel/intel-graphics-compiler/releases/download/$RVER/intel-igc-
    COMPUTE=https://github.com/intel/compute-runtime/releases/download/$EVER/intel-
    curl -SLZC - --output-dir /tmp/icl$EVER --create-dirs --remote-name-all --http1.1\
        "$COMPILER{core,opencl}-${IVER}_amd64.deb"\
        "$COMPUTE{level-zero-gpu-dbgsym_$LVER,opencl-icd-dbgsym_$EVER}_amd64.ddeb"\
        "$COMPUTE{level-zero-gpu_$LVER,opencl-icd_$EVER}_amd64.deb"\
        "https://github.com/intel/compute-runtime/releases/download/$EVER/libigdgmm12_22.5.5_amd64.deb"
    sudo chown -R _apt:`id -ng` /tmp/icl$EVER
    sudo apt-get install ocl-icd-opencl-dev && sudo dpkg -Ri /tmp/icl$EVER
    

    (See GitHub to find the links for the latest release)

  • For everything else (e.g. my 2019 laptop with Icelake Client iGPU), install the older version:

    # OLDER version for typical consumer hardware
    RVER=1.0.17537.20 EVER=24.35.30872.22 LVER=1.3.30872.22
    COMPILER=https://github.com/intel/intel-graphics-compiler/releases/download/igc-$RVER/intel-igc-
    COMPUTE=https://github.com/intel/compute-runtime/releases/download/$EVER/intel-
    curl -SLZC - --output-dir /tmp/icl$EVER --create-dirs --remote-name-all --http1.1\
        "$COMPILER{core,opencl}_${RVER}_amd64.deb"\
        "$COMPUTE{level-zero-gpu-dbgsym_$LVER,level-zero-gpu-legacy1-dbgsym_$LVER,opencl-icd-dbgsym_$EVER,opencl-icd-legacy1-dbgsym_$EVER}_amd64.ddeb"\
        "$COMPUTE{level-zero-gpu-legacy1_$LVER,level-zero-gpu_$LVER,opencl-icd-legacy1_$EVER,opencl-icd_$EVER}_amd64.deb"\
        "https://github.com/intel/compute-runtime/releases/download/$EVER/libigdgmm12_22.5.0_amd64.deb"
    sudo chown -R _apt:`id -ng` /tmp/icl$EVER
    sudo apt-get install ocl-icd-opencl-dev && sudo dpkg -Ri /tmp/icl$EVER
    

(Side note: these all depend on the latest LTS Ubuntu—v24 aka Noble as of 2025)

Jack G
  • 251
  • 3
  • 8