Chunkr uses GPU acceleration to significantly improve document processing performance. This guide covers GPU configuration for NVIDIA GPUs.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lumina-ai-inc/chunkr/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Hardware Requirements
- NVIDIA GPU with CUDA support (compute capability 6.0+)
- At least 6GB GPU memory (12GB+ recommended for production)
- Multiple GPUs supported for increased throughput
Software Requirements
- NVIDIA GPU drivers (version 470.x or later)
- NVIDIA Container Toolkit
- Docker Engine 19.03 or later
- Docker Compose V2
Installing NVIDIA Container Toolkit
GPU Configuration in Docker Compose
Chunkr’s defaultcompose.yaml configures GPU access for ML services:
Segmentation Backend
- replicas: 6 - Six worker processes share available GPUs
- count: all - All GPUs are available to workers
- capabilities: [gpu] - Enables GPU support
- /dev/shm - Shared memory for faster data transfer
OCR Backend
- replicas: 3 - Three OCR workers for parallel processing
- Full GPU access for text recognition
The
/dev/shm volume mount enables faster GPU memory transfers and is critical for performance.Performance Tuning
Batch Size Configuration
Adjust batch sizes based on your GPU memory:- 6GB GPU:
MAX_BATCH_SIZE=2 - 8GB GPU:
MAX_BATCH_SIZE=4(default) - 12GB+ GPU:
MAX_BATCH_SIZE=8
Replica Count Optimization
Adjust worker replicas based on GPU count and memory: Single GPU (8GB+):Model Parameters
Fine-tune model inference parameters:Multi-GPU Configuration
To specify exact GPU allocation:Monitoring GPU Usage
Real-time Monitoring
Monitor GPU utilization in real-time:Per-Container GPU Stats
GPU Memory Usage
Switching to CPU-Only Mode
If GPUs are unavailable or for testing, use CPU mode:Troubleshooting
GPU not detected
Check NVIDIA driver:Out of memory errors
-
Reduce batch size:
-
Decrease replica count:
-
Monitor GPU memory:
Performance issues
- Check GPU utilization - Should be >70% during processing
- Verify shared memory - Ensure
/dev/shmis mounted - Review batch settings - Optimize
MAX_BATCH_SIZEandBATCH_WAIT_TIME - Check for GPU throttling - Monitor temperature with
nvidia-smi
Docker Compose GPU errors
Error: “could not select device driver”Best Practices
- Monitor GPU temperature - Keep below 80°C for optimal performance
- Use appropriate batch sizes - Balance throughput vs. memory usage
- Scale replicas carefully - More replicas isn’t always faster
- Regular driver updates - Keep NVIDIA drivers current
- Shared memory mounting - Always include
/dev/shmvolume
Next Steps
- Configure Environment Variables
- Learn about Scaling GPU workers
- Return to Docker Compose Deployment