Ubuntu 20.04和Ubuntu 16.04 集成显卡支持opencl说明

针对Ubuntu 不同版本Ubuntu 20.04和Ubuntu 16.04对集成显卡安装opencl说明.

1、安装支持opencl显卡驱动

1)Ubuntu 20.04

sudo apt-get update

sudo apt-get update && sudo apt-get install -y --no-install-recommends curl gpg gpg-agent && sudo curl https://repositories.intel.com/graphics/intel-graphics.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg && echo 'deb arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg https://repositories.intel.com/graphics/ubuntu focal-legacy main' | sudo tee /etc/apt/sources.list.d/intel.gpu.focal.list

2) Ubuntu 16.04

通过intel-graphics-update-tool进行安装,先安装 intel-graphics-update-tool ,再安装显卡驱动(参考https://cloud.tencent.com/developer/article/1386851?from=15425)

wget https://download.01.org/gfx/ubuntu/16.04/main/pool/main/i/intel-graphics-update-tool/intel-graphics-update-tool_2.0.2_amd64.deb

sudo dpkg -i intel-graphics-update-tool_2.0.2_amd64.deb

sudo intel-graphics-update-tool

sudo apt-get install -f

sudo intel-graphics-update-tool

wget $(echo "https://download".01.org/gfx/RPM-GPG-GROUP-KEY-ilg) -O - | sudo apt-key add -

sudo apt-get update

2、根据opencl驱动

1)Ubuntu 20.04

sudo apt-get update

sudo apt-get install -y --no-install-recommends intel-opencl-icd intel-level-zero-gpu level-zero

2)Ubuntu 16.04

https://blog.csdn.net/GerZhouGengCheng/article/details/121358166

下载deb安装包

cd opencl

wget https://github.com/intel/compute-runtime/releases/download/18.45.11804/intel-gmmlib_18.4.0.348_amd64.deb

wget https://github.com/intel/compute-runtime/releases/download/18.45.11804/intel-igc-core_18.44.1060_amd64.deb

wget https://github.com/intel/compute-runtime/releases/download/18.45.11804/intel-igc-opencl_18.44.1060_amd64.deb

wget https://github.com/intel/compute-runtime/releases/download/18.45.11804/intel-opencl_18.45.11804_amd64.deb

以root权限安装deb包

sudo dpkg -i *.deb

3、安装clinfo进行确认OpenCL驱动信息

1)安装clinfo

sudo apt-get install clinfo
2)查看Intel GPU OpenCL驱动信息

sudo clinfo

4、根据opencl开发库

sudo apt-get install opencl-headers ocl-icd-opencl-dev

5、opencl测试
测试代码(矩阵乘法):cl.c、matecv.cl

编译:
gcc cl.c -o opencl_t -g -lOpenCL
运行:
./opencl_t

6、GPU的监控工具是intel-gpu-tools

安装后使用sudo intel-gpu-tools就可以监控gpu的使用率。安装完毕后,

系统中会多种三个gpu工具: intel_gpu_abrt intel_gpu_time intel_gpu_top

其中,常用的是intel_gpu_top和intel_gpu_time

安装命令:

apt-get install intel-gpu-tools

查看GPU使用情况命令:

sudo intel_gpu_top

参考

https://cloud.tencent.com/developer/article/1386851?from=15425

Ubuntu 16.04下静态编译OpenCV 3.4.14集成OpenCL调用Intel(R) HD Graphics NEO实现GPU加速_opencv opengl intel gpu-CSDN博客

相关推荐
BI专家之路1 小时前
安装linux/hadoop/jdk/hive
linux·hive·hadoop
GeW13 小时前
超详细!RHCE10版通用备考策略,内含评分细则解读
linux
用户0413284651314 小时前
Linux 服务开机自启动怎么配置?systemctl enable 原理详解
linux
草莓熊Lotso1 天前
【Redis 初阶】Set 类型深度解析:去重集合的运算能力与实战场景
linux·网络·数据库·windows·redis·tcp/ip·缓存
张文君1 天前
ubuntu26.04坏道坏块分区隔离急速版260831-V0.12
linux·python
IT大白鼠1 天前
Docker 实战 ELKF 日志监控:容器日志全栈收集分析方案
运维·docker·容器
贝锐1 天前
从国产化信创设备到商用安卓终端,向日葵如何帮助企业实现统一运维管理?
linux·运维·远程控制
Julien20041 天前
调查和解决 SELinux 问题
linux·运维·服务器·网络·学习方法
天远Date Lab1 天前
零信任架构实战:基于天远双人婚姻评估查询构建自动化房产按揭联合审查网关
运维·人工智能·架构·自动化
2601_962074681 天前
自己编译RustDesk,并将自建ID服务器和key信息写入客户端
运维·服务器