vlfeat / matconvnet

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

Error in compiling with GPU options #77

Closed itaykez closed 8 years ago

itaykez commented 9 years ago

I work on windows 64 bit with matlab 2014b, and cuda toolkit 6.5. I can compile the CPU version while the GPU version fails to compile: Error using vl_compilenn>mex_compile (line 376) No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2014b/win64.html.

This is weird due to the fact I have a compiler and succeeded in compiling other things.

felixachilles commented 9 years ago

I have the same configuration and had to alter two things: 1) In vl_compilenn.m, I changed line 312 to

case 'win64' flags.nvcc{end+1} = '/MD' ; flags.nvcc{end+1} = '-ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64" ' ; % check_clpath(); % check whether cl.exe in path

2) I called the compile-script like this (cudnn libraries need to be in .\matconvnet\local for this):

vl_compilenn('enableGpu', true, ... 'cudaMethod', 'nvcc', ... 'enableCudnn', 'true')

Does it work for you as well? Cheers, Felix

2015-02-25 13:54 GMT+01:00 itaykez notifications@github.com:

I work on windows 64 bit with matlab 2014b, and cuda toolkit 6.5. I can compile the CPU version while the GPU version fails to compile: Error using vl_compilenn>mex_compile (line 376) No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2014b/win64.html.

This is weird due to the fact I have a compiler and succeeded in compiling other things.

— Reply to this email directly or view it on GitHub https://github.com/vlfeat/matconvnet/issues/77.



_Technische Universität München_Felix Achilles, M.Sc.* · Faculty of Informatics · Chair for Computer Aided Medical Procedures Boltzmannstr. 3 · *85748 Garching b. München · +49 (0)176 623 18 312

achilles@in.tum.de · campar.in.tum.de


itaykez commented 9 years ago

Hi Felix,

Thanks for the help, The version exists now is different, but I understood the flavour of your answer. Thanks, now it works!

nmayorov commented 9 years ago

Hi. I also had problems compiling with GPU, but somehow managed to do it. Although it crashed at the beginning of compilation, but then continued and completed. I didn't use enableCudnn.

I want to be sure, that GPU mode actually works. I run cnn_mnist.m with opts.train.useGpu = true. The CPU load was 21% and it worked about as fast as with opts.train.useGpu = false when CPU load was 75%.

Does it all mean that this computation was done on GPU but my graphics card is just weak and can't beat 4 cores CPU? My GPU is indeed weak with 2.1 "computation capabilty".

Deeplayer commented 9 years ago

Hi @itaykez, I also had the same problem, could u tell me how to solve this problem? Felix's solutions can't solve my problem. Thx

nmayorov commented 9 years ago

@ZNXu what error messages do you get?

Deeplayer commented 9 years ago

@nmayorov Error using vl_compilenn>mex_compile (line 377) No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2014a/win64.

nmayorov commented 9 years ago

I made the following modifications in vl_compilenn.m line ~338:

flags.nvcc{end+1} = '--cl-version 2010';
flags.nvcc{end+1} = '-ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64"' ;      
flags.nvcc{end+1} = '-I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"';
flags.nvcc{end+1} = '-I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include"';

I also created vcvars64.bat in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64" with the content

CALL setenv /x64

Compile with vl_compilenn('enableGpu', true, 'cudaMethod', 'nvcc'). It kinda worked, but I'm not sure. (See my question above).

itaykez commented 9 years ago

Hi @ZNXu, You have a different problem. You should install a compiler / SDK in order to compile the mex file. Cheers..

Deeplayer commented 9 years ago

But I have installed VS2012, I work on windows 64 bit with Matlab R2014a, and cuda toolkit 6.5. @itaykez

itaykez commented 9 years ago

Do you succeed in compiling a tiny program?

Deeplayer commented 9 years ago

yes

Deeplayer commented 9 years ago

I used a new version of toolbox, and now it works! Thank you for your helps. @itaykez @nmayorov

GeorgeLittwin commented 9 years ago

Hey @ZNXu , i'm having the same problem. can you tell me exactly what you did? thanks

Deeplayer commented 9 years ago

Download this version: https://github.com/vlfeat/matconvnet and then Compile with vl_compilenn('enableGpu', true, 'cudaMethod', 'nvcc'), It will works. PS: my configurations: Windows x64, MATLAB R2014a, VS2012 and CUDA Toolkit 6.5. @etaili

cheer37 commented 8 years ago

I had the same problem. I could run vl_compilenn for cpu, but i couldn't run the vl_compilenn('enableGpu', true) for gpu. It complains below.

Error using mex C:\Program Files\MATLAB\MATLAB Production Server\R2015a\toolbox\distcomp\gpu\extern\src\mex\win64\mex_CUDA_win64.xml is not a valid XML file.

Error in vl_compilenn>mex_compile (line 438) mex(mopts{:}) ; Error in vl_compilenn (line 397) mex_compile(opts, srcs{i}, toobj(bld_dir,srcs{i}), flags.mexcu) ; My environment is cuda7.0 sdk, comput capibility = 5.0, matlab r2015a and windows. Would you help me? Thanks in advance.

iamprem commented 8 years ago

@cheer37 I'm having the same problem as yours. Any solution?

cheer37 commented 8 years ago

I solved the problem using the command for unsupported cuda toolkit version. Please see carefully again on this page. http://www.vlfeat.org/matconvnet/install/ There is a table showing match cases between matlab and cuda toolkit version. if you are not in one of that match cases, you should follow the compile instruction in using an unsupported cuda toolkit version section.

so, just run following command. vl_compilenn('enableGpu', true, ... 'cudaMethod', 'nvcc') Hope this helps you.

iamprem commented 8 years ago

@cheer37 I'm running Matlab R2015a with CUDA toolkit 6.5 as per that table. And i managed to find that 'mex_CUDA_win64.xml' file which was located in a folder in the same path. And then i ran the following command vl_compilenn('enableGpu', true, 'cudaMethod', 'nvcc')

and this resulted this error: nvcc fatal : Unsupported gpu architecture 'compute_21'

mjohn123 commented 8 years ago

Hello, I am having same problem. My problem is that vl_compilenn('enableGpu', true, 'cudaMethod', 'nvcc') Error using vl_compilenn>search_cuda_devkit (line 604) Could not find a valid NVCC executable\n

Error in vl_compilenn (line 251) if isempty(opts.cudaRoot), opts.cudaRoot = search_cuda_devkit(opts) ; end

When I test the GPU version, the system returned

CUDADevice with properties:

                  Name: 'GeForce GTX 750 Ti'
                 Index: 1
     ComputeCapability: '5.0'
        SupportsDouble: 1
         DriverVersion: 7.5000
        ToolkitVersion: 5.5000
    MaxThreadsPerBlock: 1024
      MaxShmemPerBlock: 49152
    MaxThreadBlockSize: [1024 1024 64]
           MaxGridSize: [2.1475e+09 65535 65535]
             SIMDWidth: 32
           TotalMemory: 2.1475e+09
            FreeMemory: 1.7112e+09
   MultiprocessorCount: 5
          ClockRateKHz: 1202000
           ComputeMode: 'Default'
  GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
      CanMapHostMemory: 1
       DeviceSupported: 1
        DeviceSelected: 1

Could you help me to solve it? Thanks in advance

lordofgod commented 8 years ago

I think you may try vl_compilenn('enableGpu', true, ... 'cudaRoot', '/Developer/NVIDIA/CUDA-7.0', ... 'cudaMethod', 'nvcc') replace cudaroot with your own's.

huangjun12 commented 8 years ago

@iamprem I'm running Matlab R2014a with CUDA toolkit 5.5 and I have the same problem as yours, nvcc fatal : Unsupported gpu architecture 'compute_21' I think your solution would be helpful for me~

Leyuanfang commented 8 years ago

@mjohn123 , I have the same problem as you. Could you let me know how do you solve this problem? Thanks

dangkhoasdc commented 7 years ago

@huangjun12 I think you should switch to a newer version of Matlab (2015 or 2016). I've installed matconvnet with gpu support on Matlab R2014 but it has not success. Instead, I install R2016 and it works.

The problem is that the old Matlab (ex. Matlab 2014) only support cuda 5.0 and it isn't compatible with cuda 7.0. Even you configure exactly, after that it will occurs errors from the compatibility of cuda of Matconvnet and matlab.

@Leyuanfang you might add cudaRoot to your Cuda path vl_compilenn.

huangjun12 commented 7 years ago

@dangkhoasdc Thank you for your solution! And I have mexed it by changing my GPUcard from GTX560 to GTX760 ,thanks anyway~