MouseLand / Kilosort

Fast spike sorting with drift correction
https://kilosort.readthedocs.io/en/latest/
GNU General Public License v3.0
491 stars 247 forks source link

Compiling problem #8

Closed RobertoDF closed 5 years ago

RobertoDF commented 5 years ago

Hi,

Really looking forward to try this improved version, I wonder if someone can help with the following error message that I get when I compile using mexGPUall while being in the CUDA folder. Everything goes smooth when compiling Kilosort1 on the same PC. I use Matlab 2018a.

Error using mex
fatbinary fatal   : '96_device.compute_35.cubin' is not in 'keyword=value' format
mexMPnu8.obj
c_mexapi_version.obj

Error in mexcuda (line 157)
    [varargout{1:nargout}] = mex(mexArguments{:});

Error in mexGPUall (line 5)
    mexcuda -largeArrayDims -dynamic mexMPnu8.cu

Thanks!

marius10p commented 5 years ago

Thanks for reporting this error. What is your GPU and CUDA version?

RobertoDF commented 5 years ago

GPU Quadro M2000 and CUDA 9.0.176. After some research I understood that the problem resides in this line of mexGPUall. mexcuda -largeArrayDims -dynamic mexMPnu8.cu

the rest is compiled without problems.

RobertoDF commented 5 years ago

Update: I get the same error in another machine with GPU TITAN Xp, CUDA 9.0 and Matlab 2018a

marius10p commented 5 years ago

What OS are you on and what's the C compiler? Run mex -setup to find out the C compiler.

RobertoDF commented 5 years ago

Both PC Microsoft Visual C++ 2013 (C), first one windows 7 second one windows 10.

MEX configured to use 'Microsoft Visual C++ 2013 (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
     variables with more than 2^32-1 elements. You will be required
     to update your code to utilize the new API.
     You can find more information about this at:
     https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.

To choose a different language, select one from the following:
 mex -setup C++ 
 mex -setup FORTRAN
marius10p commented 5 years ago

Can you please run with the -v flag, and give us the full output?

mexcuda -v -largeArrayDims -dynamic mexMPUnu8.cu

RobertoDF commented 5 years ago

Here it is

>> mexcuda -v -largeArrayDims -dynamic mexMPnu8.cu
Trying MEX options 'C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2013_dynamic.xml'...SUCCESS
mex -largeArrayDims -f C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2013_dynamic.xml NVCC_FLAGS="" -v -largeArrayDims mexMPnu8.cu 
Verbose mode is on.
... Looking for compiler 'NVIDIA CUDA Compiler' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\').
... Looking for environment variable 'VS120COMNTOOLS' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes.
... Looking for environment variable 'MW_NVCC_PATH' ...No.
... Looking for environment variable 'CUDA_LIB_PATH' ...No.
... Looking for environment variable 'CUDA_PATH' ...No.
... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64\cudart.lib' ...Yes.
... Looking for folder 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64' ...Yes.
... Looking for environment variable 'MW_NVCC_PATH' ...No.
... Looking for environment variable 'CUDA_BIN_PATH' ...No.
... Looking for environment variable 'CUDA_PATH' ...No.
... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe' ...Yes.
... Executing command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc --version | findstr /c:"release 9.0" > NUL && echo C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin' ...No.
... Looking for environment variable 'MW_NVCC_PATH' ...No.
... Looking for environment variable 'CUDA_BIN_PATH' ...No.
... Looking for environment variable 'CUDA_PATH' ...No.
... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe' ...Yes.
... Executing command '"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc" --version | findstr /c:"release 9.0" > NUL && echo C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin' ...Yes ('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin').
... Executing command 'echo %TMP%\mex_%RANDOM%_%TIME:~6,5%_device.obj' ...Yes ('C:\Users\Roberto\AppData\Local\Temp\mex_4933_00,09_device.obj').
Found installed compiler 'NVIDIA CUDA Compiler'.
Set PATH = \C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Bin\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\..\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\..\Common7\Tools;C:\Program Files (x86)\Windows Kits\8.1\\Bin\x64;C:\Program Files (x86)\Windows Kits\8.1\\Bin\x86;;;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MATLAB\R2018b\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\OpenVPN\bin;C:\Program Files\MATLAB\R2018a\runtime\win64;C:\Program Files\MATLAB\R2018a\bin;C:\Users\Roberto\Miniconda3\pkgs\python-3.7.0-hea74fb7_0;C:\Users\Roberto\AppData\Local\Microsoft\WindowsApps;C:\Users\Roberto\Miniconda3\pkgs\python-3.7.0-hea74fb7_0\;C:\Users\Roberto\AppData\Local\GitHubDesktop\bin;C:\Users\Roberto\Miniconda3\Scripts;
Set INCLUDE = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\\include\shared;C:\Program Files (x86)\Windows Kits\8.1\\include\um;C:\Program Files (x86)\Windows Kits\8.1\\include\winrt;C:\Program Files\MATLAB\R2018a\extern\include;C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\include;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\\include\shared;C:\Program Files (x86)\Windows Kits\8.1\\include\um;C:\Program Files (x86)\Windows Kits\8.1\\include\winrt;C:\Program Files\MATLAB\R2018a\extern\include;C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\include;
Set LIB = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\8.1\\lib\winv6.3\um\x64;C:\Program Files\MATLAB\R2018a\lib\win64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\8.1\\lib\winv6.3\um\x64;C:\Program Files\MATLAB\R2018a\lib\win64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64;
Set LIBPATH = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64;
Options file details
-------------------------------------------------------------------
    Compiler location: $NVCC
    Options file: C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2013_dynamic.xml
    CMDLINE150 : nvcc -dlink --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\"  --compiler-options=/O2,/Oy-,/DNDEBUG C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\mexMPnu8.obj C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\c_mexapi_version.obj  -lcudadevrt -o C:\Users\Roberto\AppData\Local\Temp\mex_4933_00,09_device.obj && echo /out: > NUL
    CMDLINE200 : link /nologo /manifest  /DLL  /EXPORT:mexFunction /EXPORT:mexfilerequiredapiversion C:\Users\Roberto\AppData\Local\Temp\mex_4933_00,09_device.obj C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\mexMPnu8.obj C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\c_mexapi_version.obj  /LIBPATH:"C:\Program Files\MATLAB\R2018a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib cudadevrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libMatlabDataArray.lib libMatlabEngine.lib /out:mexMPnu8.mexw64
    CMDLINE250 : mt -outputresource:mexMPnu8.mexw64;2 -manifest "mexMPnu8.mexw64.manifest"
    CMDLINE300 : del "mexMPnu8.exp" "mexMPnu8.lib" "mexMPnu8.mexw64.manifest" "mexMPnu8.ilk" C:\Users\Roberto\AppData\Local\Temp\mex_4933_00,09_device.obj
    COMPILER : nvcc
    COMPFLAGS : --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" 
    ARCHFLAGS : -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" 
    COMPDEFINES : --compiler-options=/DMX_COMPAT_64  --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b  --compiler-options=/DUSE_MEX_CMD   --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE
    MATLABMEX : /DMATLAB_MEX_FILE
    OPTIMFLAGS : --compiler-options=/O2,/Oy-,/DNDEBUG
    INCLUDE : -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include"
    DEBUGFLAGS : --compiler-options=/Z7
    LINKER : link
    LINKFLAGS : /nologo /manifest 
    LINKTYPE : /DLL
    LINKEXPORT : /EXPORT:mexFunction
    LINKEXPORTVER : /EXPORT:mexFunction /EXPORT:mexfilerequiredapiversion
    LINKLIBS : /LIBPATH:"C:\Program Files\MATLAB\R2018a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib cudadevrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libMatlabDataArray.lib libMatlabEngine.lib
    LINKDEBUGFLAGS : /debug /PDB:"mexMPnu8.mexw64.pdb"
    LINKOPTIMFLAGS : 
    OBJEXT : .obj
    LDEXT : .mexw64
    SETENV : set COMPILER=nvcc
                set COMPFLAGS=/c --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\"  --compiler-options=/DMX_COMPAT_64  --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b  --compiler-options=/DUSE_MEX_CMD   --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE /DMATLAB_MEX_FILE
                set OPTIMFLAGS=--compiler-options=/O2,/Oy-,/DNDEBUG
                set DEBUGFLAGS=--compiler-options=/Z7
                set LINKER=link
                set LINKFLAGS=/nologo /manifest  /export:%ENTRYPOINT% /DLL /LIBPATH:"C:\Program Files\MATLAB\R2018a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib cudadevrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libMatlabDataArray.lib libMatlabEngine.lib /EXPORT:mexFunction
                set LINKDEBUGFLAGS=/debug /PDB:"%OUTDIR%%MEX_NAME%.mexw64.pdb"
                set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%"
    VCROOT : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
    SDKROOT : C:\Program Files (x86)\Windows Kits\8.1\
    VSINSTALLDIR : C:\Program Files (x86)\Microsoft Visual Studio 12.0\
    VCINSTALLDIR : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\
    PROF_ENV : C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
    VCVARSALLDIR : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
    CUDA_LIB_PATH : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64
    CUDA_BIN_PATH : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
    DEVOBJ : C:\Users\Roberto\AppData\Local\Temp\mex_4933_00,09_device.obj
    MATLABROOT : C:\Program Files\MATLAB\R2018a
    ARCH : win64
    SRC : "C:\Users\Roberto\Documents\GitHub\MATLAB_analysis\functions\Kilosort2\CUDA\mexMPnu8.cu";"C:\Program Files\MATLAB\R2018a\extern\version\c_mexapi_version.c"
    OBJ : C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\mexMPnu8.obj;C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\c_mexapi_version.obj
    OBJS : C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\mexMPnu8.obj C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\c_mexapi_version.obj 
    SRCROOT : C:\Users\Roberto\Documents\GitHub\MATLAB_analysis\functions\Kilosort2\CUDA\mexMPnu8
    DEF : C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\mexMPnu8.def
    EXP : "mexMPnu8.exp"
    LIB : "mexMPnu8.lib"
    EXE : mexMPnu8.mexw64
    ILK : "mexMPnu8.ilk"
    MANIFEST : "mexMPnu8.mexw64.manifest"
    TEMPNAME : mexMPnu8
    EXEDIR : 
    EXENAME : mexMPnu8
    NVCC_FLAGS : 
    OPTIM : --compiler-options=/O2,/Oy-,/DNDEBUG
    LINKOPTIM : 
    CMDLINE100_0 : nvcc -dc --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\"  --compiler-options=/O2,/Oy-,/DNDEBUG --compiler-options=/DMX_COMPAT_64  --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b  --compiler-options=/DUSE_MEX_CMD   --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "C:\Users\Roberto\Documents\GitHub\MATLAB_analysis\functions\Kilosort2\CUDA\mexMPnu8.cu" -o C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\mexMPnu8.obj && echo /Fo > NUL
    CMDLINE100_1 : nvcc -dc --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\"  --compiler-options=/O2,/Oy-,/DNDEBUG --compiler-options=/DMX_COMPAT_64  --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b  --compiler-options=/DUSE_MEX_CMD   --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "C:\Program Files\MATLAB\R2018a\extern\version\c_mexapi_version.c" -o C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\c_mexapi_version.obj && echo /Fo > NUL
-------------------------------------------------------------------
Building with 'NVIDIA CUDA Compiler'.
nvcc -dc --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\"  --compiler-options=/O2,/Oy-,/DNDEBUG --compiler-options=/DMX_COMPAT_64  --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b  --compiler-options=/DUSE_MEX_CMD   --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "C:\Users\Roberto\Documents\GitHub\MATLAB_analysis\functions\Kilosort2\CUDA\mexMPnu8.cu" -o C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\mexMPnu8.obj && echo /Fo > NUL
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(660): warning: variable "d_mask" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(660): warning: variable "d_mask" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(660): warning: variable "d_mask" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(660): warning: variable "d_mask" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used
C:/Users/Roberto/Documents/GitHub/MATLAB_analysis/functions/Kilosort2/CUDA/mexMPnu8.cu(660): warning: variable "d_mask" was set but never used

mexMPnu8.cu

nvcc -dc --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\"  --compiler-options=/O2,/Oy-,/DNDEBUG --compiler-options=/DMX_COMPAT_64  --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b  --compiler-options=/DUSE_MEX_CMD   --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "C:\Program Files\MATLAB\R2018a\extern\version\c_mexapi_version.c" -o C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\c_mexapi_version.obj && echo /Fo > NUL
c_mexapi_version.c

nvcc -dlink --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\"  --compiler-options=/O2,/Oy-,/DNDEBUG C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\mexMPnu8.obj C:\Users\Roberto\AppData\Local\Temp\mex_329840084042593_12860\c_mexapi_version.obj  -lcudadevrt -o C:\Users\Roberto\AppData\Local\Temp\mex_4933_00,09_device.obj && echo /out: > NUL
Error using mex
fatbinary fatal   : '09_device.compute_35.cubin' is not in 'keyword=value' format
mexMPnu8.obj
c_mexapi_version.obj

Error in mexcuda (line 157)
    [varargout{1:nargout}] = mex(mexArguments{:}
marius10p commented 5 years ago

Thanks, it's actually very similar to mine (see below). Except for this temporary object:

DEVOBJ : C:\Users\Roberto\AppData\Local\Temp\mex_4933_00,09_device.obj

Can you please try to delete that temp object and compile again? There is also a comma in that path, which I think is a guaranteed error. You also don't have an environment variable "CUDA_PATH". I would recommend uninstalling and installing CUDA (make sure it's still 9.0 for this version of Matlab).

mexcuda -v -largeArrayDims -dynamic mexMPnu8.cu Trying MEX options 'C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2013_dynamic.xml'...SUCCESS mex -largeArrayDims -f C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2013_dynamic.xml NVCC_FLAGS="" -v -largeArrayDims mexMPnu8.cu Verbose mode is on. ... Looking for compiler 'NVIDIA CUDA Compiler' ... ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe' ...Yes. ... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes. ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\'). ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\'). ... Looking for environment variable 'VS120COMNTOOLS' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe' ...Yes. ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat' ...Yes. ... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes. ... Looking for environment variable 'MW_NVCC_PATH' ...No. ... Looking for environment variable 'CUDA_LIB_PATH' ...No. ... Looking for environment variable 'CUDA_PATH' ...Yes ('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0'). ... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64\cudart.lib' ...Yes. ... Looking for folder 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64' ...Yes. ... Looking for environment variable 'MW_NVCC_PATH' ...No. ... Looking for environment variable 'CUDA_BIN_PATH' ...No. ... Looking for environment variable 'CUDA_PATH' ...Yes ('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0'). ... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe' ...Yes. ... Executing command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc --version | findstr /c:"release 9.0" > NUL && echo C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin' ...No. ... Looking for environment variable 'MW_NVCC_PATH' ...No. ... Looking for environment variable 'CUDA_BIN_PATH' ...No. ... Looking for environment variable 'CUDAPATH' ...Yes ('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0'). ... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe' ...Yes. ... Executing command '"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc" --version | findstr /c:"release 9.0" > NUL && echo C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin' ...Yes ('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin'). ... Executing command 'echo %TMP%\mex%RANDOM%_%TIME:~6,5%_device.obj' ...Yes ('C:\Users\Marius\AppData\Local\Temp\mex_20699_28.85_device.obj'). Found installed compiler 'NVIDIA CUDA Compiler'. Set PATH = \C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Bin\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC..\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC..\Common7\Tools;C:\Program Files (x86)\Windows Kits\8.1\Bin\x64;C:\Program Files (x86)\Windows Kits\8.1\Bin\x86;;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\MATLAB\R2018a\bin;C:\Program Files\MATLAB\R2017b\bin;C:\Program Files\Point Grey Research\FlyCapture2\bin64;C:\Program Files\Point Grey Research\FlyCapture2\bin64\vs2013;C:\Program Files\Point Grey Research\FlyCapture2\bin64\vs2015;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Point Grey Research\FlyCap2 Viewer\bin64;%FC2PATH\vs2013;C:\Program Files\Point Grey Research\FlyCap2 Viewer\bin64\vs2015;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\CMake\bin;C:\Users\Marius\Anaconda3;C:\Users\Marius\Anaconda3\Library\mingw-w64\bin;C:\Users\Marius\Anaconda3\Library\usr\bin;C:\Users\Marius\Anaconda3\Library\bin;C:\Users\Marius\Anaconda3\Scripts;C:\Users\Marius\Miniconda3;C:\Users\Marius\Miniconda3\Library\mingw-w64\bin;C:\Users\Marius\Miniconda3\Library\usr\bin;C:\Users\Marius\Miniconda3\Library\bin;C:\Users\Marius\Miniconda3\Scripts;C:\Users\Marius\AppData\Local\Microsoft\WindowsApps;C:\Users\Marius\AppData\Local\GitHubDesktop\bin;C:\Users\Marius\AppData\Local\Microsoft\WindowsApps;C:\Users\Marius\AppData\Local\atom\bin Set INCLUDE = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;C:\Program Files\MATLAB\R2018a\extern\include;C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\include;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;C:\Program Files\MATLAB\R2018a\extern\include;C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\include; Set LIB = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;C:\Program Files\MATLAB\R2018a\lib\win64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;C:\Program Files\MATLAB\R2018a\lib\win64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64; Set LIBPATH = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64; Options file details Compiler location: $NVCC Options file: C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2013_dynamic.xml CMDLINE150 : nvcc -dlink --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" --compiler-options=/O2,/Oy-,/DNDEBUG C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.obj C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\c_mexapi_version.obj -lcudadevrt -o C:\Users\Marius\AppData\Local\Temp\mex_20699_28.85_device.obj && echo /out: > NUL CMDLINE200 : link /nologo /manifest /DLL /EXPORT:mexFunction /EXPORT:mexfilerequiredapiversion C:\Users\Marius\AppData\Local\Temp\mex_20699_28.85_device.obj C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.obj C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\c_mexapi_version.obj /LIBPATH:"C:\Program Files\MATLAB\R2018a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib cudadevrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libMatlabDataArray.lib libMatlabEngine.lib /out:mexMPnu8.mexw64 CMDLINE250 : mt -outputresource:mexMPnu8.mexw64;2 -manifest "mexMPnu8.mexw64.manifest" CMDLINE300 : del "mexMPnu8.exp" "mexMPnu8.lib" "mexMPnu8.mexw64.manifest" "mexMPnu8.ilk" C:\Users\Marius\AppData\Local\Temp\mex_20699_28.85_device.obj COMPILER : nvcc COMPFLAGS : --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" ARCHFLAGS : -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" COMPDEFINES : --compiler-options=/DMX_COMPAT_64 --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b --compiler-options=/DUSE_MEX_CMD --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE MATLABMEX : /DMATLAB_MEX_FILE OPTIMFLAGS : --compiler-options=/O2,/Oy-,/DNDEBUG INCLUDE : -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" DEBUGFLAGS : --compiler-options=/Z7 LINKER : link LINKFLAGS : /nologo /manifest LINKTYPE : /DLL LINKEXPORT : /EXPORT:mexFunction LINKEXPORTVER : /EXPORT:mexFunction /EXPORT:mexfilerequiredapiversion LINKLIBS : /LIBPATH:"C:\Program Files\MATLAB\R2018a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib cudadevrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libMatlabDataArray.lib libMatlabEngine.lib LINKDEBUGFLAGS : /debug /PDB:"mexMPnu8.mexw64.pdb" LINKOPTIMFLAGS : OBJEXT : .obj LDEXT : .mexw64 SETENV : set COMPILER=nvcc set COMPFLAGS=/c --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" --compiler-options=/DMX_COMPAT_64 --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b --compiler-options=/DUSE_MEX_CMD --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE /DMATLAB_MEX_FILE set OPTIMFLAGS=--compiler-options=/O2,/Oy-,/DNDEBUG set DEBUGFLAGS=--compiler-options=/Z7 set LINKER=link set LINKFLAGS=/nologo /manifest /export:%ENTRYPOINT% /DLL /LIBPATH:"C:\Program Files\MATLAB\R2018a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib cudadevrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libMatlabDataArray.lib libMatlabEngine.lib /EXPORT:mexFunction set LINKDEBUGFLAGS=/debug /PDB:"%OUTDIR%%MEX_NAME%.mexw64.pdb" set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%" VCROOT : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC SDKROOT : C:\Program Files (x86)\Windows Kits\8.1\ VSINSTALLDIR : C:\Program Files (x86)\Microsoft Visual Studio 12.0\ VCINSTALLDIR : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ PROF_ENV : C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe VCVARSALLDIR : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC CUDA_LIB_PATH : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64 CUDA_BIN_PATH : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin DEVOBJ : C:\Users\Marius\AppData\Local\Temp\mex_20699_28.85_device.obj MATLABROOT : C:\Program Files\MATLAB\R2018a ARCH : win64 SRC : "D:\Github\Kilosort2\CUDA\mexMPnu8.cu";"C:\Program Files\MATLAB\R2018a\extern\version\c_mexapi_version.c" OBJ : C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.obj;C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\c_mexapi_version.obj OBJS : C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.obj C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\c_mexapi_version.obj SRCROOT : D:\Github\Kilosort2\CUDA\mexMPnu8 DEF : C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.def EXP : "mexMPnu8.exp" LIB : "mexMPnu8.lib" EXE : mexMPnu8.mexw64 ILK : "mexMPnu8.ilk" MANIFEST : "mexMPnu8.mexw64.manifest" TEMPNAME : mexMPnu8 EXEDIR : EXENAME : mexMPnu8 NVCC_FLAGS : OPTIM : --compiler-options=/O2,/Oy-,/DNDEBUG LINKOPTIM : CMDLINE100_0 : nvcc -dc --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" --compiler-options=/O2,/Oy-,/DNDEBUG --compiler-options=/DMX_COMPAT_64 --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b --compiler-options=/DUSE_MEX_CMD --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "D:\Github\Kilosort2\CUDA\mexMPnu8.cu" -o C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.obj && echo /Fo > NUL CMDLINE100_1 : nvcc -dc --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" --compiler-options=/O2,/Oy-,/DNDEBUG --compiler-options=/DMX_COMPAT_64 --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b --compiler-options=/DUSE_MEX_CMD --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "C:\Program Files\MATLAB\R2018a\extern\version\c_mexapi_version.c" -o C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\c_mexapi_version.obj && echo /Fo > NUL Building with 'NVIDIA CUDA Compiler'. nvcc -dc --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" --compiler-options=/O2,/Oy-,/DNDEBUG --compiler-options=/DMX_COMPAT_64 --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b --compiler-options=/DUSE_MEX_CMD --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "D:\Github\Kilosort2\CUDA\mexMPnu8.cu" -o C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.obj && echo /Fo > NUL D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(661): warning: variable "d_mask" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(661): warning: variable "d_mask" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(661): warning: variable "d_mask" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(661): warning: variable "d_mask" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "a" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(280): warning: variable "b" was set but never used D:/Github/Kilosort2/CUDA/mexMPnu8.cu(661): warning: variable "d_mask" was set but never used

mexMPnu8.cu

nvcc -dc --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" --compiler-options=/O2,/Oy-,/DNDEBUG --compiler-options=/DMX_COMPAT_64 --compiler-options=/DMATLAB_DEFAULT_RELEASE=R2017b --compiler-options=/DUSE_MEX_CMD --compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "C:\Program Files\MATLAB\R2018a\extern\version\c_mexapi_version.c" -o C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\c_mexapi_version.obj && echo /Fo > NUL c_mexapi_version.c

nvcc -dlink --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" --compiler-options=/O2,/Oy-,/DNDEBUG C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.obj C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\c_mexapi_version.obj -lcudadevrt -o C:\Users\Marius\AppData\Local\Temp\mex_20699_28.85_device.obj && echo /out: > NUL mexMPnu8.obj c_mexapi_version.obj

link /nologo /manifest /DLL /EXPORT:mexFunction /EXPORT:mexfilerequiredapiversion C:\Users\Marius\AppData\Local\Temp\mex_20699_28.85_device.obj C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\mexMPnu8.obj C:\Users\Marius\AppData\Local\Temp\mex_2813686447996919_1900\c_mexapi_version.obj /LIBPATH:"C:\Program Files\MATLAB\R2018a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib cudadevrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libMatlabDataArray.lib libMatlabEngine.lib /out:mexMPnu8.mexw64 Creating library mexMPnu8.lib and object mexMPnu8.exp

mt -outputresource:mexMPnu8.mexw64;2 -manifest "mexMPnu8.mexw64.manifest" Microsoft (R) Manifest Tool version 6.3.9600.17336

Copyright (c) Microsoft Corporation 2012.

All rights reserved.

del "mexMPnu8.exp" "mexMPnu8.lib" "mexMPnu8.mexw64.manifest" "mexMPnu8.ilk" C:\Users\Marius\AppData\Local\Temp\mex_20699_28.85_device.obj MEX completed successfully.

jenniferColonell commented 5 years ago

I notice that the comma gets generated when the compiling script auto generates a name for the temp file, using the command: command 'echo %TMP%\mex%RANDOM%%TIME:~6,5%_device.obj'

If your Windows regional settings use time formats with commas (this is true, for example, if the formats and location are set for Germany), then the name will contain a comma, and you'll get an error when the compiler tries to interpret the line.

You can probably compile by temporarily setting your Formats to "English(United States)" and Location to "United States". These settings are in the windows control panel "Region and Language". You'll need to reboot after changing these settings.

RobertoDF commented 5 years ago

Finally solved the problem! Now I can compile the file. It was indeed that comma in DEVOBJ. I got rid of it changing the line 195 in the nvcc_msvcpp2013dynamic.xml file. From this: ` <cmdReturns name="echo %TMP%\mex%RANDOM%_%TIME:~6,5%device.obj" /> to this: <cmdReturns name="echo %TMP%\mex%RANDOM%_device.obj" />` Can you please tell me what is line 195 in your nvcc_msvcpp2013_dynamic.xml file ?

Thanks for the help!

jenniferColonell commented 5 years ago

Here's that line from my nvcc_msvcpp2013_dynamic.xml file:

cmdReturns name="echo %TMP%\mex%RANDOM%%TIME:~6,5%_device.obj"

It only works okay because the US settings punctuate the time with a period instead of a comma! It was pretty shortsighted on the part of whoever wrote the script -- they should have allowed for different time formats.

marius10p commented 5 years ago

I updated the code so it no longer requires dynamic compilation. Hopefully that solves this compilation issue. Please re-open if there are still problems.

RobertoDF commented 4 years ago

Hi Marius, The new version has the same compiling problem if you are not in US. I solved it by changing temporarily the region to US. Is the dynamic flag needed?

jenniferColonell commented 4 years ago

Hi Roberto, You can disable the part of the code that requires the dynamic flag by setting "enableStableMode" to False in mexGPUall. The result will be that KS2.5 will not run deterministically -- i.e. results on the same data will vary from run to run. This can make parameter optimization confusing, but the results are otherwise correct.

RobertoDF commented 4 years ago

ok, thanks!