Server Setup

Prerequisite

Use the following script to set up an on-premises server service.

  1. Install the docker.

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
#add docker to user group
sudo gpasswd -a $USER docker
#now restart your terminal for accessing docker without sudo
  1. Run the "docker ps" to confirm the installation of the docker.

ubuntu@ip-172-31-35-153:~$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
  1. Install the docker-compose. Make sure that the latest version of docker-compose is installed.

sudo apt-get remove docker-compose
sudo rm /usr/local/bin/docker-compose
pip uninstall docker-compose


VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*\d')
DESTINATION=/usr/local/bin/docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION
sudo chmod 755 $DESTINATION
  1. Run the “docker-compose --version” to confirm the installation of the docker-compose.

ubuntu@ip-172-31-35-153:~$ docker-compose --version
Docker Compose version v2.17.2

Attention:

Perform steps 5 through 8 for GPU processing only.

  1. Install the nvidia drivers for GPU processing.

sudo apt update
sudo apt upgrade -y
sudo apt install nvidia-driver-515 nvidia-dkms-515 -y
[reboot required after this step]
  1. Run the “nvidia-smi” to confirm the installation of the nvidia drivers.

ubuntu@ip-172-31-35-153:~$ nvidia-smi
Tue Apr 18 10:11:41 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.105.01   Driver Version: 515.105.01   CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| 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            Off  | 00000000:00:1E.0 Off |                    0 |
| N/A   46C    P0    26W /  70W |      2MiB / 15360MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
  1. Install the nvidia-cuda-runtime.

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu20.04/nvidia-docker.list >> nvidia-docker.list
sudo mv nvidia-docker.list /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update
sudo apt -y install nvidia-container-toolkit
sudo systemctl restart docker
  1. Run the “nvidia-container-toolkit --version” to confirm the installation of the nvidia-cuda-runtime.

ubuntu@ip-172-31-35-153:~$ nvidia-container-toolkit --version
NVIDIA Container Runtime Hook version 1.13.0
commit: b7079454b5b8fed1390ce78ca5a3343748f62657

Last updated