Compiling Cuda-convnet based CUDA5 on Visual Studio 2010/2012
2013-12-20 11:56
387 查看
JUL 06, 2013
Cuda-convnet is a High-performance C++/CUDA implementation of convolutional neural networks. Here is the ProjectLink.
Cuda-convnet is built for Linux by default. There is no details description or test about compiling the project on Windows. It is said that's possible but not easy to compile and use this code on Windows.
Here is a solution for Visual Studio 2010 tested on my local windows pc with GeFore GTX690.
Required Software Installed
Before compile Cuda-convnet for Windows, you should make sure you have:Visual Studio 2010/2012
Python2.7 with numpy
CUDA5 SDK
LIBS.zip (This
is a zip file including many dll, lib and head file you may need. such as openBLAS and pthread-x64)
Create VC++ Solution
Download the VS project file here,zipped it; Copy the all cuda-convnet's source code into the zipped project's folder.
Make sure the configuration type is DLL. Property -> Configuration Properties -> General -> Configuration Type select Dynamic
Library(.dll)
Replace
cutil_inline.hwith
helper_cuda.hin
all C++ files
Replace
cutilCheckMsgwith
getLastCudaErrorin
all C++ files
Add
#include <helper_image.h>into include/cudaconv2/conv_util.cuh and include/nvmatrix/nvmatrix.cuh.
This is for MIN and MAX macros.
Modify Line31 in include/common/matrixh as below (add
#define NUMPY_INTERFACE):
#define NUMPYINTERFACE #ifdef NUMPYINTERFACE #include #include #endif
Add
#include <Python.h>into include/neuron.cuh
Add
#define cutGetMaxGflopsDeviceId() gpuGetMaxGflopsDeviceId()into src/convnet.cu
In my solution, I use cblas.h instead of MKL. So OpenBLAS is needed. You can download
and compile it for VS2010/2012 by MinGW manually or Just use the .dll, .lib and .h file in LIBS.zip
Replace the dependency on pthreads with pthreads-win32 or
Just use the .dll, .lib and .h file in LIBS.zip.
Property -> Configuration Properties -> C/C++ -> General -> Additional Include Directories may be similar
with mine:
C:\Python27\Lib\site-packages\numpy\core\include\numpy;C:\Python27\include;D:\v-yabai\LIBS\Pre-built.2\include;D:\v-yabai\LIBS\include;C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\common\inc;D:\v-yabai\DNN\cuda-convnet-vs-proj\include\nvmatrix;D:\v-yabai\DNN\cuda-convnet-vs-proj\include\cudaconv2;D:\v-yabai\DNN\cuda-convnet-vs-proj\include\common;D:\v-yabai\DNN\cuda-convnet-vs-proj\include;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir)
Property -> Configuration Properties ->Linker -> General -> Additional Library Directories may be similar
with mine:
%(AdditionalLibraryDirectories);$(CudaToolkitLibDir)
Property -> Configuration Properties ->Linker -> Input-> Additional Dependencies may be similar with
mine:
C:\Python27\libs\python27.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\x64\cublas.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\x64\cudart.lib;D:\v-yabai\LIBS\libopenblas.lib;D:\v-yabai\LIBS\Pre-built.2\lib\pthreadVSE2.lib;%(AdditionalDependencies)
Add
MS_NO_COREDLLand
Py_NO_ENABLE_SHAREDin Configuration
Properties->C/C++->Preprocessor->Preprocessor Definitions to avoid requiring 'python27_d.lib'
Build for X64 and Enjoy. (TIPS: use Dependency
Walker to find the dlls you need, and puts them into vs2010/2012 build output folder)
Posted by WyvernBai Cuda5 , Cuda-convnet , GPU
Computing , windows
相关文章推荐
- Create custom Task List and Forms in SharePoint 2010 with Visual Studio 2012
- installing-sql-server-2012-error-prior-visual-studio-2010-instances-requiring 转摘
- ArcGIS Engine Controls fail to build using Visual Studio 2010 on a 64-bit OS
- SQL Server 2012不支持Microsoft Visual Studio Test Controller 2010
- VS技巧 使用Visual Studio Icon Patcher将2010的图片注入到2012中
- Build a .NET Application on the Oracle Database with Microsoft Visual Studio 2010
- how to view printf output in win32 app on visual studio 2010?
- Microsoft Visual Studio 2003 2005 2008 2010 2012 下载
- 串口通信IN C++(适用于Microsoft Visual Studio 2010/2012/2013 ,VC++6.0 )
- Visual Studio.net 2010 Windows Service 开发,安装与调试
- Download Microsoft Visual Studio 2010 Ultimate Trial - ISO from Official Microsoft Download Center
- How to write custom static code analysis rules and integrate them into Visual Studio 2010
- Visual Studio 2010初学者的调试指南:Mastering Debugging in Visual Studio 2010 - A Beginner's Guide
- 安装程序打包MFC(visual studio安装部署详解)Install Application Package by using visual studion 2010
- Microsoft Visual Studio 2012 - Product Key
- Step by Step Setup Git Server on Windows with CopSSH + msysGit and Integrate Git with Visual Studio
- Setup and Deployment in Visual Studio 2010
- Step by Step Setup Git Server on Windows with CopSSH + msysGit and Integrate Git with Visual Studio
- 如何在Windows环境下安装OpenCV,并且在Microsoft Visual Studio 2010中使用OpenCV编写应用程序
- Creating SharePoint 2010 Event Receivers in Visual Studio 2010