# Linux dependencies

*Note: Don't follow this step if you plan to run BlurIt OP on Windows.* [*Go there*](/1.0.0/blurit-on-premise/installation/windows-dependencies-wsl.md) *instead.*

## Choice 1 : use our dependencies installation script (recommended)

This script will install the software requirements to run BlurIt On-Premise on your server. It will install Nvidia drivers, Docker CE, and Nvidia-docker on Ubuntu, Debian, and RHEL/CentOS. If you are installing BlurIt on an old server and want to maintain specific version dependencies, we don't recommend to use this script but rather to [manually install everything](#manual-dependencies-installation).

To begin, extract the BlurIt OP archive using the following command:

{% code lineNumbers="true" %}

```bash
tar -xzf filename.tar.gz
cd blurit-op
```

{% endcode %}

Replace "filename" with the actual name of the archive that was provided to you.

To start the script, execute the following command:

{% code lineNumbers="true" %}

```sh
sudo ./install_dependencies.sh
```

{% endcode %}

:rotating\_light: After execution of the script, please reboot the server to load the Nvidia drivers and go to the [Configuration](/1.0.0/blurit-on-premise/installation/configuration.md) page. :rotating\_light:

## Choice 2 : manual dependencies installation

### Nvidia drivers Installation

1. Download the NVIDIA driver >= 470 runfile from: <https://www.nvidia.com/Download/index.aspx?lang=en-us>
2. Open a terminal and navigate to the directory where the downloaded runfile is located.
3. `$ chmod +x <filename>.run` \
   Replace `<filename>` with the actual name of the downloaded runfile.
4. `$ sudo ./<filename>.run`&#x20;
5. `$ sudo reboot`&#x20;

### Docker Installation

The Docker installation documentation is [here](https://docs.docker.com/engine/install/).

{% tabs %}
{% tab title="Ubuntu" %}
{% code lineNumbers="true" fullWidth="false" %}

```bash
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin
```

{% endcode %}
{% endtab %}

{% tab title="Debian" %}
{% code lineNumbers="true" %}

```bash
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin
```

{% endcode %}
{% endtab %}

{% tab title="Centos" %}
{% code lineNumbers="true" %}

```bash
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker
```

{% endcode %}
{% endtab %}

{% tab title="RHEL" %}
{% code lineNumbers="true" %}

```bash
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Post-install docker linux (required):&#x20;

{% code lineNumbers="true" %}

```bash
sudo groupadd docker
sudo usermod -aG docker $USER
```

{% endcode %}

### Docker-compose

Docker-compose version must be <= 1.29.

{% code lineNumbers="true" %}

```bash
sudo curl -SL https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
```

{% endcode %}

### Nvidia-docker installation

Nvidia-docker installation documentation is [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html).

{% tabs %}
{% tab title="Ubuntu / Debian" %}
{% code lineNumbers="true" %}

```bash
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      & curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/experimental/$distribution/libnvidia-container.list | \
         sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
         sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
```

{% endcode %}
{% endtab %}

{% tab title="Centos / RHEL" %}
{% code lineNumbers="true" %}

```bash
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
   && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo

sudo yum clean expire-cache
sudo yum install -y nvidia-container-toolkit
```

{% endcode %}
{% endtab %}
{% endtabs %}

Configure the Docker daemon to recognize the NVIDIA Container Runtime:

{% code lineNumbers="true" %}

```bash
sudo nvidia-ctk runtime configure --runtime=docker
```

{% endcode %}

Restart the Docker daemon to complete the installation after setting the default runtime:

{% code lineNumbers="true" %}

```bash
sudo systemctl restart docker
```

{% endcode %}

Test if Nvidia-docker is installed:

{% code lineNumbers="true" %}

```bash
sudo docker run --rm --runtime=nvidia --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi
```

{% endcode %}

This should result in a console output shown below:

```
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.51.06    Driver Version: 470.51.06    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla T4            On   | 00000000:00:1E.0 Off |                    0 |
| N/A   34C    P8     9W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
```

### Configuring daemon.json

Open `/etc/docker/daemon.json` with your favorite text editor.

Add `"default-runtime": "nvidia",`  to the json. Exemple:

{% code title="/etc/docker/daemon.json" lineNumbers="true" %}

```json
{
  "default-runtime": "nvidia",
  "runtimes": {
    "nvidia": {
      "args": [],
      "path": "nvidia-container-runtime
    }
  }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc-op.blurit.io/1.0.0/blurit-on-premise/installation/linux-dependencies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
