MCP Context Server uses Ollama for local embedding generation and summary inference. Ollama supports GPU acceleration on NVIDIA, AMD, and Intel hardware. Since MCP Context Server communicates with Ollama via HTTP, GPU configuration is purely an Ollama infrastructure concern -- no application code changes are needed.
GPU acceleration primarily benefits larger models. For the default 0.6B parameter models (qwen3-embedding:0.6b, qwen3:0.6b), CPU-only performance is often adequate.
| GPU Vendor | Docker (Linux host) | Docker Desktop (Windows) | Kubernetes (Helm) | Native (Host) | Status |
|---|---|---|---|---|---|
| NVIDIA (CUDA) | Supported | Supported (GPU-PV) | Supported | Supported | Stable |
| AMD (ROCm) | Supported | Not supported | Supported | Supported | Stable |
| Intel (Vulkan) | Experimental | Not supported | Not recommended | Experimental | Experimental |
Docker Desktop on Windows uses the WSL2 backend for GPU access. GPU passthrough in this environment is NVIDIA-only via the NVIDIA Container Toolkit and GPU Paravirtualization (GPU-PV).
Key limitations:
- Intel and AMD GPUs are NOT supported in Docker Desktop on Windows. The AMD/ROCm and Intel/Vulkan GPU sections in Docker Compose files require
/dev/dridevice nodes, which are Linux-native DRM (Direct Rendering Manager) devices. WSL2 exposes GPU via/dev/dxg(DirectX), not/dev/dri. - Intel/Vulkan acceleration requires native Ollama on Windows. See Hybrid Deployment Pattern (Windows) below for running Ollama natively while keeping the MCP Context Server in Docker.
- GPU acceleration in Docker containers primarily benefits models larger than approximately 3B parameters. For the default 0.6B models, CPU-only performance is adequate.
If you need Intel or AMD GPU acceleration with Docker, use a native Linux host where /dev/dri is available.
All Ollama-based Docker Compose files include commented GPU configuration sections for each vendor. Uncomment the section that matches your GPU.
All nine Ollama-based Compose files follow the same pattern:
docker-compose.sqlite.ollama.ymldocker-compose.sqlite.ollama.local.ymldocker-compose.sqlite.ollama-openai.ymldocker-compose.postgresql.ollama.ymldocker-compose.postgresql.ollama.local.ymldocker-compose.postgresql.ollama-openai.ymldocker-compose.postgresql-external.ollama.ymldocker-compose.postgresql-external.ollama.local.ymldocker-compose.postgresql-external.ollama-openai.yml
Prerequisites:
- NVIDIA GPU driver installed on the host
- NVIDIA Container Toolkit installed
Steps:
Uncomment the NVIDIA GPU section in the ollama service of your Docker Compose file:
# --- NVIDIA GPU (requires NVIDIA Container Toolkit) ---
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]Verify:
docker compose -f deploy/docker/<your-compose-file> exec ollama nvidia-smiPrerequisites:
- AMD GPU with ROCm support
- ROCm driver installed on the host
Steps:
- Override the Ollama image to the ROCm-tagged variant in the
ollamaservice. Each Ollama-based Compose file already includes a commented alternative immediately below the defaultimage:line:
services:
ollama:
image: ollama/ollama:rocmApply the override either by uncommenting the # image: ollama/ollama:rocm line in your chosen Compose file, or by adding the snippet above to a Docker Compose override file (e.g., docker-compose.override.yml) loaded alongside the base file.
- Uncomment the AMD GPU section in the same
ollamaservice:
# --- AMD GPU (requires ROCm driver on Linux host; also switch to image: ollama/ollama:rocm above) ---
devices:
- /dev/kfd:/dev/kfd
- /dev/dri:/dev/dri
group_add:
- video
- render- Restart the stack to apply the new image and device passthrough:
docker compose -f deploy/docker/<your-compose-file> up -dThe first start with the ROCm image pulls ollama/ollama:rocm from Docker Hub (no local build).
Verify:
docker compose -f deploy/docker/<your-compose-file> exec ollama rocm-smiWarning: Intel Vulkan GPU support in Ollama is experimental. Known issues include gibberish or degraded output on Intel integrated GPUs, particularly on Alder Lake, Raptor Lake, Arrow Lake, and Meteor Lake architectures. Test with Ollama outside Docker first before deploying in containers. The AMD and Intel/Vulkan GPU sections require
/dev/dridevice nodes and are Linux host only -- they do not work on Docker Desktop for Windows (WSL2). See Windows Docker Desktop Limitations.
Known issues:
- Gibberish/degraded output on Intel iGPUs (ollama#13086, ollama#13108)
- Model quality degradation with larger models (ollama#13964)
- Vulkan cannot be reliably disabled once enabled (ollama#13212)
- Integer dot product issues on Intel GPUs (llama.cpp#17106)
- Integrated GPUs (Intel and AMD) with 0 bytes dedicated VRAM fail Vulkan device enumeration (ollama#13023, ollama#13103)
- AMD iGPUs (Radeon 760M, 860M) with shared VRAM also fail Vulkan detection (ollama#14527, ollama#14562)
Steps:
- Uncomment
OLLAMA_VULKAN=1in theenvironmentsection of theollamaservice:
environment:
- OLLAMA_HOST=0.0.0.0
- OLLAMA_KEEP_ALIVE=-1
- EMBEDDING_MODEL=${EMBEDDING_MODEL:-qwen3-embedding:0.6b}
- SUMMARY_MODEL=${SUMMARY_MODEL:-qwen3:0.6b}
- OLLAMA_VULKAN=1- Uncomment the Intel/Vulkan GPU section:
# --- Intel/Vulkan GPU (EXPERIMENTAL - see docs for known issues) ---
devices:
- /dev/dri:/dev/dri
group_add:
- video
- render- If output is gibberish, also uncomment the workaround environment variable:
- GGML_VK_DISABLE_INTEGER_DOT_PRODUCT=1Additional workarounds:
| Environment Variable | Effect |
|---|---|
GGML_VK_DISABLE_INTEGER_DOT_PRODUCT=1 |
Disables integer dot product optimization |
GGML_VK_VISIBLE_DEVICES=-1 |
Disables all Vulkan GPUs (fallback to CPU) |
OLLAMA_NUM_GPU=0 |
Forces CPU-only inference |
OLLAMA_FLASH_ATTENTION=0 |
Disables flash attention (may help small models) |
Requires the NVIDIA device plugin for Kubernetes.
In values.yaml or via --set:
ollama:
enabled: true
resources:
limits:
nvidia.com/gpu: "1"Requires the AMD GPU device plugin for Kubernetes.
In values.yaml or via --set:
ollama:
enabled: true
image:
tag: "rocm"
resources:
limits:
amd.com/gpu: "1"Intel/Vulkan GPUs are not recommended for Kubernetes deployments due to the experimental Vulkan quality issues described above and the lack of a widely adopted device plugin. Use CPU-only or consider IPEX-LLM as an alternative.
CUDA is automatically detected by Ollama when NVIDIA drivers are installed. No environment variables needed.
# Verify GPU detection
ollama run qwen3:0.6b "test"
# Check GPU utilization
nvidia-smiInstall ROCm and use the ROCm-compatible Ollama build.
# Verify ROCm installation
rocm-smi
# Verify device nodes
ls -la /dev/kfd /dev/dri/renderD*Set OLLAMA_VULKAN=1 before starting Ollama. The same quality warnings apply.
OLLAMA_VULKAN=1 ollama serveOn Windows, run Ollama natively to access GPU acceleration while keeping MCP Context Server in Docker:
-
Install Ollama on Windows from ollama.com
-
Start Ollama with Vulkan (if Intel/AMD GPU):
$env:OLLAMA_VULKAN = "1"
$env:OLLAMA_HOST = "0.0.0.0"
ollama serve- Update Docker Compose -- point to host Ollama instead of sidecar:
services:
mcp-context-server:
environment:
- OLLAMA_HOST=http://host.docker.internal:11434
# Remove or comment out: depends_on: ollama
# Comment out or remove the ollama service entirely
# ollama:
# ...- Pull required models on the host:
ollama pull qwen3-embedding:0.6b
ollama pull qwen3:0.6bNote:
host.docker.internalresolves to the host machine from within Docker Desktop containers on Windows and macOS.
Integrated GPUs share system RAM and have no dedicated VRAM. Key considerations:
- For small models (0.6B parameters), CPU-only may perform comparably to iGPU inference
- Vulkan quality risks make CPU-only the safer choice for production workloads
- IPEX-LLM is a third-party Intel-specific fork with potentially better Intel GPU support (not integrated in this project)
sudo setsebool container_use_devices=1Ensure the user is in the video and render groups:
sudo usermod -aG video,render $USER
# Log out and back in for group changes to take effectFollow the NVIDIA Container Toolkit installation guide.
Verify installation:
docker run --rm --gpus all nvidia/cuda:12.0-base nvidia-smi# Verify ROCm installation
rocm-smi
# Check device nodes exist
ls -la /dev/kfd /dev/dri/renderD*
# If missing, install ROCm drivers
# See: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/- Try adding
GGML_VK_DISABLE_INTEGER_DOT_PRODUCT=1to the environment - Try adding
OLLAMA_FLASH_ATTENTION=0(may help with very small models) - Fall back to CPU: set
OLLAMA_NUM_GPU=0 - Test outside Docker first:
OLLAMA_VULKAN=1 ollama serve
# NVIDIA: check runtime
docker info | grep -i nvidia
# AMD: check device nodes are passed through
docker compose exec ollama ls -la /dev/kfd /dev/dri/
# General: check Ollama logs for GPU detection
docker compose -f deploy/docker/<your-compose-file> logs ollama | grep -i gpuTo diagnose GPU detection issues, run Ollama with debug logging:
# Linux/macOS
OLLAMA_VULKAN=1 OLLAMA_DEBUG=1 ollama serve
# Windows (PowerShell)
$env:OLLAMA_VULKAN = "1"
$env:OLLAMA_DEBUG = "1"
ollama serveWhat to look for in logs:
runner enumerated devices-- GPU discovery completedtotal_vram=0 B-- No GPU VRAM detected (CPU fallback)devices=[]-- No Vulkan-compatible devices foundoffloaded N/M layers-- N of M model layers are on GPU
Common diagnostic outcomes:
devices=[]+total_vram=0 B: Vulkan device enumeration failed. Common with integrated GPUs that report 0 bytes dedicated VRAM.offloaded 0/N layers: GPU detected but model not offloaded. Try increasing available VRAM or use a smaller model.- No GPU-related log lines: Ollama did not attempt GPU discovery. Verify
OLLAMA_VULKAN=1is set.
For deeper investigation, use OLLAMA_DEBUG=2 for trace-level logging.
Integrated GPUs sharing system RAM (no dedicated VRAM) commonly fail Ollama's Vulkan device enumeration. This affects:
- Intel UHD (Alder Lake, Raptor Lake, Arrow Lake, Meteor Lake)
- AMD Radeon integrated (760M, 860M, and similar RDNA 3 iGPUs)
Expected behavior: devices=[], total_vram=0 B, CPU-only fallback. This is a known upstream Ollama limitation, not a configuration error.
Workaround: For 0.6B parameter models, CPU-only inference is adequate. For larger models requiring GPU acceleration, use a discrete NVIDIA GPU.
| Configuration | Inference Speed | Recommendation |
|---|---|---|
| NVIDIA GPU (CUDA) | Fastest | Recommended for production |
| AMD GPU (ROCm) | Fast | Good alternative |
| Intel iGPU (Vulkan) | Variable | Not recommended for production |
| CPU-only | Slower | Safe, reliable default |
For 0.6B parameter models (qwen3-embedding:0.6b, qwen3:0.6b), CPU-only performance is reasonable. GPU acceleration provides the most benefit for larger models.
- Docker Deployment Guide - Docker Compose deployment with GPU sections
- Helm Deployment Guide - Kubernetes deployment with GPU resources
- Ollama GPU Documentation - Upstream Ollama GPU reference