这里写目录标题

  • 1 问题 [CLDNN ERROR]. clGetPlatformIDs error -1001
  • 2 使用openVINO下GPU,务必是intel的核显或集显,nvidia是不行的。
  • 3 安装OpenCL的驱动程序
  • 4 观察GPU使用率
  • 5 install_NEO_OCL_driver.sh

1 问题 [CLDNN ERROR]. clGetPlatformIDs error -1001

如果你在使用openVINO时候遇到这个问题,其实是少做了一步操作。当然前提是你已经可以把CPU的跑起来了,这说明你的搭建是没有问题,只是GPU少操作了一步而已哈。

2 使用openVINO下GPU,务必是intel的核显或集显,nvidia是不行的。

下面我正在使用intel的uhd630,符合要求。

3 安装OpenCL的驱动程序

安装完毕,用GPU推理就没有问题了,这里就不展示,下面看看这个脚本。

cd /opt/intel/openvino/install_dependencies
sudo -E ./install_NEO_OCL_driver.sh

注意,可能遇到的问题,从脚本的执行顺序来看,

  1. 可能会在卸载老版本驱动出现问题,可以尝试sudo apt-get remove/purge xxx,脚本用的purge(配置文件一起删除)
  2. 由于是dpkg管理的,很容易出现安装新包的依赖问题,记得使用sudo apt-get -f install

4 观察GPU使用率

sudo apt-get install intel-gpu-tools
sudo intel_gpu_top

5 install_NEO_OCL_driver.sh

这个shell脚本写的很实在,有兴趣可以仔细看看。
从大体方面,可以知道如下内容

  1. 仅支持centos/ubuntu两个操作系统
  2. 对操作系统进行检查,centos7及以上,ubuntu16或者18
  3. 要求使用root权限运行脚本,一般都是这样子的(可能会安装一些包或者是设置相关配置问题)
  4. 接下来的安装,就两个操作系统分开执行对应的函数。这里以ubuntu为例
  5. 检查系统是否已经安装了intel-openclintel-ocloc intel-gmmlibintel-igc-coreintel-igc-opencl,如果已经安装了,会直接卸载。如果没有继续执行。
  6. 安装依赖包,包括libnuma1、 ocl-icd-libopencl1两个
  7. 正式安装所需要的4个包
  8. 将用户加入video group

其他细节可以参考。

#!/bin/bash# Copyright (c) 2018 - 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.#
# Installs the Graphics Driver for OpenCL on Linux.
#
# Usage: sudo -E ./install_NEO_OCL_driver.sh
#
# Supported platforms:
#     6th, 7th, 8th or 9th generation Intel® processor with Intel(R)
#     Processor Graphics Technology not previously disabled by the BIOS
#     or motherboard settings
#
EXIT_FAILURE=1
PKGS=
CENTOS_MINOR=
UBUNTU_VERSION=
DISTRO=_install_prerequisites_centos()
{# yum doesn't accept timeout in seconds as parameterechoecho "Note: if yum becomes non-responsive, try aborting the script and run:"echo "      sudo -E $0"echoCMDS=("yum -y install tar libpciaccess numactl-libs""yum -y groupinstall 'Development Tools'""yum -y install rpmdevtools openssl openssl-devel bc numactl ocl-icd ocl-icd-devel")for cmd in "${CMDS[@]}"; doecho $cmdeval $cmdif [[ $? -ne 0 ]]; thenecho ERROR: failed to run $cmd >&2echo Problem \(or disk space\)? >&2echo . Verify that you have enough disk space, and run the script again. >&2exit $EXIT_FAILUREfidone}_install_prerequisites_ubuntu()
{CMDS=("apt-get -y update""apt-get -y install libnuma1 ocl-icd-libopencl1")for cmd in "${CMDS[@]}"; doecho $cmdeval $cmdif [[ $? -ne 0 ]]; thenecho ERROR: failed to run $cmd >&2echo Problem \(or disk space\)? >&2echo "                sudo -E $0" >&2echo 2. Verify that you have enough disk space, and run the script again. >&2exit $EXIT_FAILUREfidone
}install_prerequisites()
{if [[ $DISTRO == "centos" ]]; thenecho Installing prerequisites..._install_prerequisites_centoselif [[ $DISTRO == "ubuntu" ]]; thenecho Installing prerequisites..._install_prerequisites_ubuntuelseecho Unknown OSfi
}_deploy_rpm()
{# On a CentOS 7.2 machine with Intel Parallel Composer XE 2017# installed we got conflicts when trying to deploy these rpms.# If that happens to you too, try again with:# IGFX_RPM_FLAGS="--force" sudo -E ./install_NEO_OCL_driver.sh install#cmd="rpm $IGFX_RPM_FLAGS -ivh --nodeps --force $1"echo $cmdeval $cmd
}_deploy_deb()
{cmd="dpkg -i $1"echo $cmdeval $cmd
}_install_user_mode_centos()
{_deploy_rpm "intel*.rpm"if [[ $? -ne 0 ]]; thenecho ERROR: failed to install rpms $cmd error  >&2echo Make sure you have enough disk space or fix the problem manually and try again. >&2exit $EXIT_FAILUREfi
}_install_user_mode_ubuntu()
{_deploy_deb "intel*.deb"if [[ $? -ne 0 ]]; thenecho ERROR: failed to install rpms $cmd error  >&2echo Make sure you have enough disk space or fix the problem manually and try again. >&2exit $EXIT_FAILUREfi
}install_user_mode()
{echo "Installing user mode driver..."if [[ $DISTRO == "centos" ]]; then_install_user_mode_centoselse_install_user_mode_ubuntufi
}_uninstall_user_mode_centos()
{echo Looking for previously installed user-mode driver...PACKAGES=("intel-opencl""intel-ocloc""intel-gmmlib""intel-igc-core""intel-igc-opencl")for package in "${PACKAGES[@]}"; do      echo "rpm -qa | grep $package"found_package=$(rpm -qa | grep $package)if [[ $? -eq 0 ]]; thenecho Found installed user-mode driver, performing uninstall...cmd="rpm -e --nodeps ${found_package}"echo $cmdeval $cmdif [[ $? -ne 0 ]]; thenecho ERROR: failed to uninstall existing user-mode driver. >&2echo Please try again manually and run the script again. >&2exit $EXIT_FAILUREfifidone
}_uninstall_user_mode_ubuntu()
{echo Looking for previously installed user-mode driver...PACKAGES=("intel-opencl""intel-ocloc""intel-gmmlib""intel-igc-core""intel-igc-opencl")for package in "${PACKAGES[@]}"; dofound_package=$(dpkg-query -W -f='${binary:Package}\n' ${package})if [[ $? -eq 0 ]]; thenecho Found $found_package installed, uninstalling...dpkg --purge $found_packageif [[ $? -ne 0 ]]; thenecho "ERROR: unable to remove $found_package" >&2echo "       please resolve it manually and try to launch the script again." >&2exit $EXIT_FAILUREfifidone
}uninstall_user_mode()
{if [[ $DISTRO == "centos" ]]; then_uninstall_user_mode_centoselse_uninstall_user_mode_ubuntufi
}_is_package_installed()
{if [[ $DISTRO == "centos" ]]; thencmd="rpm -qa | grep $1"elsecmd="dpkg-query -W -f='${binary:Package}\n' $pkg"fiecho $cmdeval $cmd
}version_gt() {# check if first version is greater than second versiontest "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
}summary()
{kernel_version=$(uname -r)echoecho Installation completed successfully.echoecho Next steps:echo "Add OpenCL users to the video group: 'sudo usermod -a -G video USERNAME'"echo "   e.g. if the user running OpenCL host applications is foo, run: sudo usermod -a -G video foo"echo "   Current user has been already added to the video group"echo# ask to install kernel 4.14 if current kernel version < 4.13 (GPU NEO driver supports only kernels 4.13.x and higher)if version_gt "4.13" "$kernel_version" ; thenecho "Install 4.14 kernel using install_4_14_kernel.sh script and reboot into this kernel"echofiecho "If you use 8th Generation Intel® Core™ processor, you will need to add:"echo "   i915.alpha_support=1"echo "   to the 4.14 kernel command line, in order to enable OpenCL functionality for this platform."echo}check_root_access()
{if [[ $EUID -ne 0 ]]; thenecho "ERROR: you must run this script as root." >&2echo "Please try again with "sudo -E $0", or as root." >&2exit $EXIT_FAILUREfi
}add_user_to_video_group()
{local real_user=$(logname 2>/dev/null || echo ${SUDO_USER:-${USER}})echoecho Adding $real_user to the video group...usermod -a -G video $real_userif [[ $? -ne 0 ]]; thenecho WARNING: unable to add $real_user to the video group >&2fi
}_check_distro_version()
{if [[ $DISTRO == centos ]]; thenCENTOS_MINOR=$(sed 's/CentOS Linux release 7\.\([[:digit:]]\+\).\+/\1/' /etc/centos-release)if [[ $? -ne 0 ]]; thenecho ERROR: failed to obtain CentOS version minor. >&2echo This script is supported only on CentOS 7 and above. >&2exit $EXIT_FAILUREfielif [[ $DISTRO == ubuntu ]]; thenUBUNTU_VERSION=$(lsb_release -r -s) if [[ $UBUNTU_VERSION != '18.04' && $UBUNTU_VERSION != '16.04' ]]; thenecho "Warning: This runtime can be installed only on Ubuntu 18.04 or Ubuntu 16.04."echo "More info https://github.com/intel/compute-runtime/releases" >&2exit "Installation of Intel Compute Runtime interrupted"fifi
}distro_init()
{if [[ -f /etc/centos-release ]]; thenDISTRO="centos"elif [[ -f /etc/lsb-release ]]; thenDISTRO="ubuntu"fi_check_distro_version
}install()
{uninstall_user_modeinstall_prerequisitesinstall_user_modeadd_user_to_video_group
}main()
{echo "Intel OpenCL graphics driver installer"distro_initcheck_root_accessinstallsummary
}[[ "$0" == "$BASH_SOURCE" ]] && main "$@"

openVINO在Ubuntu18.04上使用GPU的一个问题?[CLDNN ERROR]. clGetPlatformIDs error -1001相关推荐

  1. ubuntu18.04上安装anaconda-python深度学习环境

    Anaconda是一套Python的发行版,发行版集成了必要的库,使用户可以一次性完成安装.Anaconda是一个侧重于数据分析的发行版,一些有助于数据分析的库,比如Numpy,Matplotlib, ...

  2. Ubuntu18.04深度学习GPU环境配置

    Ubuntu18.04深度学习GPU环境配置 Ubuntu 18.04.cuda 9.0.cuDnn v7.TensorFlow/Keras 与anaconda 1.背景 为了加速神经网络的训练,使用 ...

  3. ubuntu18.04上安装ffmpeg

    ubuntu18.04上安装ffmpeg 下载ffmpeg wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.t ...

  4. 在Ubuntu18.04上安装ros2的环境,ros2的常用命令:播放包、录制包等

    在Ubuntu18.04上安装ros2的环境,ros2的常用命令:播放包.录制包等 1 添加密钥和ros2下载 2 更新源和安装ros-eloquent-desktop及其依赖 3 配置环境 3.1 ...

  5. 在Ubuntu18.04上编译SWASH模型

    在Ubuntu18.04上编译SWASH模型 SWASH模型 编译准备 源代码下载 Intel Fortran Compiler安装 MPICH库安装 其它 编译代码 本文内容参考了用户Mr.Zhen ...

  6. Tesla T4 在Ubuntu18.04上的安装使用

    Tesla T4 在Ubuntu18.04上的安装使用 在默认情况下,安装 tesla T4 的驱动,尝试很多版本都无法正确安装,安装完之后会出现: nvidia-smi NVIDIA-SMI has ...

  7. linux里安装可视化软件visit,可视化软件VisIt在Ubuntu18.04上的安装

    可视化软件VisIt在Ubuntu18.04上的安装 1.下载 在官网下载页面下载合适版本的安装文件,Ubuntu有专用的 同时需要注意的是,Linux另外还要下载在下载表格上方的 visit-ins ...

  8. 在Ubuntu18.04上安装USTC-TK2016

    在Ubuntu18.04上安装USTC-TK2016 1.安装依赖 1. 安装Mono sudo apt install gnupg ca-certificates sudo apt-key adv ...

  9. linux 显卡扩展坞,Ubuntu18.04上外接显卡扩展坞安装Nvidia驱动和CUDA10.0及cuDNN

    前言 一通折腾,算是把显卡扩展坞给接上用起来了.能找到的Ubuntu外接显卡扩展坞配置深度学习环境的资料比较少,乱折腾一番总算是能用了.现努力回忆过程,尽可能完整地记录下来配置环境的过程. ----- ...

  10. 在Ubuntu18.04上搭建私有网盘 —— ownCloud

    欢迎访问我的个人博客: luomuxiaoxiao.com 您可能还会对这篇文章感兴趣:如何下载网站的在线视频 一 安装ownCloud 二 设置默认目录 三 为ownCloud建立数据库 四 配置o ...

最新文章

  1. 万能的Python,不仅能开发效率高,还能绘画各种漫画图像
  2. OpenCV Mat类详解
  3. keras 实战系列之Self-Attention详细解析
  4. 【Python】异常捕获
  5. vld检测不输出_输出轴热处理形变超差,找找原因
  6. 梁宁:真正驱动你变强的,是痛苦
  7. [Xcode 实际操作]八、网络与多线程-(17)使用网址会话对象URLSession向远程服务器上传图片...
  8. Go语言实现线程安全访问队列
  9. STM-1和SDH的关系
  10. oracle中表为啥会死锁,Oracle数据表中的死锁情况解决方法
  11. [Gamma阶段]第四次Scrum Meeting
  12. 手动 将exe加入到系统启动服务、卸载服务的方法
  13. python中merge函数_Python Merge函数原理及用法解析
  14. 小学听力测试英语软件,亲测:好用的小学英语软件有哪些?这6款通通安利给大家!...
  15. linux用vi使一个段落对齐,12.8 Linux下vi命令和shell学习
  16. 10种令人吃惊的方式你的日常生活中正在收集数据的大数据野兽
  17. 单片机中C语言延时函数
  18. Java基础:IO 流中的 flush
  19. 中小企业上马ERP要谨慎
  20. UVa679 Dropping Balls (满二叉树+开关灯思想)

热门文章

  1. 几年的Unity学习总结
  2. 读书印记 - 《上瘾:让用户养成使用习惯的四大产品逻辑》
  3. SCRM红包功能及公众号支付配置操作教程
  4. 计算机技术与发展scd,全国计算机技术与软件专业技术资格(.PDF
  5. 直线生成算法---逐点比较法
  6. 福建高职自主招生计算机学校,2019年福建单独招生高职院校名单汇总,福建高职自主招生院校名单...
  7. 思维提升不可不知-稀缺心态与管窥
  8. java和XML转换(一)
  9. linux打开显示器配置文件,ubuntu无法应用原保存显示器配置,打开命令输入rm/.config/monitors.xml后,命令显示没有那个文件或目录...
  10. 中国电影工业,走到了关键的十字路口!