Closed mrgloom closed 9 years ago
but still get another error
run('G:\Matlab\ConvNet-master\cnnexamples.m') gpu Epoch: 1 Error using cnntrain_mex Assertion Failed: CUDA function call failed![30] G:/Matlab/ConvNet-master/c++/cuda/sources/mat_gpu.cu:180
Error in cnntrain (line 10) [weights, trainerr] = cnntrain_mex(layers, weights_in, params, train_x, train_y);
Error in cnnexamples (line 77) [weights, trainerr] = cnntrain(layers, weights, params, train_x, train_y, funtype);
Error in run (line 63) evalin('caller', [script ';']);
1) The error that you get are due to the old version of visual studio, that does not have implementations for sqrt(float), as it is supposed to be according to the c++ standard. I did not remove other type conversion warnings, I'll do it later.
2) This is the error of texture creation. I guess it might happen because of problems with compute capability or something. Try to recompile the code with the CC of your GPU card. You can specify it in mex_CUDA_win64.xml.
Tried to replace COMPFLAGS line to COMPFLAGS="-gencode arch=compute_20,code=sm_21 --compiler-options=/c,/GR,/W3,/EHs,/nologo,/MD"
also tried COMPFLAGS="-arch compute_20 --compiler-options=/c,/GR,/W3,/EHs,/nologo,/MD"
and
COMPFLAGS="--compiler-options=/c,/GR,/W3,/EHs,/nologo,/MD"
same result compiles ok, but fails at run and give same error.
I'm using gtx 460
gpuDevice()
ans =
CUDADevice with properties:
Name: 'GeForce GTX 460'
Index: 1
ComputeCapability: '2.1'
SupportsDouble: 1
DriverVersion: 6.5000
ToolkitVersion: 5.5000
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [65535 65535 65535]
SIMDWidth: 32
TotalMemory: 1.0737e+09
FreeMemory: NaN
MultiprocessorCount: 7
ClockRateKHz: 1451000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 0
Probably the reason is described here: "The texture object API is only supported on devices of compute capability 3.0 or higher". However, texture usage is not obligative. You can go through the code, find the usage of function "getTextureObject" and remove the blocks where it is used. It should make the code slower, but at least it will work. I would update the code, but I don't currently have time for that.
also find this
Note: A Kepler-generation GPU with shader model capability 3.5 or greater is required to run this code. This includes the chips GK110 and GK114, which can be found on the GPUs Tesla K20, Tesla K20x, Tesla K40, GeForce Titan, and GeForce GTX 780, among others. Older GPUs, including GK104-based GPUs such as the Tesla K10 and GeForce 680, won't work.
I'm using VS2010, win7 x64,CUDA SDK 6.5 .
I change version of Windows SDK to 7.0A in mex_CUDA_win64.xml и vcvars64.bat
because of error :
Error in compile (line 115) mex(mexfile, ['"' cudafiles '"'], ['"' cppfiles '"'], ...
and I get error in filter_acts.cu
Error using mex filter_acts.cu
G:/Matlab/ConvNet-master/c++/cuda/sources/filter_acts.cu(1201): error: more than one instance of overloaded function "sqrt" matches the argument list: function "sqrt(double)" function "sqrt(float)" function "sqrt(long double)" argument types are: (int) 1 error detected in the compilation of "C:/Users/user/AppData/Local/Temp/tmpxft_00000f28_00000000-11_filter_acts.compute_30.cpp1.ii".
Error in compile (line 115) mex(mexfile, ['"' cudafiles '"'], ['"' cppfiles '"'], ...
I changed line 1201 int filterSize = (int) sqrt(filterPixels); to int filterSize = (int) sqrt((double)filterPixels);
same in img_acts.cu and weight_acts.cu. and there are lot's of warnings about type conversion.