Skip to content

TanDongXu/CUDA-MCDNN

Repository files navigation

CUDA-MCDNN

Results

CNN accelerated by cuda and lib CUDNN v5

  • The training time is greatly reduced compared to the first version
  1. Test on mnist
  2. Test on cifar-10

Feature

  1. Use cudnn lib to develop CNN
  2. Use Dropout and NetWork In NetWork(NIN) to train the NetWork
  3. Use GoogLeNet Inception(no use CUDNN v5 lib) structure to train NetWork

Compile

Depend on opencv and cuda
You can compile the code on windows or linux.
###SDK include path(-I)

  • linux: /usr/local/cuda/samples/common/inc/ (For include file "helper_cuda"); /usr/local/include/opencv/ (Depend on situation)
  • windows: X:/Program Files (x86) /NVIDIA Corporation/CUDA Samples/v6.5/common/inc (For include file "helper_cuda"); X:/Program Files/opencv/vs2010/install/include (Depend on situation)

###Library search path(-L)

  • linux: /usr/local/lib/
  • windows: X:/Program Files/opencv/vs2010/install/x86/cv10/lib (Depend on situation)

###libraries(-l)

  • cublas
  • curand
  • cudadevrt
  • cudnn

###GPU compute

  • capability 2.0

###CMake for Linux

  1. mkdir build
  2. cd build
  3. cmake ..
  4. make -j16
  5. cd ../mnist/
  6. sh get_mnist.sh
  7. cd ../cifar-10
  8. sh get_cifar10.sh
  9. cd ../
  10. ./build/CUDA-MCDNN

###Windows

  1. Install vs2010.
  2. Download and install cuda-5.0 or other higher versions
  3. When you create a new project using VS2010, You can find NVIDIA-CUDA project template, create a cuda-project.
  4. View-> Property Pages-> Configuration Properties-> CUDA C/C++ -> Device-> Code Generation-> compute_20,sm_20
  5. View-> Property Pages-> Configuration Properties-> CUDA C/C++ -> Common-> Generate Relocatable Device Code-> Yes(-rdc=true)
  6. View-> Property Pages-> Configuration Properties-> Linker-> Input-> Additional Dependencies-> libraries(-l)
  7. View-> Property Pages-> Configuration Properties-> VC++ Directories-> General-> Library search path(-L)
  8. View-> Property Pages-> Configuration Properties-> VC++ Directories-> General-> Include Directories(-I)

###Linux

  1. Install opencv and cuda
  2. Start the nsight from cuda
  3. Create an 'empty cuda' project and import the clone code
  4. Project->Proerties for add-> Build-> Settings->CUDA->Device linker mode: separate compilation
  5. Project->Proerties for add-> Build-> Settings->CUDA->Generate PTX code 2.0
  6. Project->Proerties for add-> Build-> Settings->CUDA->Generate GPU code 2.0
  7. Project->Proerties for add-> Build-> Settings->Tool Settings->NVCC Compiler->includes: +/usr/local/cuda/samples/common/inc/;
  8. Project->Proerties for add-> Build-> Settings->Tool Settings->NVCC Linkers->Libraries: libraries(-l)
  9. Project->Proerties for add-> Build-> Settings->Tool Settings->NVCC Linkers->Libraries search path(-L): /usr/local/lib/

Config

  1. MNIST
  2. CIFAR-10

Informations

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages