Skip to content

Commit

Permalink
Merge 87fc196 into 88d36fb
Browse files Browse the repository at this point in the history
  • Loading branch information
kousu committed Jul 20, 2022
2 parents 88d36fb + 87fc196 commit 2f3f6cf
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 218 deletions.
121 changes: 53 additions & 68 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,112 +25,97 @@ Thank you for your interest in contributing to ivadomed! This project uses the f

.. _installation_contributor:

Contributor or Developer ``ivadomed`` installation
Developer ``ivadomed`` installation
++++++++++++++++++++++++++++++++++++++++++++++++++

1. Download the code:

::

cd ivadomed
git clone https://github.com/ivadomed/ivadomed.git

2. Isolate your work in a virtual environment:

We recommend developing inside of ``venv`` or ``conda``.
It makes debugging easier.

.. tabs::

.. tab:: NVIDIA GPU Support

PyTorch, an integral part of ``ivadomed``, ships
CUDA 10.2 and CUDA 11.1 runtime by default with its
respective installation binaries.

In case if you're wondering about CUDA runtime, Ampere-based GPUs
(with a `Compute Capability <https://developer.nvidia.com/cuda-gpus>`_
of 8.x) only work with CUDA>=11.1. Although CUDA 11.1 is
backward compatible with older hardware, CUDA 10.2 is
preferred if available.

Thus, to accelerate ``ivadomed`` with CUDA 10.2 on a Linux system, you'd
need to have GPUs installed with an `NVIDIA driver version >=440.33
<https://docs.nvidia.com/deploy/cuda-compatibility/index.html#minor-version-compatibility>`_.
And, for CUDA 11.1 you'd rather need an upgraded NVIDIA driver version >=450.

To verify the NVIDIA driver version, look in ``/sys`` by executing the
command:

::
.. group-tab:: ``venv``

cat /sys/module/nvidia/version
and it will return your current driver version.

Before proceeding with the installation, we suggest you to set up a virtual environment
by following the instructions as specified in the :ref:`step 1 of the installation <installation_step1>`.
Create the environment:

Once you've set up a virtual environment and activated it, we recommend installing
``ivadomed`` from source along with some additional dependencies related to building
documentation, linting and testing:
.. code::
.. tabs::
python -m venv venv
.. tab:: Linux
with CUDA 10.2:
.. note::

::
If you use ``Debian`` or ``Ubuntu``, you may be prompted to
``sudo apt install python3-venv`` when creating the virtual environment.
This is expected, so please follow the instructions provided.

git clone https://github.com/ivadomed/ivadomed.git
For other operating systems, ``venv`` will usually be bundled alongside ``python``.

cd ivadomed
.. group-tab:: ``conda``

pip install -e .[dev]
If you have `conda <https://docs.conda.io/en/latest/miniconda.html>`_ installed, you can
create a new virtual environment using the provided ``environment.yml``:

with CUDA 11.1:
::

::
conda env create

git clone https://github.com/ivadomed/ivadomed.git
3. Activate the environment:

cd ivadomed
.. tabs::

.. group-tab:: ``venv``

.. tabs::

pip install -e .[dev] --extra-index-url https://download.pytorch.org/whl/cu111
.. group-tab:: Linux

.. tab:: Mac/Windows
.. code::
with CUDA 10.2:
source venv/bin/activate
::
.. group-tab:: Windows

git clone https://github.com/ivadomed/ivadomed.git
.. code::
cd ivadomed
venv\Scripts\activate
pip install -e .[dev] --extra-index-url https://download.pytorch.org/whl/cu102
.. group-tab:: macOS

with CUDA 11.1:
.. code::
::
source venv/bin/activate
git clone https://github.com/ivadomed/ivadomed.git
.. group-tab:: ``conda``

cd ivadomed
::

pip install -e .[dev] --extra-index-url https://download.pytorch.org/whl/cu111
conda activate ivadomed_env


.. tab:: CPU Support
.. note::

.. tabs::
Every time you come to work on the code you will need to activate the environment in this way.

.. tab:: Linux

::
4. Install the code in "editable" mode:

git clone https://github.com/ivadomed/ivadomed.git
::

cd ivadomed
pip install -e .[dev]

pip install -e .[dev] --extra-index-url https://download.pytorch.org/whl/cpu
.. note::

.. tab:: Mac/Windows
For developing under specific circumstances like exotic GPUs or none at all,
follow :ref:`the special case install guide <install_special_cases>`, but replace any ``pip install ivadomed`` there with ``pip install -e .[dev]``.

::

git clone https://github.com/ivadomed/ivadomed.git

cd ivadomed

pip install -e .[dev]
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ def patched_parse(self):
# Output file base name for HTML help builder.
htmlhelp_basename = 'ivadomed-doc'

# configure sphinx_copybutton for python and bash examples
copybutton_prompt_text = r">>> |\$ "
copybutton_prompt_is_regexp = True

# PATCH `sphinx-jsonschema`
# to render the extra `options`` and ``tags`` schema properties
Expand Down
Loading

0 comments on commit 2f3f6cf

Please sign in to comment.