1,搭建cuda环境
https://blog.csdn.net/luolinll1212/article/details/80752264

2,搭建opencl环境
进入cuda安装目录,/usr/local/cuda-10.2,配置opencl

sudo cp -a /usr/local/cuda-10.2/include/CL /usr/local/include # 配置opencl的include目录
sudu cp -a /usr/local/cuda-10.2/lib64/* /usr/lib #配置opencl的
sudo echo '/usr/local/cuda-10.2/lib64/' >> /etc/ld.so.conf #将cuda lib添加到/etc/ls.so.conf

3,测试
gcc test.c -o test -lOpenCL

#include <stdio.h>
#include <stdlib.h>
#include <alloca.h>#ifdef APPLE
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endifvoid displayPlatformInfo(cl_platform_id id,cl_platform_info param_name,const char* paramNameAsStr) {cl_int error = 0;size_t paramSize = 0;error = clGetPlatformInfo( id, param_name, 0, NULL, &paramSize );char* moreInfo = (char*)alloca( sizeof(char) * paramSize);error = clGetPlatformInfo( id, param_name, paramSize, moreInfo, NULL );if (error != CL_SUCCESS ) {perror("Unable to find any OpenCL platform information");return;}printf("%s: %s\n", paramNameAsStr, moreInfo);
}int main() {/* OpenCL 1.1 data structures */cl_platform_id* platforms;/* OpenCL 1.1 scalar data types */cl_uint numOfPlatforms;cl_int  error;/* Get the number of platforms Remember that for each vendor's SDK installed on the computer,the number of available platform also increased. */error = clGetPlatformIDs(0, NULL, &numOfPlatforms);if(error != CL_SUCCESS) {           perror("Unable to find any OpenCL platforms");exit(1);}// Allocate memory for the number of installed platforms.// alloca(...) occupies some stack space but is automatically freed on returnplatforms = (cl_platform_id*) alloca(sizeof(cl_platform_id) * numOfPlatforms);printf("Number of OpenCL platforms found: %d\n", numOfPlatforms);error = clGetPlatformIDs(numOfPlatforms, platforms, NULL);if(error != CL_SUCCESS) {          perror("Unable to find any OpenCL platforms");exit(1);}// We invoke the API 'clPlatformInfo' twice for each parameter we're trying to extract// and we use the return value to create temporary data structures (on the stack) to store// the returned information on the second invocation.for(cl_uint i = 0; i < numOfPlatforms; ++i) {displayPlatformInfo( platforms[i], CL_PLATFORM_PROFILE, "CL_PLATFORM_PROFILE" );displayPlatformInfo( platforms[i], CL_PLATFORM_VERSION, "CL_PLATFORM_VERSION" );displayPlatformInfo( platforms[i], CL_PLATFORM_NAME,    "CL_PLATFORM_NAME" );displayPlatformInfo( platforms[i], CL_PLATFORM_VENDOR,  "CL_PLATFORM_VENDOR" );displayPlatformInfo( platforms[i], CL_PLATFORM_EXTENSIONS, "CL_PLATFORM_EXTENSIONS" );}return 0;
}

【环境搭建】Ubuntu18.04 nvidia显卡 OpenCL环境搭建相关推荐

  1. ubuntu18.04+nvidia显卡安装+cuda9.0+cudnn7+pycharm2018.2专业版激活+anaconda3+tensorflow-gpu1.6.0+keras+opencv3

    写文的目的:笔记本和台式机的安装是略有不同的,为了以后查阅方便,记录下安装细节 目标:在台式机上安装上ubuntu18.04+nvidia显卡安装+cuda9.0+cudnn7+anaconda3+t ...

  2. 基于30系显卡以及Ubuntu18.04系统的YOLOv3环境搭建和训练模型以及测试

    基于30系显卡以及Ubuntu18.04系统的YOLOv3环境搭建和训练模型以及测试 安装环境 下面是官网对N卡框架以及驱动和cuda版本的部分对应关系 驱动 (可以跳过这段安装,你可以在安装CUDA ...

  3. 在TITAN RTX 2080Ti 上安装 Ubuntu18.04+Nvidia-430显卡驱动+配置深度学习环境(1)

    最近一个项目需要在TITAN RTX 2080Ti 上安装Ubuntu18.04+Nvidia-430显卡驱动+Cuda10.1+Cudnn+7.6+Anaconda3+深度学习环境(tensorfl ...

  4. Ubuntu18.04+Nvidia RTX 3060+Pytorch配置GPU环境

    Ubuntu18.04+Nvidia RTX 3060+Pytorch配置GPU环境 1. 安装GPU显卡驱动 1.1 安装前 1.2 安装过程 1.2.1 打开终端,查看推荐安装的驱动 1.2.2 ...

  5. 深度学习工作站环境搭建 ubantu16.04 安装显卡驱动 CUDA8.0 cuDNN6 anaconda tensorflow1.4.0 opencv3.4 含泪总结

    深度学习工作站环境搭建 ubantu16.04 安装显卡驱动 CUDA8.0 cuDNN6 anaconda tensorflow opencv 1 安装ubantu16.04 安装时不要在线更新,在 ...

  6. Ubuntu18.04 RTX2070 显卡驱动、Cuda、cudnn和Pytorch深度学习环境配置——亲测可用

    这篇博文的主要目的是记录我在Ubuntu18.04下配置深度学习环境的过程,方便自己以后配置的需求,也供大家参考,减少跳坑,虽然我主要是在Ubuntu18.04下实践的,但经过在Ubuntu16.04 ...

  7. Ubuntu18.04深度学习GPU环境配置

    Ubuntu18.04深度学习GPU环境配置 Ubuntu 18.04.cuda 9.0.cuDnn v7.TensorFlow/Keras 与anaconda 1.背景 为了加速神经网络的训练,使用 ...

  8. 爆肝推荐、血泪安装:2080ti显卡安装Ubuntu18.04+nvidia驱动+cuda10.0+cuDNN

    爆肝推荐.血泪安装:2080ti显卡安装Ubuntu18.04+nvidia驱动+cuda10.0+cuDNN 记一次超过三周时间的"血泪"安装经历 版本问题--写在最前,&quo ...

  9. Ubuntu18.04 + NVIDIA Quadro T1000显卡驱动安装

    Ubuntu18.04 + NVIDIA Quadro T1000显卡驱动安装 下载官方驱动安装文件 官网搜索,下载对应版本的run file 禁用Nouveau sudo gedit /etc/mo ...

最新文章

  1. 【FFmpeg】如何通过字符串到对应的封装器,以flv为例
  2. controller不跳转页面的几个原因_光知道SpringBoot,不用thymeleaf就太不对了
  3. 劳力士格林尼治价格_劳力士行情暴跌后回涨,什么时候才是入手的最佳时机?...
  4. 《HTTP 权威指南》笔记:第十四章 安全 HTTP
  5. 关于Linux C multiple definition of‘XXX’的问题
  6. 计算机 游戏第24级,“24点”游戏五级竞赛法
  7. LJL-Solution 清空页面所有值的 (2)
  8. Java==与equals方法的区别
  9. 博途v15程序监视无法使用_博途V15打开应用程序失败,应用程序的并行配置不正确-工业支持中心-西门子中国...
  10. 欢迎使用抖音无水印解析
  11. 图片上传返回淘宝链接
  12. 用biobert标记基因和蛋白质
  13. 鸡易发呼吸道疾病的原因 鸡打喷嚏甩鼻用什么药
  14. 8个有用的表单构建工具,你一定要使用并收藏好
  15. Doctype作用? 严格模式与混杂模式如何区分?它们有何意义?Doctype文档类型?
  16. 我在哪?(寒假每日一题 35)
  17. arm-linux东东之nand之2:3c2440_nand_probe
  18. NOJ——1624死胡同(胡搞模拟)
  19. python基础(四):元组(Tuple)、字典、字符串、序列
  20. 关于计算机英语翻译,计算机的英文翻译是什么

热门文章

  1. pip install av 无法安装
  2. C++ sprintf 方法使用示例( for循环数组,字符串拼接、删除、格式化等)
  3. python编程认证找工作时有什么作用?
  4. danlock锁_微信指纹密码锁下载最新版-微信指纹密码(Applock指纹)锁手机版app下载v2.51-单游网...
  5. 12月给自己一个逆袭的机会,社科院与杜兰大学金融管理硕士项目期待你的加入
  6. 大话设计模式 第二十三章 命令模式 考羊肉串
  7. SSJ项目给我的感悟
  8. Compose把Text组件玩出新高度
  9. 使用canvas画一个流星动画送给她吧
  10. 加密市场的牛熊周期;NFT 定义的争论