我会提前警告你我写的英文不好,请耐心等待,因为我会犯很多错误。 我需要揭示图形卡,以便在有限元分析中使用并行算法进行一些基准测试。我在这个链接https://software.intel.com/en-us/intel-opencl下载了intel sdk。 我使用的是Ubuntu 16.10,所以我按照这篇文章https://streamcomputing.eu/blog/2011-06-24/install-opencl-on-debianubuntu-orderly/的说明执行了所有的指令。 当我运行一个简单的算法来检查所有的设备,它只识别CPU,无法找到图形卡。同一个程序在Mac上运行良好(因为OpenCL当然是在堆栈中)。OpenCL找不到英特尔HD 4000
// includes...
int main(int argc, const char * argv[])
{
// See what standard OpenCL sees
std::vector<cl::Platform> platforms;
// Get platform
cl::Platform::get(&platforms);
// Temp
std::string s;
// Where the GPU lies
cl::Device gpudevice;
// Found a GPU
bool gpufound = false;
std::cout << "**** OPENCL ****" << std::endl;
// See if we have a GPU
for (auto p : platforms)
{
std::vector<cl::Device> devices;
p.getDevices(CL_DEVICE_TYPE_ALL, &devices);
for (auto d : devices)
{
std::size_t i = 4;
d.getInfo(CL_DEVICE_TYPE, &i);
std::cout << "> Device type " <<
(i & CL_DEVICE_TYPE_CPU ? "CPU" : "") <<
(i & CL_DEVICE_TYPE_GPU ? "GPU" : "") <<
(i & CL_DEVICE_TYPE_ACCELERATOR ? "ACCELERATOR" : "");
if (i & CL_DEVICE_TYPE_GPU)
{
gpudevice = d;
gpufound = true;
}
std::cout << " Version " << s << std::endl;
}
}
if (!gpufound)
{
std::cout << "NO GPU FOUND. ABORTING." << std::endl;
return 1;
}
// Do other things...
输出为:
/home/andrea/Dropbox/fem/SiNDy/clfem/cmake-build-debug/vector_sycl
**** OPENCL ****
> Device type CPU Version
NO GPU FOUND. ABORTING.
Process finished with exit code 1
我尝试添加当前用户的视频组中,我也尝试安装英特尔媒体服务器工作室在与包来的指示,但我做不到由于某些编译错误而构建内核。 我还使用Ubuntu的自动软件更新更新了所有驱动程序,但仍未找到GC。