日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

cuda-convnet在Ubuntu12.04+CUDA5.5下的配置

發布時間:2023/12/18 Ubuntu 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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!

轉載于:https://www.cnblogs.com/cslxiao/p/3649844.html

總結

以上是生活随笔為你收集整理的cuda-convnet在Ubuntu12.04+CUDA5.5下的配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。