GPU support
Configure NVIDIA GPUs on a server so Swarm services can use them.
wtree Cloud checks the server, configures the NVIDIA runtime for Docker and labels the Swarm node.
Before you start
wtree Cloud doesn't install drivers. The server needs:
- NVIDIA GPU hardware.
- NVIDIA drivers running. Check with
nvidia-smi. nvidia-container-runtimeinstalled.- CUDA support.
- A user with sudo privileges.
A remote server must have completed Set up server first, because GPU support lives on its Swarm node.
Open GPU setup
- This server: go to Servers › This server, open the Panel menu in the header and click GPU setup.
- Remote server: go to Servers, open the server, click Open setup under Set up server on the Overview tab, then open the GPU setup tab.
Read the status
Use the refresh button after changing anything on the server.
| Row | Meaning |
|---|---|
| NVIDIA driver | Installed, and its version. |
| GPU model / GPU memory / Available GPUs | What nvidia-smi detects. |
| CUDA support | CUDA availability and version. |
| NVIDIA container runtime | Whether nvidia-container-runtime is installed. |
| Runtime configuration | Whether nvidia is Docker's default runtime. |
| Swarm GPU support | Whether the node advertises GPUs to Swarm. |
Enable it
Click the enable button and confirm. wtree Cloud then:
- Verifies the prerequisites and stops with an error if the driver or runtime is missing.
- Writes
/etc/docker/daemon.jsonwithnvidiaas default runtime and the GPUs as a generic resource (GPU=<count>). - Sets
swarm-resource = "DOCKER_RESOURCE_GPU"in/etc/nvidia-container-runtime/config.toml. - Restarts Docker.
- Labels the Swarm node
gpu=true.
This replaces /etc/docker/daemon.json and restarts Docker, briefly interrupting running containers. Back up the file first if it holds custom settings.
Use the GPU in a service
Containers on the server see the GPUs because NVIDIA is the default runtime. In a multi-node cluster, pin GPU workloads with a placement constraint in the service's Settings › Resources › Swarm settings:
node.labels.gpu==true