Installing in Google Colab

FastDDM can be installed in Google Colab, also with GPU support. This allows to test the library without the need to install it locally on workstations.

Tip

To better understand what the different options imply, see Building from source and Install source distribution.

Open a new notebook. If you wish to use the GPU provided by the host server, change the runtime type. To do so, select from the toolbar Runtime > Change runtime type and select a GPU available from the Hardware accelerator list. As of today (3 April 2024), with the free plan, you should have access to the T4 GPU. Save and go back to your notebook.

To check that the GPU is working, run the following command in a cell

!nvidia-smi

From pip source distribution

To install the source distribution via pip, run the command below

!pip3 install --no-binary fastddm fastddm

From GitHub repository source code

This is the preferred mode if you want to run the unit tests. Clone the source code from the GitHub repository

!git clone --depth 1 --branch <version_name> https://github.com/somexlab/fastddm.git

For example, to clone the version v0.3.8, run

!git clone --depth 1 --branch v0.3.8 https://github.com/somexlab/fastddm.git

Change directory to the source code one

%cd fastddm

Finally, install FastDDM

!python3 -m pip install .

Note

To enable the installation options, refer to the Building from source documentation. For example, to enable the CUDA core, run:

!python3 -m pip install . --config-settings=cmake.define.ENABLE_CUDA=ON

Warning

Due to the amount of available RAM memory, we also warmly recommend to enable the single precision math option.

Tip

To run unit tests, you need some additional libraries. Run:

!python3 -m pip install pytest pytest-regtest

Then, run the tests with:

!pytest -v

Now you can go back to your home directory and work with FastDDM!

%cd ..