You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kilosort3-compiled/README.md
+36-19Lines changed: 36 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,18 @@
2
2
3
3
This documentation is intended to show how to create a Docker image with Matlab compiled implementation of Kilosort3 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
4
5
-
There are three main steps for generating a functional kilosort3-compiled docker image:
5
+
There are four main steps to generate a functional kilosort3-compiled docker image:
6
6
7
-
1. Compile kilosort3 as Standalone Application
8
-
2. Create a (base) docker image with Matlab Runtime and the compiled application from step 1
9
-
3. Extend the docker image from step 2 for improvements and fixes
7
+
1. Kilosort Setup
8
+
2. Compile Kilosort3 as Standalone Application
9
+
3. Create a (base) docker image with Matlab Runtime and the compiled application from step 2
10
+
4. Extend the docker image from step 3 for improvements and fixes
10
11
11
12
## Requirements
12
13
- Packaging a MATLAB Docker image is supported on Linux only
13
14
- Docker
14
15
- Matlab
15
16
- NVIDIA GPU and CUDA capabilities
16
-
-[nvidia-container-toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit): required to run a docker with GPU capabilities
17
17
18
18
### Matlab Requirements
19
19
- MATLAB Compiler
@@ -23,7 +23,7 @@ There are three main steps for generating a functional kilosort3-compiled docker
23
23
24
24
Licenses for Matlab and toolboxes are needed only for compiling ironclust 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.
25
25
26
-
## Compiling Kilosort as Matlab's Standalone Application
26
+
## Kilosort Setup
27
27
- Git clone or Download kilosort [source code](https://github.com/MouseLand/Kilosort)
28
28
- Open Matlab
29
29
- Compile Kilosort mexfiles:
@@ -32,27 +32,42 @@ Licenses for Matlab and toolboxes are needed only for compiling ironclust as Sta
32
32
```
33
33
>> mexGPUall
34
34
```
35
+
36
+
## Compiling Kilosort as Matlab's Standalone Application
35
37
- Set Matlab's workspace folder to `/path/to/spikeinterface-dockerfiles/kilosort3-compiled/matlab_files`
36
-
- Open Matlab's `Application Compiler` (located in `APPS` Tab)
37
-
- Click on `+` sign in Add Main File, Select `ks3_compiled.m` and Click `Open`
38
-
- In the section `Files required for your application to run`:
39
-
- Click on `+` sign button, Select `utils` folder and click `Open`
40
-
- Click on `+` sign button again, Select the folder of the cloned `Kilosort` project and click `Open`
41
-
- On Application Compiler window, Click on `Package`, Save the `ks3_compiled.prj` file and wait for Matlab to Compile the project. A folder (named `ks3_compiled` by default) with compiled files will be generated.
42
-
- Close `Package` and `Application Compiler` windows
38
+
- Run `mcc` command with `utils` folder and kilosort path:
39
+
```
40
+
>> mcc -m ks3_compiled.m -a utils -a <git-cloned-path>/Kilosort
41
+
```
43
42
44
43
## Generating Base Docker Image
45
-
- In Matlab console run:
44
+
- To generate the base docker image (called `ks3-matlab-base`) with compiled application, run the following command in Matlab console:
This command will create an image called `ks3-matlab-base` to be used in the next step
51
-
52
-
## Extending Base Image/Creating final image
49
+
- [Optional] Files generated by Matlab Compiler can be deleted:
50
+
- In your terminal, go to the folder for this project:
51
+
```
52
+
$ cd /path/to/spikeinterface-dockerfiles/kilosort3-compiled
53
+
```
54
+
- Run `rm` command:
55
+
```
56
+
$ rm -r \
57
+
matlab_files/includedSupportPackages.txt \
58
+
matlab_files/ks3-matlab-basedocker/ \
59
+
matlab_files/ks3_compiled \
60
+
matlab_files/mccExcludedFiles.log \
61
+
matlab_files/readme.txt \
62
+
matlab_files/requiredMCRProducts.txt \
63
+
matlab_files/run_ks3_compiled.sh \
64
+
matlab_files/unresolvedSymbols.txt \
65
+
```
66
+
67
+
## Extending Base Image and creating final image
53
68
The Dockerfile in this folder applies some fixes and updates to the base image generated automatically by Matlab in order to properly run kilosort3:
54
69
55
-
- In your terminal, go to the current folder:
70
+
- In your terminal, go to the folder for this project:
56
71
```
57
72
$ cd /path/to/spikeinterface-dockerfiles/kilosort3-compiled
58
73
```
@@ -65,6 +80,8 @@ $ source build.sh
65
80
66
81
## Running a container
67
82
83
+
- [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
0 commit comments