【OpenVINO】解决OpenVINO在GPU推理中报错的方法

1. 问题描述

使用OpenVINO进行深度学习推理时,通常会借助GPU以提升计算速度。然而,有时候运行程序时候会出现如下错误:

<kernel>:8153:2: error: expected identifier or '('
 unroll_for (int i = 0; i < TILE_SIZE; ++i) {
 ^
<kernel>:17:56: note: expanded from macro 'unroll_for'
....
<kernel>:8242:2: error: expected identifier or '('
 unroll_for (int i = 0; i < X_REMAINDER_SIZE; ++i) {
 ^
<kernel>:17:56: note: expanded from macro 'unroll_for'
....
terminate called after throwing an instance of 'InferenceEngine::GeneralError'
  what():  [ GENERAL_ERROR ] Check 'false' failed at src/plugins/intel_gpu/src/plugin/program_builder.cpp:179:
[GPU] ProgramBuilder build failed!
Program build failed(0_part_11): You may enable OCL source dump to see the error log。

我的系统版本为Ubuntu 20.04,内核版本5.15.0-101-generic。

2. 解决方法

https://github.com/openvinotoolkit/openvino/issues/18452给出了解决问题的方法是安装Intel核芯显卡的驱动程序。对于我的系统与内核版本,可以安装23.09.25812.14版本的驱动。

下面是具体的步骤(参考https://github.com/intel/compute-runtime/releases?page=2):

步骤一:创建临时目录并下载相关软件包

在终端中执行以下命令:

mkdir neo
cd neo
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.13463.18/intel-igc-core_1.0.13463.18_amd64.deb
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.13463.18/intel-igc-opencl_1.0.13463.18_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/23.09.25812.14/intel-level-zero-gpu-dbgsym_1.3.25812.14_amd64.ddeb
wget https://github.com/intel/compute-runtime/releases/download/23.09.25812.14/intel-level-zero-gpu_1.3.25812.14_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/23.09.25812.14/intel-opencl-icd-dbgsym_23.09.25812.14_amd64.ddeb
wget https://github.com/intel/compute-runtime/releases/download/23.09.25812.14/intel-opencl-icd_23.09.25812.14_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/23.09.25812.14/libigdgmm12_22.3.0_amd64.deb

步骤二:验证软件包的完整性

下载相应的 *.sum 文件,并执行以下命令进行验证:

wget https://github.com/intel/compute-runtime/releases/download/23.09.25812.14/ww09.sum
sha256sum -c ww09.sum

确保输出中所有软件包的校验和都匹配。

步骤三:安装软件包

sudo安装软件包:

sudo dpkg -i *.deb

可以通过

clinfo -l

查看是否能够打印出Intel UHD Graphics。若有,则说明iGPU成功被驱动。

再次运行程序,已经可以正常使用GPU进行神经网络推理。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值