Segmentation violation with Kilosort

Hello,

I am using Kilosort software to do spike sorting. It is matlab written and it uses GPU. I tried several version (2.0, 2.5 and 3.0) on two datasets. I managed to run Kilosort on Yggdrasil, but it is not stable. Indeed, with some combination of dataset and software version, I get segmentation violation.

I found some similar issues (#85, #199 and #341) on the GitHub repo. The segmentation trouble seems to affect only Linux users. Apparently, Matlab 2019b for Linux is delivered with 2018 versions of mkl (in particular BLAS and LAPACK). I confirmed it by typing the following commands :

------------------------------------------------------------------------------------------------------------
 module load matlab
[juventin@login1.yggdrasil ~]$ matlab
MATLAB is selecting SOFTWARE OPENGL rendering.

                            < M A T L A B (R) >
                  Copyright 1984-2019 The MathWorks, Inc.
              R2019b Update 5 (9.7.0.1319299) 64-bit (glnxa64)
                             February 19, 2020

 
To get started, type doc.
For product information, visit www.mathworks.com.
 
>> version -lapack

ans =

    'Intel(R) Math Kernel Library Version 2018.0.3 Product Build 20180406 for Intel(R) 64 architecture applications, CNR branch AVX512
     Linear Algebra PACKage Version 3.7.0
     '

>> version -blas  

ans =

    'Intel(R) Math Kernel Library Version 2018.0.3 Product Build 20180406 for Intel(R) 64 architecture applications, CNR branch AVX512
     '
------------------------------------------------------------------------------------------------------------

On issue #341, the following fix is proposed :
The issue seems to happen only on Linux, and I solved this issue by installing the latest version of Intel MKL sudo apt install intel-mkl, and by adding these 2 lines to my .bashrc file:

export BLAS_VERSION=/usr/lib/x86_64-linux-gnu/mkl/libblas.so
export LAPACK_VERSION=/usr/lib/x86_64-linux-gnu/mkl/liblapack.so

So, now my question is, how could I apply this fix on Yggdrasil?

Thank you,

Maxime

Hi,

Please try with a newer Matlab version: the latest we have is 2021b. Warning, matlab and MATLAB isn’t the same version. In the future all the Matlab versions we’ll install will be with capital letters.

[sagon@login1.yggdrasil ~]$ ml spider MATLAB

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  MATLAB:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     Versions:
        MATLAB/2021a
        MATLAB/2021b
     Other possible modules matches:
        matlab

Thank you Yann.
I tried with MATLAB/2021a and CUDAcore/11.0.2. It seems so far to work. Thank’s again.