微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Nvidia Tesla上的OpenCL:找不到平台

我可以访问安装了两个Nvidia Tesla卡的运行Debian 7的系统。 我想用OpenCL做一些基准testing。 但是,OpenCL无法find任何兼容的平台。 为了与OpenCL一起工作,是否需要额外的库或特殊驱动程序?

以下是示例代码显示没有find任何平台:

#include <stdio.h> #include <stdlib.h> #ifdef __APPLE__ #include <OpenCL/opencl.h> #else #include <CL/cl.h> #endif int main() { int i,j; char* info; size_t infoSize; cl_uint platformCount; cl_platform_id *platforms; const char* attributeNames[5] = { "Name","vendor","Version","Profile","Extensions" }; const cl_platform_info attributeTypes[5] = { CL_PLATFORM_NAME,CL_PLATFORM_vendOR,CL_PLATFORM_VERSION,CL_PLATFORM_PROFILE,CL_PLATFORM_EXTENSIONS }; const int attributeCount = sizeof(attributeNames) / sizeof(char*); // get platform count clGetPlatformIDs(5,NULL,&platformCount); // get all platforms platforms = (cl_platform_id*) malloc(sizeof(cl_platform_id) * platformCount); clGetPlatformIDs(platformCount,platforms,NULL); printf("Platform count: %dn",platformCount); // for each platform print all attributes for (i = 0; i < platformCount; i++) { printf("n %d. Platform n",i+1); for (j = 0; j < attributeCount; j++) { // get platform attribute value size clGetPlatformInfo(platforms[i],attributeTypes[j],&infoSize); info = (char*) malloc(infoSize); // get platform attribute value clGetPlatformInfo(platforms[i],infoSize,info,NULL); printf(" %d.%d %-11s: %sn",i+1,j+1,attributeNames[j],info); free(info); } printf("n"); } free(platforms); return 0; }

和我用来编译代码的命令:

gcc platforms.c -lOpenCL

如果我运行代码输出是:

UTF-8转换为embedded式系统的unicode转换器

用graphics自定义字体样式

C中使用共享内存的IPC

MysqLclient库的联动问题

我如何从我的全局钩子与我的应用程序进行通信?

Platform count: 0

如何将固件文件存储到头文件(.h)

用某种互斥或信号机制保护警报和睡眠

在UWP中播放audio的最简单方法是什么?

简单的animation导致c ++中的闪烁屏幕

C ++中的进程间通信

您可能正面临典型的ICD 32/64位问题。 64位和32位的ICD是完全隔离的,不能使用32位ICD运行64位应用程序,反之亦然。

当找不到ICD或ICD体系结构的平台时, clGetPlatformIDs返回-1001错误代码

Returned by clGetPlatformIDs when no platforms are found CL_PLATFORM_NOT_FOUND_KHR -1001

nVIDIA只为您下载的版本安装平台库,通常为64位,32位OpenCL应用程序不在范围之内。 ICD仍将加载,但不返回任何平台。

用“其他模式”(32/64位)编译你的应用程序,它将工作。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐