在Ubuntu中设置OpenCL [英] Setting up OpenCL in Ubuntu
问题描述
嘿。我试图在Ubuntu中编译我的OpenCL项目。我有Core i5和AMD HD 5660兼容。
当我执行以下代码时
Hey. I trying to get my OpenCL project compile in Ubuntu. I have a Core i5 and AMD HD 5660 which are both compatible.
when I execute the following code
cl_int status;
// Retrieve the number of platforms
cl_uint numPlatforms = 0;
status = clGetPlatformIDs(0, NULL, &numPlatforms);
if (status != CL_SUCCESS)
{
std::cout << "Error: Getting platforms!" << std::endl;
std::cin.get();
}
我得到`错误:获得平台!`
当我执行'clinfo'时,我得到:在抛出'cl :: Error'实例后调用终止
我正在使用AMD驱动程序14.4和SDK 2.9(在AMD安装指南中提到,设置这两个文件将处理icd和环境变量的注册)
我做错了什么我不能让我的编程工作吗?
并不是说我正在使用Eclipse和lib的正确路径(/ opt / AMDAPP / lib / x86_64)。程序编译正确。
I get `Error: Getting platforms!`
When I execute 'clinfo', i get : terminate called after throwing an instance of 'cl::Error'
I am using AMD driver 14.4 and SDK 2.9 (it is mentioned in AMD installation guide, that setting up these two file will handle registration of icd and environmental variables)
What am i doing wrong that i cannot get my prog working?
not that I am using Eclipse with correct path to lib (/opt/AMDAPP/lib/x86_64). the program compiles correctly.
推荐答案
嗨。所以我找到了解决方案。似乎有一个订单根据你应该设置opencl支持。
即使您使用的是英特尔处理器,我们要做的第一件事就是安装AMDAPP SDK 2.9。
比重启PC
运行`clinfo`以确认正在检测CPU。
比GPU,安装AMD 14.4驱动程序包x64。
重新启动并运行`clinfo `确认正在检测GPU。
能够在没有链接的情况下获得标题:
sudo cp -r / opt / AMDAPP / include / * / usr / include /
一些依赖项
sudo apt-get install libglu1-mesa-dev
比在Eclipse中,添加正确的lib位置和-lOpenCL标志
hi. so i found the solution. it seems there is a order according to which u should set up opencl support.
even when u are using intel processor, first thing we have to do is install AMDAPP SDK 2.9.
than restart PC
run `clinfo` to confirm that CPU is being detected.
than for GPU, install the AMD 14.4 driver pack x64.
restart and run `clinfo` to confirm that GPU is being detected.
To be able to get header without linking:
sudo cp -r /opt/AMDAPP/include/* /usr/include/
some dependencies
sudo apt-get install libglu1-mesa-dev
than in Eclipse, add the correct lib location and -lOpenCL flag
这篇关于在Ubuntu中设置OpenCL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!