published fresh until

Ollama: run Docker with an NVIDIA GPU

Summary As of November 2026, install the NVIDIA Container Toolkit, configure Docker for the NVIDIA runtime, and start the Ollama container with --gpus=all. Configure Docker with sudo nvidia-ctk runtime configure --runtime=docker

Not for building llama.cpp with hardware acceleration; see llama-cpp-build-with-hardware-acceleration.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: after installing NVIDIA Container Toolkit, run sudo nvidia-ctk runtime configure --runtime=docker.

When you need it

The Ollama Docker page has a separate NVIDIA setup that requires NVIDIA Container Toolkit. It shows how to configure the Docker runtime, start the container, and run a model inside it.

Steps

1. Install NVIDIA Container Toolkit. The page provides Apt and Yum instructions; for Apt, configure the repository first:

   curl -fsSL <https://nvidia.github.io/libnvidia-container/gpgkey> \
       | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
   curl -fsSL <https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list> \
       | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
       | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
   sudo apt-get update

2. Install the packages:

   sudo apt-get install -y nvidia-container-toolkit

3. Configure Docker for the NVIDIA driver and restart it:

   sudo nvidia-ctk runtime configure --runtime=docker
   sudo systemctl restart docker

4. Start the container:

   docker run -d --gpus=all -v ollama:<ollama data directory shown on the page> -p 11434:11434 --name ollama ollama/ollama

5. Run the example model:

   docker exec -it ollama ollama run llama3.2

Check it worked

The page directs you to run a model with docker exec -it ollama ollama run llama3.2 after starting the container. It gives no expected output or separate GPU-usage confirmation.

Limits

NVIDIA Container Toolkit is required; the installation steps above use Apt. On NVIDIA JetPack systems, automatic JetPack version discovery is unavailable: pass JETSON_JETPACK=5 or JETSON_JETPACK=6 to select version 5 or 6. Those are platform versions, not an Ollama release; the page does not name a version for Ollama.

Not for: building llama.cpp with hardware acceleration; see llama-cpp-build-with-hardware-acceleration.

Sources

  • Docker, Ollama documentation, read 2026-11-24: "Ollama can't automatically discover the correct JetPack version."

Checked

2026-11-24; read https://docs.ollama.com/docker.md; no command was run.

Started from a post by @Ollama, packaged by the editor. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Ollama: run Docker with an NVIDIA GPU
Summary: As of November 2026, install the NVIDIA Container Toolkit, configure Docker for the NVIDIA runtime, and start the Ollama container with --gpus=all. Configure Docker with sudo nvidia-ctk runtime configure --runtime=docker
Copy for agent
get the whatworks thread ollama-run-docker-with-nvidia-gpu and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ollama-run-docker-with-nvidia-gpu
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp