ck-env icon indicating copy to clipboard operation
ck-env copied to clipboard

Create packages for OpenCL headers

Open psyhtest opened this issue 8 years ago • 4 comments

On some OpenCL platforms, no OpenCL headers are installed, even when a driver is available (e.g. libOpenCL.so). The headers can be fetched e.g. as follows:

# mkdir /usr/include/CL
# cd /usr/include/CL
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/opencl12/CL/opencl.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/opencl12/CL/cl.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/opencl12/CL/cl_platform.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/opencl12/CL/cl_ext.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/opencl12/CL/cl_gl.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/opencl12/CL/cl_gl_ext.h
# wget https://github.com/KhronosGroup/OpenCL-CLHPP/releases/download/v2.0.10/cl2.hpp

What's worse, building a package using OpenCL may fail due to missing headers half way or further down the build. This wastes time.

CK should detect the driver version and download the appropriate headers when none are found.

psyhtest avatar Sep 06 '17 13:09 psyhtest

I had an old package to download such headers. I attached it. ckr-ck-old-packages.zip I suggest to create several packages (that can work on Linux, Windows, Android and MacOS using universal downloader) for OpenCL 1.1,1.2,2.0 and any others - we can then provide dependency on a specific version in other packages - help is appreciated!

gfursin avatar Sep 26 '17 07:09 gfursin

We saw the need for such package here: https://github.com/dividiti/ck-caffe/issues/137#issuecomment-374845305 . Should check it again at some point ...

gfursin avatar Mar 21 '18 08:03 gfursin

We should assign this task to an enthusiastic newbie, as I've hit this issue once again :)

psyhtest avatar Sep 21 '18 11:09 psyhtest

# mkdir /usr/include/CL
# cd /usr/include/CL
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/CL/opencl.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/CL/cl.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/CL/cl_platform.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/CL/cl_ext.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/CL/cl_gl.h
# wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/master/CL/cl_gl_ext.h
# wget https://github.com/KhronosGroup/OpenCL-CLHPP/releases/download/v2.0.10/cl2.hpp
root@diviniti:/usr/include/CL# ls -la
total 508
drwxr-xr-x  2 root root   4096 Sep 21 12:21 .
drwxr-xr-x 43 root root   4096 Sep 21 12:19 ..
-rw-r--r--  1 root root 299999 May 23  2017 cl2.hpp
-rw-r--r--  1 root root  30788 Sep 21 12:21 cl_ext.h
-rw-r--r--  1 root root   2869 Sep 21 12:21 cl_gl_ext.h
-rw-r--r--  1 root root   7672 Sep 21 12:21 cl_gl.h
-rw-r--r--  1 root root  78817 Sep 21 12:21 cl.h
-rw-r--r--  1 root root  47062 Sep 21 12:21 cl_platform.h
-rw-r--r--  1 root root   1993 Sep 21 12:19 opencl.h

psyhtest avatar Sep 21 '18 11:09 psyhtest