Skip to content

Commit

Permalink
Added docker documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
thivinanandh committed Jul 9, 2024
1 parent 2c426a5 commit ce674e9
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
80 changes: 80 additions & 0 deletions docs/_rst/_docker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Docker Installation
===================

The docker image is available on `Docker Hub <https://hub.docker.com/r/thivinanandh/fastvpinns>`_. This docker version is based on a `Ubuntu 20.04` image with `Python 3.10` installed. The Docker image can support GPU acceleration as it comes with `CUDA 11.1` and `cuDNN 8.0` installed.


Pre-requisite for installing Docker with GPU Support
____________________________________________________

For GPU support, you need to install `NVIDIA Container Toolkit <https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html>`_ on your machine. The toolkit is required to run the docker container with GPU support. Follow all the guidelines in installing the necessary drivers and the toolkit for GPU support. For installing docker on your machine, you can follow the instructions provided in the `Docker Documentation <https://docs.docker.com/engine/install/ubuntu/>`_.


Installing FastVPINNs Docker Image
__________________________________

To install the docker image, you can use the following command:

.. code-block:: bash
docker pull thivinanandh/fastvpinns:latest
Step by Step Guide to Run the Docker Image
__________________________________________

1. Create a new folder to mount the volume for the docker container. This is used to share the files between the host and the container. Lets create a folder named `fastvpinns` in your home directory.

.. code-block:: bash
mkdir ~/fastvpinns
2. Change the directory to the folder `fastvpinns`:

.. code-block:: bash
cd ~/fastvpinns
3. Pull the docker image using the following command:

.. code-block:: bash
docker pull thivinanandh/fastvpinns:latest
4. To run the docker container with GPU support, you can use the following command:

.. code-block:: bash
docker run --gpus all -it --rm -v ~/fastvpinns:/fastvpinns thivinanandh/fastvpinns:latest
for CPU only support, you can use the following command:

.. code-block:: bash
docker run -it --rm -v ~/fastvpinns:/fastvpinns thivinanandh/fastvpinns:latest
Explanation of the command:
- `--gpus all` : This flag is used to enable GPU support for the container.
- `-it` : This flag is used to run the container in interactive mode.
- `--rm` : This flag is used to remove the container once the container is stopped.
- `-v ~/fastvpinns:/fastvpinns` : This flag is used to mount the volume `~/fastvpinns` to the container at `/fastvpinns`.
- `thivinanandh/fastvpinns:latest` : This is the docker image name and tag.

5. When loaded into the container, The console will look like the image shown below. Here it shows whether the GPU is detected and the version of the installed packages.

.. image:: ../images/console.png
:alt: Docker Image
:align: center

6. Navigate to the `examples` folder to run the examples provided in the repository. The Status of GPU can be viewed by running the following command:

.. code-block:: bash
nvidia-smi
Additional Notes
________________

- To make the experience better, you can attach the docker container to a VSCode instance. This can be done by installing the `Remote - Containers <https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers>`_ extension in VSCode. This extension allows you to attach the running docker container to a VSCode instance. This way you can edit the files in the container using the VSCode editor.


Binary file added docs/images/console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The framework is based on the work by `FastVPINNs Paper <https://arxiv.org/abs/2


hp-Variational Physics-informed neural network
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

hp-Variational Physics-Informed neural networks are special form of physics informed neural networks, which uses variational form of the loss function to train the NN. A special form of hp-Variational PINNs which uses h- & p- refinement to enhance the ability of the NN to capture higher frequency solutions.
For more details on the theory and implementation of hp-VPINNs, please refer to the `FastVPINNs Paper <https://arxiv.org/abs/2404.12063>`_ and `hp-VPINNs Paper <https://arxiv.org/abs/2003.05385>`_.
Expand All @@ -63,6 +63,7 @@ For more details on the theory and implementation of hp-VPINNs, please refer to
:caption: Getting Started

Installation <_rst/_installation.rst>
Docker Installation <_rst/_docker.rst>

.. toctree::
:maxdepth: 3
Expand Down

0 comments on commit ce674e9

Please sign in to comment.