Goal: Configure Docker to access your host GPU, stand up a containerized Ollama + Open WebUI stack, pull a small free model, and get a first hands-on look at the CPU-vs-GPU throughput difference. Steps:
nvidia-smi directly on the host. You should see your GPU listed.sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
docker run --rm --gpus all ubuntu nvidia-smi
If this fails with a runtime error, that's the classic missing-runtime issue — re-run step 2, confirm /etc/docker/daemon.json now lists the nvidia runtime, and restart Docker again before retrying.
docker-compose.yml that runs two services: ollama (image ollama/ollama, with a deploy.resources.reservations.devices block requesting driver: nvidia, capabilities: [gpu]) and open-webui (image ghcr.io/open-webui/open-webui:main) connected to the Ollama service. Bring the stack up with docker compose up -d.docker exec -it <ollama-container-name> ollama pull llama3.2:3b
llama3.2:3b model, and confirm you can chat with it end to end (browser → Open WebUI → Ollama → GPU).llama3.2:3b once with the GPU passthrough active, and once forcing CPU-only (e.g., by temporarily removing the deploy GPU block and restarting the container, or using CUDA_VISIBLE_DEVICES="" if supported by your setup). Record tokens/sec (or generation time) for a fixed prompt in both cases, using ollama run llama3.2:3b --verbose or the API's timing fields.Deliverables: Submit your docker-compose.yml file, a screenshot of a successful docker run --rm --gpus all ubuntu nvidia-smi output, your CPU-vs-GPU benchmark numbers, and your written reflection (via file upload or text entry).