vlfeat / matconvnet

MatConvNet: CNNs for MATLAB
Other
1.4k stars 753 forks source link

Error compiling Matconvnet with GPU enabled on Windows 10 VS 2017 #1157

Closed pswarup closed 6 years ago

pswarup commented 6 years ago

Hi,

I get the following error when compiling matconvnet with VS2017 with VS2015 build tools installed. Its seems its calling nvcc with a wrong --compiler-bindir argument as "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\bin" doesn't exist. How can I change this behavior?

MEX configured to use 'Microsoft Visual C++ 2017' for C++ language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
     variables with more than 2^32-1 elements. In the near future
     you will be required to update your code to utilize the
     new API. You can find more information about this at:
     http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
Warning: Function labindex has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict. 
> In path (line 109)
  In addpath (line 88)
  In vl_compilenn (line 164)
  In compile_matconvnet (line 3) 
Warning: Function numlabs has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict. 
> In path (line 109)
  In addpath (line 88)
  In vl_compilenn (line 164)
  In compile_matconvnet (line 3) 
Warning: Setting the 'MW_NVCC_PATH' environment variable to 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc' 
> In vl_compilenn>activate_nvcc (line 752)
  In vl_compilenn (line 296)
  In compile_matconvnet (line 3) 
Warning: NVCC not found in the command line path or the one found does not matches 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc'. 
> In vl_compilenn>activate_nvcc (line 761)
  In vl_compilenn (line 296)
  In compile_matconvnet (line 3) 
Location of NVCC (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin) added to your command search PATH.
Failed to run C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/bin (The system cannot find the file specified.  
). 
Error using vl_compilenn>nvcc_compile (line 615)
Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc" -c -o
"C:\Users\swaru\Documents\MATLAB\matconvnet-1.0-beta25\matlab\mex\.build\bits\data.obj"
"C:\Users\swaru\Documents\MATLAB\matconvnet-1.0-beta25\matlab\src\bits\data.cu" -DENABLE_GPU -DENABLE_DOUBLE -O -DNDEBUG -D_FORCE_INLINES --std=c++11 -I"D:\Program
Files\MATLAB\R2016b\extern\include" -I"D:\Program Files\MATLAB\R2016b\toolbox\distcomp\gpu\extern\include" -gencode=arch=compute_61,code=\"sm_61,compute_61\"
--compiler-options=/MD --compiler-bindir="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\bin"  failed.

Error in vl_compilenn (line 487)
      nvcc_compile(opts, srcs{i}, objfile, flags) ;

Error in compile_matconvnet (line 3)
vl_compilenn('enableGpu', true, ...

Thanks, P Swarup

pswarup commented 6 years ago

Not sure this is a good way but I got it to compile by hard coding cl_path = 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin' in vl_compilenn.