Skip to main content
Glama
GPU_SETUP.md2.35 kB
# GPU Setup for Nanonets MCP Server ## Issue Docker Compose GPU configuration doesn't work reliably even with Docker Compose v2.33.1 and multiple syntax approaches tested. ## ✅ Working Solution (Recommended) Use direct `docker run` command with `--gpus all` flag: ```bash # Stop any existing container docker stop nanonets-mcp-server 2>/dev/null || true docker rm nanonets-mcp-server 2>/dev/null || true # Run with reliable GPU access docker run -d \ --name nanonets-mcp-server \ --gpus all \ -p 8005:8000 \ -v nanonets_mcp_huggingface_cache:/app/.cache/huggingface \ --restart unless-stopped \ nanonets-mcp:latest ``` ## Performance Results - **CPU**: 674+ seconds (11+ minutes) ❌ - **GPU (first run)**: 55.67 seconds ✅ - **GPU (cached)**: 23.33 seconds ✅ **23x faster than CPU!** ## Verification ```bash docker exec nanonets-mcp-server python -c " import torch print(f'CUDA available: {torch.cuda.is_available()}') print(f'GPU count: {torch.cuda.device_count()}') if torch.cuda.is_available(): print(f'GPU: {torch.cuda.get_device_name(0)}') " ``` Expected output: ``` CUDA available: True GPU count: 2 GPU: NVIDIA GeForce RTX 4090 ``` ## ❌ Docker Compose Issues Tested All of these approaches **failed** to provide GPU access: 1. **Deploy resources syntax**: ```yaml deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu] ``` 2. **Runtime nvidia**: ```yaml runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all ``` 3. **Device requests** (not supported in this version) ## System Info - **Docker Compose**: v2.33.1 - **Docker Engine**: Latest with nvidia runtime available - **NVIDIA Container Toolkit**: Installed and working - **Host**: Linux with RTX 4090s ## Root Cause Analysis Docker Compose GPU support has known limitations: - Runtime behavior varies across Docker Engine versions - NVIDIA Container Toolkit integration inconsistencies - Some systems require Docker Swarm mode for `deploy.resources` to work - GPU device passthrough is more complex in Compose vs direct Docker ## Recommendation **Use the `docker run --gpus all` approach** for production deployments requiring GPU acceleration. It's universally supported and provides consistent 23-second OCR performance.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ArneJanning/nanonets-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server