|
1 | 1 | # Installing OpenDR toolkit
|
2 | 2 |
|
3 | 3 | OpenDR can be installed in the following ways:
|
4 |
| -1. By cloning this repository (CPU/GPU support) |
5 |
| -2. Using *pip* (CPU/GPU support) |
6 |
| -3. Using *docker* (CPU/GPU support) |
| 4 | +1. Using *pip* (CPU/GPU support) |
| 5 | +2. Using *docker* (CPU/GPU support) |
| 6 | +3. By cloning this repository (CPU/GPU support, for advanced users only) |
7 | 7 |
|
8 | 8 | The following table summarizes the installation options based on your system architecture and OS:
|
9 | 9 |
|
10 |
| -| Installation Method | CPU/GPU | OS | |
11 |
| -|---------------------|----------|-----------------------| |
12 |
| -| Clone & Install | Both | Ubuntu 20.04 (x86-64) | |
13 |
| -| pip | Both | Ubuntu 20.04 (x86-64) | |
14 |
| -| docker | Both | Linux / Windows | |
| 10 | +| Installation Method | OS | |
| 11 | +|-----------------------|-----------------------| |
| 12 | +| Clone & Install | Ubuntu 20.04 (x86-64) | |
| 13 | +| pip | Ubuntu 20.04 (x86-64) | |
| 14 | +| docker | Linux / Windows | |
15 | 15 |
|
| 16 | +Note that pip installation includes only the Python API of the toolkit. |
| 17 | +If you need to use all the functionalities of the toolkit (e.g., ROS nodes, etc.), then you need either to use the pre-compiled docker images or to follow the installation instructions for cloning and building the toolkit. |
16 | 18 |
|
17 |
| -# Installing by cloning OpenDR repository (Ubuntu 20.04, x86, architecture) |
18 |
| - |
19 |
| -This is the recommended way of installing the whole toolkit, since it allows for fully exploiting all the provided functionalities. |
20 |
| -To install the toolkit, please first make sure that you have `git` available on your system. |
21 |
| -```bash |
22 |
| -sudo apt install git |
23 |
| -``` |
24 |
| -Then, clone the toolkit: |
25 |
| -```bash |
26 |
| -git clone --depth 1 --recurse-submodules -j8 https://github.com/opendr-eu/opendr |
27 |
| -``` |
28 |
| -You are then ready to install the toolkit: |
29 |
| -```bash |
30 |
| -cd opendr |
31 |
| -./bin/install.sh |
32 |
| -``` |
33 |
| -The installation script automatically installs all the required dependencies. |
34 |
| -Note that this might take a while (~10-20min depending on your machine and network connection), while the script also makes system-wide changes. |
35 |
| -Using dockerfiles is strongly advised (please see below), unless you know what you are doing. |
36 |
| -Please also make sure that you have enough RAM available for the installation (about 4GB of free RAM is needed for the full installation/compilation). |
37 |
| - |
38 |
| - |
39 |
| -If you want to install GPU-related dependencies, then you can appropriately set the `OPENDR_DEVICE` variable. |
40 |
| -The toolkit defaults to using CPU. |
41 |
| -Therefore, if you want to use GPU, please set this variable accordingly *before* running the installation script: |
42 |
| -```bash |
43 |
| -export OPENDR_DEVICE=gpu |
44 |
| -``` |
45 |
| -The installation script creates a *virtualenv*, where the toolkit is installed. |
46 |
| -To activate OpenDR environment you can just source the `activate.sh`: |
| 19 | +The toolkit is developed and tested on *Ubuntu 20.04 (x86-64)*. |
| 20 | +Please make sure that you have the most recent version of all tools by running |
47 | 21 | ```bash
|
48 |
| -source ./bin/activate.sh |
| 22 | +sudo apt upgrade |
49 | 23 | ```
|
50 |
| -Then, you are ready to use the toolkit! |
51 |
| - |
52 |
| -**NOTE:** `OPENDR_DEVICE` does not alter the inference/training device at *runtime*. |
53 |
| -It only affects the dependency installation. |
54 |
| -You can use OpenDR API to change the inference device. |
55 |
| - |
56 |
| -You can also verify the installation by using the supplied Python and C unit tests: |
57 |
| -```bash |
58 |
| -make unittest |
59 |
| -make ctests |
60 |
| -``` |
61 |
| - |
62 |
| -If you plan to use GPU-enabled functionalities, then you are advised to install [CUDA 11.2](https://developer.nvidia.com/cuda-11.2.0-download-archive), along with [CuDNN](https://developer.nvidia.com/cudnn). |
63 |
| - |
64 |
| -**HINT:** All tests probe for the `TEST_DEVICE` enviromental variable when running. |
65 |
| -If this enviromental variable is set during testing, it allows for easily running all tests on a different device (e.g., setting `TEST_DEVICE=cuda:0` runs all tests on the first GPU of the system). |
| 24 | +before installing the toolkit and then follow the installation instructions in the relevant section. |
| 25 | +All the required dependencies will be automatically installed (or explicit instructions are provided). |
| 26 | +Other platforms apart from Ubuntu 20.04, e.g., Windows, other Linux distributions, etc., are currently supported through docker images. |
66 | 27 |
|
67 | 28 | # Installing using *pip*
|
68 | 29 |
|
@@ -179,45 +140,54 @@ In this case, do not forget to enable the virtual environment with:
|
179 | 140 | ```bash
|
180 | 141 | source bin/activate.sh
|
181 | 142 | ```
|
182 |
| -## Build the docker images yourself _(optional)_ |
183 |
| -Alternatively you can also build the docker images locally using the [Dockerfile](/Dockerfile) ([Dockerfile-cuda](/Dockerfile-cuda) for cuda) provided in the root folder of the toolkit. |
184 | 143 |
|
185 |
| -For the CPU image, execute the following commands: |
| 144 | +# Installing by cloning OpenDR repository (Ubuntu 20.04, x86, architecture) |
| 145 | + |
| 146 | +This is the recommended way of installing the whole toolkit, since it allows for fully exploiting all the provided functionalities. |
| 147 | +To install the toolkit, please first make sure that you have `git` available on your system. |
| 148 | +```bash |
| 149 | +sudo apt install git |
| 150 | +``` |
| 151 | +Then, clone the toolkit: |
186 | 152 | ```bash
|
187 | 153 | git clone --depth 1 --recurse-submodules -j8 https://github.com/opendr-eu/opendr
|
| 154 | +``` |
| 155 | +You are then ready to install the toolkit: |
| 156 | +```bash |
188 | 157 | cd opendr
|
189 |
| -sudo docker build -t opendr/opendr-toolkit:cpu . |
| 158 | +./bin/install.sh |
190 | 159 | ```
|
| 160 | +The installation script automatically installs all the required dependencies. |
| 161 | +Note that this might take a while (~10-20min depending on your machine and network connection), while the script also makes system-wide changes. |
| 162 | +Using dockerfiles is strongly advised (please see below), unless you know what you are doing. |
| 163 | +Please also make sure that you have enough RAM available for the installation (about 4GB of free RAM is needed for the full installation/compilation). |
191 | 164 |
|
192 |
| -For the cuda-enabled image, first edit `/etc/docker/daemon.json` in order to set the default docker runtime: |
193 |
| -``` |
194 |
| -{ |
195 |
| - "runtimes": { |
196 |
| - "nvidia": { |
197 |
| - "path": "nvidia-container-runtime", |
198 |
| - "runtimeArgs": [] |
199 |
| - } |
200 |
| - }, |
201 |
| - "default-runtime": "nvidia" |
202 |
| -} |
203 |
| -``` |
204 | 165 |
|
205 |
| -Restart docker afterwards: |
206 |
| -``` |
207 |
| -sudo systemctl restart docker.service |
| 166 | +If you want to install GPU-related dependencies, then you can appropriately set the `OPENDR_DEVICE` variable. |
| 167 | +The toolkit defaults to using CPU. |
| 168 | +Therefore, if you want to use GPU, please set this variable accordingly *before* running the installation script: |
| 169 | +```bash |
| 170 | +export OPENDR_DEVICE=gpu |
208 | 171 | ```
|
209 |
| -Then you can build the supplied dockerfile: |
| 172 | +The installation script creates a *virtualenv*, where the toolkit is installed. |
| 173 | +To activate OpenDR environment you can just source the `activate.sh`: |
210 | 174 | ```bash
|
211 |
| -git clone --depth 1 --recurse-submodules -j8 https://github.com/opendr-eu/opendr |
212 |
| -cd opendr |
213 |
| -sudo docker build -t opendr/opendr-toolkit:cuda -f Dockerfile-cuda . |
| 175 | +source ./bin/activate.sh |
214 | 176 | ```
|
| 177 | +Then, you are ready to use the toolkit! |
| 178 | + |
| 179 | +**NOTE:** `OPENDR_DEVICE` does not alter the inference/training device at *runtime*. |
| 180 | +It only affects the dependency installation. |
| 181 | +You can use OpenDR API to change the inference device. |
215 | 182 |
|
216 |
| -In order to run them, the commands are respectively: |
| 183 | +You can also verify the installation by using the supplied Python and C unit tests: |
217 | 184 | ```bash
|
218 |
| -sudo docker run --gpus all -p 8888:8888 opendr/opendr-toolkit:cpu |
219 |
| -``` |
220 |
| -and |
221 |
| -``` |
222 |
| -sudo docker run --gpus all -p 8888:8888 opendr/opendr-toolkit:cuda |
| 185 | +make unittest |
| 186 | +make ctests |
223 | 187 | ```
|
| 188 | + |
| 189 | +If you plan to use GPU-enabled functionalities, then you are advised to install [CUDA 11.2](https://developer.nvidia.com/cuda-11.2.0-download-archive), along with [CuDNN](https://developer.nvidia.com/cudnn). |
| 190 | + |
| 191 | +**HINT:** All tests probe for the `TEST_DEVICE` enviromental variable when running. |
| 192 | +If this enviromental variable is set during testing, it allows for easily running all tests on a different device (e.g., setting `TEST_DEVICE=cuda:0` runs all tests on the first GPU of the system). |
| 193 | + |
0 commit comments