Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

vl_compilenn -DNDEBUG expected a number #1212

Open
ghost opened this issue May 10, 2019 · 6 comments · May be fixed by #1214
Open

vl_compilenn -DNDEBUG expected a number #1212

ghost opened this issue May 10, 2019 · 6 comments · May be fixed by #1214

Comments

@ghost
Copy link

ghost commented May 10, 2019

Hi, I am trying to enable GPU on Windows 10 MATLAB r2019b. I have CUDA 10.1. I get an error shown below. How do I fix it?

Error using vl_compilenn>nvcc_compile (line 617)
Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc" -c -o
"C:\Users\user\Documents\MATLAB\matconvnet-1.0-beta25\matlab\mex.build\bits\data.obj"
"C:\Users\user\Documents\MATLAB\matconvnet-1.0-beta25\matlab\src\bits\data.cu" -DENABLE_GPU -DENABLE_DOUBLE -O -DNDEBUG -D_FORCE_INLINES --std=c++11
-I"C:\Program Files\MATLAB\R2019a\extern\include" -I"C:\Program Files\MATLAB\R2019a\toolbox\distcomp\gpu\extern\include"
-gencode=arch=compute_52,code="sm_52,compute_52" --compiler-options=/MD
--compiler-bindir="C:\ProgramData\MATLAB\SupportPackages\R2019a\3P.instrset\mingw_w64.instrset\VC\bin" failed.

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

@shi-yan
Copy link

shi-yan commented May 17, 2019

the problem here is the -O option.

it needs a number. changing it to -O0 will fix it.

@shi-yan shi-yan linked a pull request May 17, 2019 that will close this issue
@ghost
Copy link
Author

ghost commented May 18, 2019 via email

@loosgagnet
Copy link

@kayrish52 I have the same problem. Did you solve it?

@gkuberreddy
Copy link

Hi, I am trying to enable GPU on Windows 10 MATLAB r2019b. I have CUDA 10.1. I get an error shown below. How do I fix it?

Error using vl_compilenn>nvcc_compile (line 617)
Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc" -c -o
"C:\Users\user\Documents\MATLAB\matconvnet-1.0-beta25\matlab\mex.build\bits\data.obj"
"C:\Users\user\Documents\MATLAB\matconvnet-1.0-beta25\matlab\src\bits\data.cu" -DENABLE_GPU -DENABLE_DOUBLE -O -DNDEBUG -D_FORCE_INLINES --std=c++11
-I"C:\Program Files\MATLAB\R2019a\extern\include" -I"C:\Program Files\MATLAB\R2019a\toolbox\distcomp\gpu\extern\include"
-gencode=arch=compute_52,code="sm_52,compute_52" --compiler-options=/MD
--compiler-bindir="C:\ProgramData\MATLAB\SupportPackages\R2019a\3P.instrset\mingw_w64.instrset\VC\bin" failed.

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

the problem here is the -O option.

it needs a number. changing it to -O0 will fix it.

Hi. May I know which line of code have you changed -O option to number -O0?
Thanks.

@zosel260
Copy link

zosel260 commented Sep 10, 2020

Hello, I have the same problem and I followed shi-yan's comments.
After I changed -O to -O0 from line 340 like:

flags.base{end+1} = '-O0'

I still got an error. I tested 2 different environments.

  1. Env1 : Windows10, Matlab R2017a, Visual studio 2015, Cuda 10.2, cuDNN v.7.65, matconvnet 1.0-beta 25.

Building is progressed for a while, but error happens.

Error using mex
Unknown MEX argument '-O0'.

Error in vl_compilenn>mex_compile (line 584)
mex(args{:}) ;

  1. Env2 : Windows10, Matlab R2019b, Visual studio 2019, Cuda 10.2, cuDNN v.7.65, matconvnet 1.0-beta 25.

The "nvcc fatal : '-DNDEBUG': expected a number " error message disappeared but I got the left error messages


Error using : vl_compilenn>nvcc_compile (line 616)
Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc" -c -o
"D:\lib\matconvnet-1.0-beta25\matconvnet-1.0-beta25\matlab\mex\.build\bits\data.obj"
"D:\lib\matconvnet-1.0-beta25\matconvnet-1.0-beta25\matlab\src\bits\data.cu" -DENABLE_GPU
-DENABLE_DOUBLE -DENABLE_CUDNN -I"local\cudnn\include" -O0 -DNDEBUG -D_FORCE_INLINES --std=c++11
-I"C:\Program Files\MATLAB\R2019b\extern\include" -I"C:\Program
Files\MATLAB\R2019b\toolbox\parallel\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.

I found out the cl.exe path is wrong. I modify cl_path like below:

%cl_path = fileparts(check_clpath()); % check whether cl.exe in path %    %original code
  cl_path ='C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64';  % modify code

Then the same error happens with Env1.

@eduardo4jesus
Copy link

Did you find any solution for this?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants