-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathINSTALL.txt
211 lines (156 loc) · 10.8 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
SURVOS INSTALLATION
SuRVoS2 requires GPU acceleration both for the 3d rendering in the interactive frontend GUI (via Napari) and for the Pytorch backend for deep learning segmentation.
A recent (e.g. A100) is recommended for deep learning segmentation on larger (e.g. > 800x800x800) volumes, but smaller volumes can be segmented on P100s or T4s or equivalent laptop hardware.
Note, for Windows, MSVC Build Tools is required: https://visualstudio.microsoft.com/downloads/?q=build+tools.
1. Check to see if CUDA is installed, currently 11.3 and 11.6 are recommended (see below). To
check your CUDA installation see the CUDA instructions at the bottom of this document.
2. Create a folder (on the Desktop for example) to download the survos2 installer.
The actual survos2 application will be installed in the miniconda environment later.
$ mkdir survos2
Navigate to the folder created
$ cd survos2
Download Survos2 using git clone
$ git clone https://github.com/rosalindfranklininstitute/SuRVoS2.git
Navigate into the Survos2 folder
$ cd SuRVoS2
3. Make sure that either conda or python-pip (python version 3.8 is needed) is installed
If neither is available you can download and install them from here:
For python-pip (please install python 3.8):
Download at: https://www.python.org/downloads/
For Conda:
Download at: https://docs.conda.io/en/latest/miniconda.html
4. Create a new environment for survos2
If python-pip (python version 3.8) is used:
$ python3 -m venv survos2_env
Shared environmnent needed?
$ python3 -m venv <system-location-that-is-accessible>/survos2_conda_env
e.g.
$ python3 -m venv /home/user/Documents/survos2_conda_env
and activate it:
$ source survos2_conda_env/bin/activate
or
$ source <system-location-that-is-accessible>/survos2_conda_env/bin/activate
If conda is used:
$ conda create --name survos2_conda_env python=3.8
Shared environmnent needed?
$ conda create --prefix <system-location-that-is-accessible>/survos2_conda_env python=3.8
e.g.
$ conda create --prefix /home/user/Documents/survos2_conda_env python=3.8
and activate it:
$ conda activate survos2_conda_env
or
$ conda activate /home/user/Documents/survos2_conda_env
5. Perform the survos2 pip installs using:
Below depending on the CUDA version / No GPU support, some 'sed' commands have to be executed in Linux or
some get-content set-content commands in Windows
Their purpose is to replace text in the requirements.txt/requirements_windows.txt files to set it for the
appropriate CUDA version / No GPU support
E.g.
$ sed -i 's|torch|torch==1.12.1+cu102|g' requirements.txt
replaces 'torch' with 'torch==1.12.1+cu102' in the requirements.txt file and similarly
$ (get-content requirements_windows.txt) | %{$_ -replace "torch","torch==1.12.1+cu102"} | set-content requirements_windows.txt
does the same in windows
(LINUX)
(No GPU support)
$ python3 -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
(CUDA 10.2)
$ sed -i 's|torchvision|torchvision==0.13.1+cu102|g' requirements.txt
$ sed -i 's|torchio|placeholder1|g' requirements.txt
$ sed -i 's|torchmetrics|placeholder2|g' requirements.txt
$ sed -i 's|medicaltorch|placeholder3|g' requirements.txt
$ sed -i 's|torch|torch==1.12.1+cu102|g' requirements.txt
$ sed -i 's|placeholder1|torchio|g' requirements.txt
$ sed -i 's|placeholder2|torchmetrics|g' requirements.txt
$ sed -i 's|placeholder3|medicaltorch|g' requirements.txt
$ python3 -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu102
(CUDA 11.3)
$ sed -i 's|torchvision|torchvision==0.13.1+cu113|g' requirements.txt
$ sed -i 's|torchio|placeholder1|g' requirements.txt
$ sed -i 's|torchmetrics|placeholder2|g' requirements.txt
$ sed -i 's|medicaltorch|placeholder3|g' requirements.txt
$ sed -i 's|torch|torch==1.12.1+cu113|g' requirements.txt
$ sed -i 's|placeholder1|torchio|g' requirements.txt
$ sed -i 's|placeholder2|torchmetrics|g' requirements.txt
$ sed -i 's|placeholder3|medicaltorch|g' requirements.txt
$ python3 -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu113
(CUDA 11.6)
$ sed -i 's|torchvision|torchvision==0.14.1+cu116|g' requirements.txt
$ sed -i 's|torchio|placeholder1|g' requirements.txt
$ sed -i 's|torchmetrics|placeholder2|g' requirements.txt
$ sed -i 's|medicaltorch|placeholder3|g' requirements.txt
$ sed -i 's|torch|torch==1.13.1+cu116|g' requirements.txt
$ sed -i 's|placeholder1|torchio|g' requirements.txt
$ sed -i 's|placeholder2|torchmetrics|g' requirements.txt
$ sed -i 's|placeholder3|medicaltorch|g' requirements.txt
$ python3 -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu116
(CUDA 11.7)
$ python3 -m pip install -r requirements.txt
(CUDA 11.8)
$ python3 -m pip install -r requirements.txt --index-url https://download.pytorch.org/whl/cu118
(WINDOWS) (use Powershell for the get-content, set-content commands)
(No GPU support)
$ python3 -m pip install -r requirements_windows.txt --extra-index-url https://download.pytorch.org/whl/cpu
(CUDA 10.2)
$ (get-content requirements_windows.txt) | %{$_ -replace "torchvision","torchvision==0.13.1+cu102"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torchio","placeholder1"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torchmetrics","placeholder2"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "medicaltorch","placeholder3"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torch","torch==1.12.1+cu102"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder1","torchio"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder2","torchmetrics"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder3","medicaltorch"} | set-content requirements_windows.txt
$ python3 -m pip install -r requirements_windows.txt --extra-index-url https://download.pytorch.org/whl/cu102
(CUDA 11.3)
$ (get-content requirements_windows.txt) | %{$_ -replace "torchvision","torchvision==0.13.1+cu113"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torchio","placeholder1"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torchmetrics","placeholder2"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "medicaltorch","placeholder3"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torch","torch==1.12.1+cu113"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder1","torchio"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder2","torchmetrics"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder3","medicaltorch"} | set-content requirements_windows.txt
$ python3 -m pip install -r requirements_windows.txt --extra-index-url https://download.pytorch.org/whl/cu113
(CUDA 11.6)
$ (get-content requirements_windows.txt) | %{$_ -replace "torchvision","torchvision==0.14.1+cu116"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torchio","placeholder1"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torchmetrics","placeholder2"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "medicaltorch","placeholder3"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "torch","torch==1.13.1+cu116"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder1","torchio"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder2","torchmetrics"} | set-content requirements_windows.txt
$ (get-content requirements_windows.txt) | %{$_ -replace "placeholder3","medicaltorch"} | set-content requirements_windows.txt
$ python3 -m pip install -r requirements_windows.txt --extra-index-url https://download.pytorch.org/whl/cu116
(CUDA 11.7)
$ python3 -m pip install -r requirements_windows.txt --index-url https://download.pytorch.org/whl/cu117
(CUDA 11.8)
$ python3 -m pip install -r requirements_windows.txt --index-url https://download.pytorch.org/whl/cu118
6. Build survos2 cython + cuda stuff:
$ python3 ./survos2/improc/setup.py build_ext --inplace
7. Create a folder for the <survos2 workspace>
(For a central installation remember to make this somewhere that is readable to everyone)]
8. Edit settings.yaml file. Change the CHROOT to <survos2 workspace>.
9. Install SuRVoS plugin for Napari
$ pip install -e .
Installation should be completed.
The '-e' will install in development mode.
10. Run SuRVoS by starting Napari
$ napari
Then select the Workspace (SuRVoS2) plugin from the Plugins menu.
--------------------------------------------------------------------------------------
CUDA INSTALLATION
Before the installation of SuRVoS, if GPU support is desired please check that either one of the
following CUDA versions is installed:
* CUDA 10.2 (you can install it by following this link https://developer.nvidia.com/cuda-10.2-download-archive)
* CUDA 11.3 (you can install it by following this link https://developer.nvidia.com/cuda-11-3-1-download-archive)
* CUDA 11.6 (you can install it by following this https://developer.nvidia.com/cuda-11-6-2-download-archive)
* CUDA 11.7 (you can install it by following this https://developer.nvidia.com/cuda-11-7-1-download-archive)
* CUDA 11.8 (you can install it by following this https://developer.nvidia.com/cuda-11-8-0-download-archive)
To verify that one of the CUDA versions above is installed and available for use run the following command:
$ nvcc --version
Additionally, you may also include the cuDNN library in your CUDA installation for improved performance
during the training and inference of neural networks.
You can download cuDNN from here https://developer.nvidia.com/rdp/cudnn-download
An installation guide on how to include it in your CUDA install can be found here
https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html
If once of the above CUDA versions is installed or if GPU support is not needed, please continue
with the SuRVoS 2 installation guide above.