CentOS 7 Server Preparation

To prepare a server on CentOS 7 for the FindFace Multi deployment, follow the instructions below minding the sequence.

Note

For other platforms, please refer to the following resources:

In this section:

Install Updates

  1. Run updates and reboot the server.

    sudo yum update
    sudo reboot
    
  2. Install fuse by running the following command.

    sudo yum -y install fuse
    

GPU: Install NVIDIA Drivers

The first step of the server preparation is the NVIDIA driver installation. It’s applicable only for the GPU configuration. Go straight to the Docker installation if your configuration is CPU-accelerated.

With the GPU-accelerated FindFace Multi, you’ll need the NVIDIA driver version 530 or above. Download a relevant .run installer from NVIDIA Driver Downloads.

Since you use a .run installer from NVIDIA, the following dependencies must be installed:

sudo yum install kernel-devel gcc kernel-headers

Install Docker Products

Docker products must be installed on both CPU and GPU servers. Do the following:

  1. Install the yum-utils package (which provides the yum-config-manager utility) and set up the repository.

    sudo yum install -y yum-utils
    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    
  2. Install the latest versions of Docker products.

    sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    
  3. Start Docker.

    sudo systemctl start docker
    
  4. Check whether the Docker installation was a success. The following command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.

    sudo docker run hello-world
    
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    2db29710123e: Pull complete
    Digest: sha256:aa0cc8055b82dc2509bed2e19b275c8f463506616377219d9642221ab53cf9fe
    Status: Downloaded newer image for hello-world:latest
    
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    
    To generate this message, Docker took the following steps:
    1. The Docker client contacted the Docker daemon.
    2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
       (amd64)
    3. The Docker daemon created a new container from that image which runs the
       executable that produces the output you are currently reading.
    4. The Docker daemon streamed that output to the Docker client, which sent it
       to your terminal.
    
    To try something more ambitious, you can run an Ubuntu container with:
    $ docker run -it ubuntu bash
    
    Share images, automate workflows, and more with a free Docker ID:
    https://hub.docker.com/
    
    For more examples and ideas, visit:
    https://docs.docker.com/get-started/
    
  5. Install docker-compose.

    sudo curl -SL https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
    sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
    
  6. Perform the Docker Engine post-installation procedures to ease your future work with Docker and FindFace Multi containers. Once you can manage Docker as a non-root user, you don’t have to apply sudo in the commands related to Docker.

    sudo groupadd docker
    sudo usermod -aG docker $USER
    newgrp docker
    
  7. Configure the Docker network to use devicemapper.

    sudo su
    BIP=10.$((RANDOM % 256)).$((RANDOM % 256)).1
    cat > /etc/docker/daemon.json <<EOF
    {
        "storage-driver": "devicemapper"
    }
    EOF
    

GPU: Install NVIDIA Container Runtime

To deploy containerized GPU-accelerated FindFace Multi, you need NVIDIA Container Runtime. We recommend installing NVIDIA Container Toolkit that includes this runtime. Do the following:

  1. Specify the repository and install NVIDIA Container Toolkit from it by executing the following commands.

    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
    sudo nvidia-ctk runtime configure --runtime=docker
    sudo systemctl restart docker
    
  2. Configure the Docker network to use devicemapper and the NVIDIA Container Runtime installed along with NVIDIA Container Toolkit.

    sudo su
    BIP=10.$((RANDOM % 256)).$((RANDOM % 256)).1
    cat > /etc/docker/daemon.json <<EOF
    {
        "bip": "$BIP/24",
        "fixed-cidr": "$BIP/24",
        "runtimes": {
             "nvidia": {
                 "path": "nvidia-container-runtime",
                 "runtimeArgs": []
             }
        },
        "default-runtime": "nvidia",
        "storage-driver": "devicemapper"
    }
    EOF
    
  3. Restart Docker.

    systemctl restart docker
    

Now you are all set to install FindFace Multi. Refer to the following sections: