-
Notifications
You must be signed in to change notification settings - Fork 50
Using Docker and GPU Acceleration
As there is currently no official GPU enabled Docker image for Cineast, this short guide should provide all the necessary information to get started.
While Docker allows us to use CUDA without tediously installing it on our host machine, we need to install the NVIDIA GPU driver, the NVIDIA container runtime and Docker.
If you have already installed these, you can skip ahead to the step Docker Image
.
Please keep in mind, that the concrete steps may become outdated and you should always check the official websites for the most current instructions.
For some reason, some versions of the NVIDIA server GPU drivers install a desktop environment and enable sleep and hibernation, which can cause your server to become unresponsive until woken up through a USB connected device. To prevent this, you can preemptively disable sleep and hibernation as follows:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
- Find out which drivers are available:
apt list "nvidia-driver-*"
- Install most recent server driver, e.g.:
sudo apt install nvidia-driver-510-server
sudo reboot
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt update
sudo apt install nvidia-container-runtime
Please follow the official documentation.
To use the GPU capabilities of the TensorFlow based Cineast features, you will need a Docker image with the correct version of CUDA installed. For the best chance of success, we recommend basing this Docker image off of the official TensorFlow Docker image, as this should contain the right versions of binaries required by TensorFlow Java.
# Use tf-gpu image
FROM tensorflow/tensorflow:latest-gpu
# Install required tools
RUN apt update && apt install openjdk-17-jdk-headless -y
To start the container, you will need to enable GPU passthrough, mount your data and Cineast directories and modify your user in the container to set the correct user ID for output written to the host file system:
docker run --gpus all -it --rm -v /host/data/:/data/ -v /host/cineast/:/cineast/ -u "$(id -u "$USER")" cuda-java:latest
- Home
- Setup
- Environment Setup
- Getting Started
- Optional: Retrieval Setup Guide
- Research: Working with Existing Data
- Working with Multimedia Data
- Advanced
- API Documentation
- CLI