|
| 1 | +# Kilosort Compiled Docker Images |
| 2 | + |
| 3 | +This documentation is intended to show how to create a Docker image with Matlab compiled implementation of Kilosort sorter. The main goal of this project is to avoid the requirement of Matlab Licenses and also abstract the installation and setup steps to run kilosort |
| 4 | + |
| 5 | +## Requirements |
| 6 | +- Packaging a MATLAB Docker image is supported on Linux only |
| 7 | +- Docker |
| 8 | +- Matlab |
| 9 | +- NVIDIA GPU and CUDA capabilities |
| 10 | + |
| 11 | +### Matlab Requirements |
| 12 | +- MATLAB Compiler |
| 13 | +- Parallel Computing Toolbox |
| 14 | +- Signal Processing Toolbox |
| 15 | +- Statistics and Machine Learning Toolbox |
| 16 | + |
| 17 | +## Creating Docker Image |
| 18 | + |
| 19 | +There are four main steps to generate a functional kilosort-compiled docker image: |
| 20 | + |
| 21 | +1. Kilosort Setup |
| 22 | +2. Compile Kilosort as Standalone Application |
| 23 | +3. Create a (base) docker image with Matlab Runtime and the compiled application from step 2 |
| 24 | +4. Extend the docker image from step 3 for improvements and fixes |
| 25 | + |
| 26 | +Detailed descriptions for each step are documented in `README.md` for each supported kilosort version folder (`kilosort-compiled`, `kilosort2-compiled` and so on) |
| 27 | + |
| 28 | +Licenses for Matlab and toolboxes are needed only for compiling kilosort as Standalone Application and to generate the base Docker image. After this process, no license will be required, either to extend the base image or to run the sorter. |
| 29 | + |
| 30 | +## Running a container |
| 31 | + |
| 32 | +After generating kilosort-compiled image, [nvidia-container-toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit) is required to run a docker with GPU capabilities |
| 33 | + |
| 34 | +The base syntax to run dockerized kilosort is: |
| 35 | + |
| 36 | +```bash |
| 37 | +docker run -v <host-data-folder>:<docker-data-folder> <image>:<tag> <ks_command> [ARGS] |
| 38 | +``` |
| 39 | +- A volume has to be binded to a folder were all the data to run kilosort are stored |
| 40 | +- `<image>`: Image name given by `build.sh` script |
| 41 | +- `<tag>`: Image Tag given by `build.sh` script |
| 42 | +- `<ks_command>`: Depends on kilosort version, options are `ks_compiled`, `ks2_compiled`, `ks2_5_compiled` or `ks3_compiled` |
| 43 | +- `[ARGS]`: Currently the only ARG option is the folder where the data are stored (\<docker-data-folder\>) |
| 44 | + |
| 45 | +This kilosort compiled version assumes that there are also two `.mat` files in this data folder: |
| 46 | +1. `ops.mat`: Configurations (options) data |
| 47 | +2. `chanMap.mat`: ChannelMap data |
| 48 | + |
| 49 | +Both files are automatically generated by spikeinterface when running `run\_sorter`. If you want to run compiled kilosort independently you need to generate them manually (HOW TO still needs to be done) |
0 commit comments