Skip to content

Install on Ubuntu (old)

f0cker edited this page Dec 14, 2023 · 1 revision

Setup Docker

Install Docker CE on Ubuntu

Guide taken from here here: https://docs.docker.com/v17.09/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository:

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
sudo apt-get update
sudo apt-get install docker-ce

Install docker-compose

See here for latest version https://docs.docker.com/compose/install/#install-compose.

sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Install Drivers

To Install OpenCL drivers follow the guide here:

https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2023-0/apt.html

wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-oneapi-runtime-libs intel-oneapi-runtime-opencl

Or

For Nvidia you will need the nvidia container runtime package installed. Follow the steps here:

https://github.com/NVIDIA/nvidia-docker

Ubuntu Nvidia Runtime Install

The Nvidia Runtime container toolkit is required to pass the GPUs through to the Docker containers.

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
sudo apt-get install nvidia-container-runtime

Or

ADD AMD GUIDE HERE

Installation

When you have finished the pre-installation you then need to run the install script. It requires just one argument which is your preferred driver/os setup. This is the OS used by the docker container so it doesn't necessarily need to be the same as the host OS:

sudo ./install.sh docker/opencl/ubuntu

After this the docker images will be built. However, some configuration is needed before launching. See the Configuration page for the next steps.

Note: There is an open issue with some versions of Docker/Docker-compose where docker-compose does not recognise the Nvidia runtime. If you see this error:

ERROR: for crackq Cannot create container for service crackq: Unknown runtime specified nvidia

Apply the workaround noted here. Which is just adding the following to your /etc/docker/daemon.json file:

{
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}