我试图让我的OpenCL项目在Ubuntu中编译。我有一个兼容的Core i5和AMD HD 5660。在Ubuntu中设置OpenCL
当我执行下面的代码
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();
}
我得到Error: Getting platforms!
当我执行clinfo
,我得到:terminate called after throwing an instance of 'cl::Error \n what(): clGetPlatformIDs'
我使用AMD的驱动程序14.4和SDK 2.9(它被提及在AMD安装指南中,设置这两个文件将处理icd和环境变量的注册)
我做错了什么,我无法让我的编辑工作?
请注意,我正在使用Eclipse以正确的路径到lib(/opt/AMDAPP/lib/x86_64
)。该程序编译正确。
EDIT
安装步骤
第一安装作为安装指南中建议的x64驱动14.4
我安装
AMD-APP-SDK-v2.9-lnx64.tgz
(解压SDK和比执行sudo ./Install-AMD-APP.sh.
)。验证
AMDAPPSDKROOT 'and
LD_LIBRARY_PATH`是正确的。- 创建符号链接到
/use/lib
/usr/lib64/OpenCL/vendors/amd/libOpenCl.so.1
(因为它是一个64位PC,由于某种原因的OpenCL会在/ lib下的x64驱动程序)
Ubuntu的版本是什么? – osgx
嗨,我使用Ubuntu 13.10和14.04。 ( – user3622675
)您是如何安装amd驱动程序和sdk的?是否有系统(通过ubuntu的apt-get安装)amd驱动程序和sdk? – osgx