【发布时间】:2017-04-01 16:14:59
【问题描述】:
我会提前警告你我的书面英语不好,所以请耐心等待,因为我会犯很多错误。 我需要暴露显卡,以便使用有限元分析的并行算法进行一些基准测试。我在此链接 https://software.intel.com/en-us/intel-opencl 下载了英特尔 sdk。 我使用的是 Ubuntu 16.10,所以我按照这篇文章 https://streamcomputing.eu/blog/2011-06-24/install-opencl-on-debianubuntu-orderly/ 中解释的所有说明进行操作。 当我运行一个简单的算法来检查所有设备时,它只识别 cpu,找不到显卡。相同的程序在 mac 上运行良好(因为 OpenCL 当然在堆栈中)。
// 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
我尝试在视频组中添加当前用户,我还尝试按照软件包随附的说明安装 Intel Media Server Studio,但由于一些编译错误,我无法构建内核。 我也用Ubuntu的自动软件更新更新了所有的驱动,但是还是没有找到GC。
【问题讨论】: