我们创建了一个小程序来检测Xeon Phi,这是我们的代码片段
std::vector<cl::Platform> platformList(5);
std::vector<cl::Device> deviceList;
cl::Platform::get(&platformList);
if(platformList.size() == 0){
std::cout << "No Platforms found. Check OpenCL installation!" << std::endl;
exit(1);
}
for(i=0; i<platformList.size(); i++){
// for(i=0; i<1; i++){
std::cout << platformList[i].getInfo<CL_PLATFORM_NAME>()<< std::endl;
platformList[i].getDevices(CL_DEVICE_TYPE_ALL, &deviceList);
if(deviceList.size() == 0){
std::cout << "No Devices found. Check OpenCL installation!" << std::endl;
exit(1);
}
for(j=0; j<deviceList.size(); j++){
// dims = deviceList[j].getInfo<CL_DEVICE_MAX_WORK_ITEM_SIZES>();
// for(k=0; k<dims.size(); k++)
// std::cout << dims[k] << std::endl;
std::cout << deviceList[j].getInfo<CL_DEVICE_NAME>()<< std::endl;
}
}
cl::Device device = deviceList[j-1];
std::cout << "Using device: " << device.getInfo<CL_DEVICE_NAME>() << std::endl;
但它没有检测到Phi,我们只得到这个输出;
Intel(R) OpenCL
Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz
Using device: Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz
Hello World
你知道我们做错了什么吗?
附:您可以在下面找到micinfo输出
MicInfo Utility Log
Copyright 2011-2013 Intel Corporation All Rights Reserved.
Created Thu Oct 2 15:04:08 2014
System Info
HOST OS : Linux
OS Version : 2.6.32-431.el6.x86_64
Driver Version : 3.2-1
MPSS Version : 3.2
Host Physical Memory : 16274 MB
Device No: 0, Device Name: mic0
Version
Flash Version : 2.1.02.0390
SMC Firmware Version : 1.16.5078
SMC Boot Loader Version : 1.8.4326
uOS Version : 2.6.38.8+mpss3.2
Device Serial Number : ADKC32800437
Board
Vendor ID : 0x8086
Device ID : 0x225d
Subsystem ID : 0x3608
Coprocessor Stepping ID : 2
PCIe Width : Insufficient Privileges
PCIe Speed : Insufficient Privileges
PCIe Max payload size : Insufficient Privileges
PCIe Max read req size : Insufficient Privileges
Coprocessor Model : 0x01
Coprocessor Model Ext : 0x00
Coprocessor Type : 0x00
Coprocessor Family : 0x0b
Coprocessor Family Ext : 0x00
Coprocessor Stepping : C0
Board SKU : C0PRQ-3120/3140 P/A
ECC Mode : Enabled
SMC HW Revision : Product 300W Active CS
Cores
Total No of Active Cores : 57
Voltage : 0 uV
Frequency : 1100000 kHz
Thermal
Fan Speed Control : On
Fan RPM : 1200
Fan PWM : 20
Die Temp : 45 C
GDDR
GDDR Vendor : Elpida
GDDR Version : 0x1
GDDR Density : 2048 Mb
GDDR Size : 5952 MB
GDDR Technology : GDDR5
GDDR Speed : 5.000000 GT/s
GDDR Frequency : 2500000 kHz
GDDR Voltage : 1501000 uV
1 回答
你可能想看看https://software.intel.com/en-us/articles/opencl-runtime-release-notes . 它比Cicada指向的页面更新,并提供了英特尔®OpenCL™Runtime 14.2的链接 .
libmic_device.so包含在OpenCL运行时中,默认情况下位于/ opt / intel / opencl / lib64中 . 您需要确保路径位于LD_LIBRARY_PATH环境变量中 . 您还需要确保/ opt / intel / opencl / mic在您的MIC_LD_LIBRARY_PATH环境变量中 .
您已经安装了英特尔MPSS;否则micinfo将无法正常工作 . libcoi_host.so包含在MPSS中,并安装在/ usr / lib64中,该文件已在您的库搜索路径中 .
您运行的MPSS版本是3.2-1 . 发行说明网页上的OpenCL运行时14.1的"What's new"注释表明版本14.1在MPSS 3.2-1下不稳定 . 我试图找出是否有一个不同版本的运行时,你可以使用更稳定的MPSS 3.2-1,或者唯一的建议是安装更新的MPSS . 您可以在https://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss找到最新的MPSS版本 .