37 lines
1.2 KiB
YAML
37 lines
1.2 KiB
YAML
# GPU-specific overrides for Docker Compose
|
|
# Usage: docker compose -f compose.yaml -f compose.gpu.yaml --profile server-gpu up
|
|
#
|
|
# This file provides additional NVIDIA GPU configuration options.
|
|
# It is optional - the server-gpu profile in compose.yaml includes sensible defaults.
|
|
|
|
services:
|
|
server-gpu:
|
|
# Override GPU allocation (uncomment to customize)
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
# Use 'all' to use all available GPUs, or specify count
|
|
count: 1
|
|
# count: all
|
|
capabilities: [gpu]
|
|
# Optionally specify device IDs (e.g., for multi-GPU systems)
|
|
# device_ids: ['0']
|
|
|
|
# Additional environment variables for GPU optimization
|
|
environment:
|
|
# PyTorch CUDA settings
|
|
CUDA_VISIBLE_DEVICES: "0"
|
|
# Enable TF32 for better performance on Ampere+ GPUs
|
|
NVIDIA_TF32_OVERRIDE: "1"
|
|
# Memory management
|
|
PYTORCH_CUDA_ALLOC_CONF: "expandable_segments:True"
|
|
|
|
# AMD ROCm-specific overrides (optional)
|
|
server-rocm:
|
|
environment:
|
|
HIP_VISIBLE_DEVICES: "0"
|
|
HSA_OVERRIDE_GFX_VERSION: ""
|
|
AMD_LOG_LEVEL: "1"
|