Windows Ten Bits
Matlab 2015b/2016a
Matconvnet 1.0-beta20 or download git from github repository
CUDA GPU Computing ToolKit 7.5
Cudnn-rc4/cudnn-rc5
All according to official website http://www.vlfeat.org/matconvnet/
After the configuration is done,
Compile command
Vl_compilenn (' Enablegpu ', true, ... ') Cudaroot ', ' C:\Program files\nvidia GPU Computing toolkit\cuda\v7.5 ',... ' Cudamethod ', ' NVCC ', ... ' Enablecudnn ', True, ... ' Cudnnroot ', ' LOCAL\CUDNN-RC4 ',... ' Verbose ', ' 2 ',... ' Debug ', ' 1 ');
Two main issues encountered
1. Can't find ' cudnn.h ', this is the cudnnroot path configuration problem, the official website means to create a new local folder under Matconvnet directory, and then put CUDNN into the local folder, open local\ CUDNN-RC4 should see three folders Include,bin,lib, compile at the Matconvnet directory, the first input addpath matlab to join the Matlab file path. Hint, the direct NVIDIA official website download CUDNN After decompression should be more than a level of intermediate directory Cuda, such as Cudnn\cuda\, at compile time can be cudnn path written "Local\cudnn-rc4\cuda", or manually reduce the intermediate directory
2. Error compiling Vl_compilenn
Original code
If Opts.enablecudnn flags.cc{end+1} = '-denable_cudnn '; flags.cc{end+1} = ['-i ' opts.cudnnincludedir]; end
File path error, in error message-I followed by Cudnnicludedir path without double quotes
After the change, a very blind at first, read the MathWorks on the answer to take serious look at the error message, careful should be able to find the problem
If Opts.enablecudnn flags.cc{end+1} = '-denable_cudnn '; flags.cc{end+1} = ['-i ' ' opts.cudnnincludedir ' "'];%http://cn.mathworks.com/matlabcentral/answers/264961- Having-problem-in-matconvnet-to-compiling-the-cudnn-support "Opts.cudnnincludedir" end
The latest version on GitHub has fixed this issue
3.NVCC compile matconvnet\matlab\src\bits\impl\nnbilinearsampler_cudnn.cu Error in 250 rows or so undefined "backward" identifier
Because in
Template<typename type, bool backwarddata, BOOL Backwardgrid>static Vl::errorforward_backward
The definition of backward is missing from the function and is modeled after the previous
Template<typename type>__global__ void Grid_backward_kernel
function is added at the beginning of the function
BOOL backward = backwarddata;//added here for Cudnn compile with undefined ' backward ' identifier
found that backward or backwarddata is just a bool type value as an option
4. Error compiling MATCONVNET\MATLAB\SRC\BITS\IMPL\NNBILINEARSAMPLER_CUDNN.CU, line 24th
#warning "Bilinearsampler_cudnn.cu'll be disabled as it requires CUDNN v5 or higher."
Invalid precompiled directive "warning"
Originally, there are #warning instructions in gcc,c#, MSVC c\c++ No #warning instructions, you can use the #pragma message "warning ..." instead
MATLAB compilation matconvnet on Windows