microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.49k stars 4.3k forks source link

Can build CPUOnly, but MathCuda Batchnormalization.cuh fails with C2912 explicit template specialization #3843

Closed dk-teknologisk-mlnn closed 3 years ago

dk-teknologisk-mlnn commented 3 years ago

Following the guide here : https://docs.microsoft.com/en-us/cognitive-toolkit/setup-cntk-on-windows#building-cntk

I get this error when compiling for GPU:

Error C2912 explicit specialization 'void Microsoft::MSR::CNTK::LoadValues<2,float,float>(const float ,float [])' is not a specialization of a function template MathCUDA c:\users\mlnn\repos\cntk\source\math\CntkBatchNormalization.cuh 49
Error C2912 explicit specialization 'void Microsoft::MSR::CNTK::LoadValues<4,float,float>(const float
,float [])' is not a specialization of a function template MathCUDA c:\users\mlnn\repos\cntk\source\math\CntkBatchNormalization.cuh 59
Error C2912 explicit specialization 'void Microsoft::MSR::CNTK::StoreValues<2,float,float>(const float [],float )' is not a specialization of a function template MathCUDA c:\users\mlnn\repos\cntk\source\math\CntkBatchNormalization.cuh 90
Error C2912 explicit specialization 'void Microsoft::MSR::CNTK::StoreValues<4,float,float>(const float [],float
)' is not a specialization of a function template MathCUDA c:\users\mlnn\repos\cntk\source\math\CntkBatchNormalization.cuh 101 Error MSB3721 The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env -Xcompiler /WX -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX86\x64" -x cu -IC:\Users\mlnn\repos\cntk\Source\Common\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include" -I"c:\local\cub-1.8.0\" -I"C:\local\cudnn-10.0-v7.3.1\cuda\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include" -lineinfo --keep-dir C:\Users\mlnn\repos\cntk\x64.build\Debug\Source\Math\MathCUDA -maxrregcount=0 --machine 64 --compile -cudart static -Xcudafe "--diag_suppress=field_without_dll_interface" -Xcompiler "/wd 4819" -g -use_fast_math -DNO_SYNC -DWIN32 -D_WINDOWS -D_USRDLL -DMATH_EXPORTS -DUSE_CUDNN -D_UNICODE -DUNICODE -D_DEBUG -D"CNTK_VERSION=\"2.7\"" -D"CNTK_VERSION_BANNER=\"2.7+\"" -D"CNTK_COMPONENT_VERSION=\"2.7d\"" -DHAS_MPI=1 -DCUDA_NO_HALF -D__CUDA_NO_HALF_OPERATORS__ -Xcompiler "/EHsc /W4 /nologo /Od /FdC:\Users\mlnn\repos\cntk\x64.build\Debug\Source\Math\MathCUDA\MathCUDA.pdb /FS /Zi /RTC1 /MDd " -o C:\Users\mlnn\repos\cntk\x64.build\Debug\Source\Math\MathCUDA\GPUMatrix.cu.obj "C:\Users\mlnn\repos\cntk\Source\Math\GPUMatrix.cu"" exited with code 2. MathCUDA C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.0.targets 712

dk-teknologisk-mlnn commented 3 years ago

Ok, I had opened vs2017 from anaconda activated prompt. I tried to open normally from start menu and then it finally worked!