cuda-convnet在Ubuntu12.04+CUDA5.5下的配置
deep learning近年来非常之火,尤其是在IMAGENET上的识别效果更是惊呆了小伙伴,其所用的Hinton的学生编写的cuda-convet代码早已公开,但是一直没有时间去仔细研究,最近趁着清明小假期把这个试了下,首先是安装CUDA5.5,需要安装显卡驱动,cuda toolkit and cuda sdk(samples),折腾半天搞好之后准备工作完毕,但是发现cuda-convnet使用的是CUDA4.0,其中使用了cutil(其中多处使用cutil_inline.h),而cuda5.0开始不再支持cutil:
Prior to CUDA 5.0, CUDA Sample projects referenced a utility lib rary with header and source files called cuti l. This has been removed with the CUDA Samples in CUDA 5.0, and re placed with header files found in CUDA Samples \ v5.0 \ common \ inc helper_cuda.h, helper_cuda_ gl.h, helper_cuda_drvapi.h, helper_functions.h, helper_image.h, helper_math.h, help er_string.h, and helper_timer.h .These files provide utility functions f or CUDA device initialization, CUDA error checking, string parsing, imag e file loading and saving, and timing functions. The CUDA Samples proj ects no longer have references and dependencies to cutil, and will now use these helper functions going forward.
导致编译通不过。
解决方案:(参考:http://www.asiteof.me/archives/50和http://blog.csdn.net/xuanwu_yan/article/details/12784691,后者更为简便)
在包含目录下新建cutil_inline.h:
/*
Dummy Includes for cutil_inline.h
*/
#include <helper_cuda.h> #define cutilCheckMsg(a) getLastCudaError(a)
#define cutGetMaxGflopsDeviceId() gpuGetMaxGflopsDeviceId() #define MIN(a,b) (a) < (b) ? (a) : (b)
利用cuda5.5SDK中helper_cuda.h的函数代替原来cutil函数即可
此外,makefile中需要包含cuda5.5 SDK目录:
将build.sh中的CUDA_SDK_PATH改为相应的安装目录
export CUDA_SDK_PATH=/home/leon/NVIDIA_CUDA-5.5_Samples/common/inc
再将:INCLUDES := -I$(PYTHON_INCLUDE_PATH) -I$(NUMPY_INCLUDE_PATH) -I./include -I./include/common -I./include/cudaconv2 -I./include/nvmatrix
改为:INCLUDES := -I$(PYTHON_INCLUDE_PATH) -I$(NUMPY_INCLUDE_PATH) -I$(CUDA_SDK_PATH) -I./include -I./include/common -I./include/cudaconv2 -I./include/nvmatrix
最后,使用helper_cuda.h后不再需要cutil的动态链接库,所以直接把common-gcc-cuda-4.0.mk文件中的相应行注释掉即可:
#LIB += -lcutil_$(LIB_ARCH)$(LIBSUFFIX) -lshrutil_$(LIB_ARCH)$(LIBSUFFIX)
sh build.sh
在/bin/linux/release目录下生成_convnet.so文件即表示编译成功!congratulations and enjoy your cuda-convnet/deep learning journey!
cuda-convnet在Ubuntu12.04+CUDA5.5下的配置的更多相关文章
- Ubuntu12.04 cuda5.5安装
预处理步骤: 首先确认你的电脑装了一个可以运行CUDA程序的GPU. lspci | grep -i nvidia 另外要确认linux版本和gcc版本 具体参考链接:http://docs.nvid ...
- ubuntu12.04 U盘自动挂载配置
Ubuntu12.04禁止U盘等设备的自动挂载方法如下: 在图形界面(字符界面无效)内进入系统终端,ctrl+alt+T或者gnome-terminal 禁止自动挂载:$ gsettings seto ...
- Ubuntu12.04下Qt连接MySQL数据库
本文介绍在Ubuntu12.04 (64 bit) 下使用Qt 4.8.2连接MySQL(Ver 14.14 Distrib 5.5.43)数据库. 1.安装 Qt 和 MySQL 若未安装以上软件, ...
- Linux Ubuntu12.04下安装OpenCv2.4.10
参考 http://blog.sina.com.cn/s/blog_53b0956801010lfu.html 捣鼓了一个晚上了,OpenCv还没装好,本来以为看个类似的比如Ubuntu安装OpenC ...
- Linux (Ubuntu12.04) 下开发工具安装和使用
Linux (Ubuntu12.04) 下开发工具安装和使用 这里讲述的是关于在ubuntu12.04下面安装和使用各种IDE 开发环境和初步使用的知识.说一下背景:很多的开发基本都是在linux操作 ...
- ubuntu12.04下安卓编译环境搭建总结
前言: 因为工作需要,经常要编译安卓下的动态库,公司有已经搭建好环境的服务器,但是第一自己想自己搭建一下了解一个整个过程,另外,公司的服务器也经常出现问 题,导致编译不了,所以就想自己搭建环 ...
- 阿里云ubuntu12.04下安装使用mongodb
阿里云ubuntu12.04下安装mongodb apt-get install mongodb 阿里云ubuntu12.04下卸载mongodb,同时删除配置文件 apt-get pur ...
- ubuntu-12.04.1-desktop-x64下JDK环境的安装与配置
1.上oracle官网下载最新的JDK.在这里,我的系统是ubuntu-12.04.1-desktop-amd64,目前位置JDK的最新版本位7u9.jdk-for-linux有两种安装包,一种是rp ...
- Ubuntu12.04下arm交叉编译环境的建立
http://blog.csdn.net/heyangya2009/article/details/5424376 备注:ubuntu12.04+Android+Real6410 在主机上用来编译其他 ...
随机推荐
- 2019acm山东省赛C题
传送门:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4115 昨天赛场上只想到了一种情况:最远点一定是在最后一次循环中产生 ...
- What are all the possible values for HTTP “Content-Type” header?
What are all the possible values for HTTP “Content-Type” header? You can find every content type her ...
- 前端 MV*框架的意义
早期前端都是比较简单,基本以页面为工作单元,内容以浏览型为主,也偶尔有简单的表单操作,基本不太需要框架. 随着 AJAX 的出现,Web2.0的兴起,人们可以在页面上可以做比较复杂的事情了,然后前端框 ...
- I.MX6 dts 在哪里、怎么编译【转】
本文转载自:https://blog.csdn.net/wangliang888888/article/details/78349224 一.参考文档: 1. [i.MX] 修改了dts之后,如何重新 ...
- 浏览器cookie数 跨站请求伪造 欧盟Cookie指令
<?php for ($w=0; $w < 200 ; $w++) { setcookie('name'.$w,'value'.$w, time()+3600*10 ); } var_du ...
- Hystrix原理与实战(转)
背景 分布式系统环境下,服务间类似依赖非常常见,一个业务调用通常依赖多个基础服务.如下图,对于同步调用,当库存服务不可用时,商品服务请求线程被阻塞,当有大批量请求调用库存服务时,最终可能导致整个商品服 ...
- ubuntu上安装python的ldap模块
首先安装 apt-get install libldap2-dev 然后再安装 apt-get install libsasl2-dev 然后就可以继续安装你的python-ldap模块了 pip i ...
- imageButton和zoomButton
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...
- 【Linux】宝塔上 GitLab数据迁移修改配置后nginx无法启动
背景: 服务器A 向 服务器B 迁移数据,修改配置重启.发现gitlab的 nginx 无法启动. 查找原因 gitlab-ctl tail 错误信息: 网上查了查,似乎是宝塔的问题, 原因应该是为了 ...
- 【PHP】图片转换为base64,经过post传输后‘+’会变成 ‘空格’
图片转换为base64,经过post传输后‘+’会变成 ‘空格’, 需要用PHP 处理一下 $str= $_POST['img_data']; $str= str_replace(' ','+',$s ...