Intel OpenCL + Ubuntu安装

Intel OpenCL + Ubuntu安装
 

因为项目采用Intel开发平台,需要安装Opencl,注意Intel 的OpenVINO开发平台并没有包括Opencl安装,另外安装Intel Opencl SDK. 注意作者本人环境是Ubuntu 16.04,操作系统不是安装到虚拟机环境中,因为虚拟机不能访问到GPU硬件资源
OpenCL Base on CPU or GPU

因特尔的opencl sdk CPU和GPU是分开的,如下图所示

 

                             

 如上图所示,上图左边为基于CPU的sdk开发,右图为基于GPU的sdk开发,两者都是基于Opencl Runtime,但是里面所需的lib不一样,故安装不一样。但是需要先安装基于CPU的SDK,再安装基于GPU的 sdk
基于CPU安装

opencl SDK安装可以参考官网手册:官网链接

按照管网链接基本没有出现什么错误,

首先下载相关CPU sdk包:

下载链接:OpenCL SDK

选择如下图所示:

下载完后直接解压:

进入到l_opencl_p_18.1.0.015目录下, ./install_GUI.sh

    agicdepth@magicdepth-OptiPlex-7010:~/Downloads$ cd l_opencl_p_18.1.0.015/
    magicdepth@magicdepth-OptiPlex-7010:~/Downloads/l_opencl_p_18.1.0.015$ ls -l
    total 84
    -rwxr-xr-x 1 magicdepth magicdepth   643 4月  18 15:48 install_GUI.sh
    -rwxr-xr-x 1 magicdepth magicdepth 19118 5月   7 18:34 install.sh
    -rwxrwxr-x 1 magicdepth magicdepth 42983 8月   3  2018 license.txt
    drwxr-xr-x 6 magicdepth magicdepth  4096 5月   7 18:34 pset
    -rwxr-x--- 1 magicdepth magicdepth   975 5月   7 17:51 PUBLIC_KEY.PUB
    drwxr-xr-x 2 magicdepth magicdepth  4096 5月   7 18:34 rpm
    -rw-r--r-- 1 magicdepth magicdepth  2991 5月   7 18:34 silent.cfg
    magicdepth@magicdepth-OptiPlex-7010:~/Downloads/l_opencl_p_18.1.0.015$ ./install_GUI.sh
     

   注意新版本之后,不需要按照官网进行lib链接,只需要一步骤按照类似window安装点击next就可以

点击next

选择同意

  同意继续:

 

此时可以看到需要root权限运行,退出来之后,sudo ./install_GUI.sh 安装即可

安装目录采用的是默认目录,即/opt/intel,安装完后可以看到

进入到按照目录cd opencl_compilers_and_libraries_18.1.0.015/ ,可以看到安装目录下

    root@magicdepth-OptiPlex-7010:/opt/intel# cd opencl_compilers_and_libraries_18.1.0.015/
    root@magicdepth-OptiPlex-7010:/opt/intel/opencl_compilers_and_libraries_18.1.0.015# ls -l
    total 36
    drwxr-xr-x 2 root root  4096 5月   7 18:33 licensing
    drwxr-xr-x 4 root root  4096 5月   7 18:33 linux
    drwxr-xr-x 5 root root  4096 5月   7 18:34 uninstall
    -rwxr-xr-x 1 root root   645 4月  18 15:48 uninstall_GUI.sh
    -rwxr-xr-x 1 root root 19118 5月   7 18:34 uninstall.sh

使用到的相关lib,在/opt/intel/opencl_compilers_and_libraries_18.1.0.015/linux/compiler/lib/intel64_lin目录下

    root@magicdepth-OptiPlex-7010:/opt/intel/opencl_compilers_and_libraries_18.1.0.015/linux/compiler/lib/intel64_lin# ls -l
    total 284048
    -rwxr-xr-x 1 root root    377360 9月  21  2018 clbltfne9_img_cbk.o
    -rwxr-xr-x 1 root root   1062864 9月  21  2018 clbltfne9_img_cbk.rtl
    -rwxr-xr-x 1 root root   2642900 9月  21  2018 clbltfne9.rtl
    -rwxr-xr-x 1 root root    395320 9月  21  2018 clbltfnh8_img_cbk.o
    -rwxr-xr-x 1 root root   1058656 9月  21  2018 clbltfnh8_img_cbk.rtl
    -rwxr-xr-x 1 root root   2681944 9月  21  2018 clbltfnh8.rtl
    -rwxr-xr-x 1 root root    325496 9月  21  2018 clbltfnl9_img_cbk.o
    -rwxr-xr-x 1 root root    953924 9月  21  2018 clbltfnl9_img_cbk.rtl
    -rwxr-xr-x 1 root root   1660660 9月  21  2018 clbltfnl9.rtl
    -rwxr-xr-x 1 root root    326568 9月  21  2018 clbltfnz0_img_cbk.o
    -rwxr-xr-x 1 root root    950164 9月  21  2018 clbltfnz0_img_cbk.rtl
    -rwxr-xr-x 1 root root   1631344 9月  21  2018 clbltfnz0.rtl
    -rwxr-xr-x 1 root root      6185 9月  21  2018 cl.cfg
    -rwxr-xr-x 1 root root  13428496 9月  21  2018 libclang_compiler.so
    -rwxr-xr-x 1 root root   1272576 9月  21  2018 libcl_logger.so
    -rwxr-xr-x 1 root root  83185648 9月  21  2018 libcommon_clang.18.1.so
    -rwxr-xr-x 1 root root   4274800 9月  21  2018 libcpu_device.so
    -rwxr-xr-x 1 root root  20566024 9月  21  2018 libintelocl.so
    -rwxr-xr-x 1 root root 124684528 9月  21  2018 libOclCpuBackEnd.so
    lrwxrwxrwx 1 root root        16 8月  19 11:32 libOpenCL.so -> ./libOpenCL.so.1
    lrwxrwxrwx 1 root root        18 8月  19 11:32 libOpenCL.so.1 -> ./libOpenCL.so.2.0
    -rwxr-xr-x 1 root root     48216 9月  21  2018 libOpenCL.so.2.0
    -rwxr-xr-x 1 root root   3076368 9月  21  2018 libtask_executor.so
    lrwxrwxrwx 1 root root        19 8月  19 11:32 libtbbmalloc.so -> ./libtbbmalloc.so.2
    -rwxr-xr-x 1 root root    795697 9月  21  2018 libtbbmalloc.so.2
    lrwxrwxrwx 1 root root        13 8月  19 11:32 libtbb.so -> ./libtbb.so.2
    -rwxr-xr-x 1 root root   2119125 9月  21  2018 libtbb.so.2
    -rwxr-xr-x 1 root root   5746723 9月  21  2018 __ocl_svml_e9.so
    -rwxr-xr-x 1 root root   6251740 9月  21  2018 __ocl_svml_h8.so
    -rwxr-xr-x 1 root root   5629376 9月  21  2018 __ocl_svml_l9.so
    -rwxr-xr-x 1 root root   5656195 9月  21  2018 __ocl_svml_z0.so

libOpenCL.so即为opencl所需要的lib 安装成功
GPU SDK安装

   intel 的GPU opencl 是基于 Graphics Runtime,需要按照相关lib,

 其相关按照文件在github中,Intel Graphics

相关安装步骤 github中已经给出,只需要按照步骤做即可

安装成功后, /usr/local/lib/intel-opencl目录下会有libigdrcl.so

    root@magicdepth-OptiPlex-7010:/usr/local/lib# ls -l
    total 103028
    drwxr-xr-x 2 magicdepth magicdepth     4096 8月  19 16:21 intel-opencl
    lrwxrwxrwx 1 magicdepth magicdepth       13 7月  10 18:00 libiga64.so -> libiga64.so.1
    lrwxrwxrwx 1 magicdepth magicdepth       18 7月  10 18:00 libiga64.so.1 -> libiga64.so.1.0.10
    -rw-r--r-- 1 magicdepth magicdepth  1984032 7月  18 17:57 libiga64.so.1.0.10
    lrwxrwxrwx 1 magicdepth magicdepth       11 7月  10 18:00 libigc.so -> libigc.so.1
    lrwxrwxrwx 1 magicdepth magicdepth       16 7月  10 18:00 libigc.so.1 -> libigc.so.1.0.10
    -rw-r--r-- 1 magicdepth magicdepth 39403000 7月  18 17:57 libigc.so.1.0.10
    lrwxrwxrwx 1 magicdepth magicdepth       14 7月  10 18:00 libigdfcl.so -> libigdfcl.so.1
    lrwxrwxrwx 1 magicdepth magicdepth       19 7月  10 18:00 libigdfcl.so.1 -> libigdfcl.so.1.0.10
    -rw-r--r-- 1 magicdepth magicdepth  1258720 7月  18 17:58 libigdfcl.so.1.0.10
    lrwxrwxrwx 1 magicdepth magicdepth       20 7月   2 14:28 libigdgmm.so.9 -> libigdgmm.so.9.0.589
    -rw-r--r-- 1 magicdepth magicdepth   375312 7月  18 17:57 libigdgmm.so.9.0.589
    lrwxrwxrwx 1 magicdepth magicdepth       20 7月  10 18:00 libopencl-clang.so -> libopencl-clang.so.8
    -rw-r--r-- 1 magicdepth magicdepth 62454048 7月  18 17:58 libopencl-clang.so.8
    drwxr-xr-x 2 root       root           4096 8月  13 19:17 pkgconfig
    drwxrwsr-x 4 root       staff          4096 2月  27 08:01 python2.7
    drwxrwsr-x 3 root       staff          4096 2月  27 07:57 python3.5
    root@magicdepth-OptiPlex-7010:/usr/local/lib# cd intel-opencl/
    root@magicdepth-OptiPlex-7010:/usr/local/lib/intel-opencl# ls -l
    total 3212
    -rw-r--r-- 1 magicdepth magicdepth 3287024 7月  18 17:59 libigdrcl.so

Intel System Studio

Intel为广大开发者提供了System Studio IDE开发工具,可以参考https://software.intel.com/en-us/articles/sdk-for-opencl-2019-gsg-linux-os,中的链接进行按照,作者本人并不喜欢集成的IDE开发环境,故并没有安装

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值