Next up from the Docker site, how to actually enable the GPU in a Docker Compose file.

Example of a Compose file for running a service with access to 1 GPU device

services: test: image: nvidia/cuda:12.3.1-base-ubuntu20.04 command: nvidia-smi deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu]