Package: nvidia-opencl-dev
Version: 7.5.18-4~bpo8+1
On a Debian8 machine:
- fresh installed from the ec2 debian8 image
- with jessie-backports repository
installing ‘ nvidia-opencl-dev’ from jessie-backports triggers the install of
(among other packages) of:
- nvidia-libopencl1 amd64 375.82-1~deb9u1~bpo8+1
- opencl-headers 2.0~svn31815-2~bpo8+1
The issue is that nvidia-libopencl1 provides an ICD loader in
libOpenCL.so which only supports OpenCL 1.2, whereas opencl-headers 2.0
advertises OpenCL version 2, which is inconsistent and leads to compilation
errors (see the exchange on
https://lists.tiker.net/pipermail/pyopencl/2018-February/002340.html
<https://lists.tiker.net/pipermail/pyopencl/2018-February/002340.html>).
#####################
Exact script from a base debian8 image to reproduce:
echo "deb http://httpredir.debian.org/debian/ jessie contrib non-free" >>
jessie-contrib-nonfree-backports.list
echo "deb http://httpredir.debian.org/debian/ jessie-backports main contrib
non-free" >> jessie-contrib-nonfree-backports.list
sudo mv jessie-contrib-nonfree-backports.list /etc/apt/sources.list.d/
sudo apt-get update
sudo apt-get -t jessie-backports install -y nvidia-opencl-dev
.. and then /usr/lib/x86_64-linux-gnu/libOpenCL.so does not have OpenCL 2.0
symbols (e.g. clSVMFree)
but /usr/include/CL/cl.h advertises OpenCL 2.0:
/usr/include/CL/cl.h:198:#define CL_VERSION_2_0 1
#####################
Possible solutions (I did not look at the detailed decency tree..) may
be:
- nvidia-libopencl1 375.82 to request opencl-headers version <=1.2 (which is in
jessie)
- do not install nvidia-libopencl1 but rather the generic ICD loader
ocl-icd-opencl-dev
For those who meet this, an immediate workaround is to first install
opencl-headers from jessie repository (without the ‘-t jessie-backports’), and
only then install nvidia-opencl-dev / nvidia-cuda-toolkit) from jessie-backport.
Thanks,
--
Vincent Favre-Nicolin