Ollama Docker AMD GPU setup: when ROCm and Vulkan apply
A team that wants a shared Ollama server in a container on AMD hardware should use the ROCm image tag with the GPU device nodes when ROCm supports the card, and use Vulkan when it does not. Ollama is an open source runtime for running large language models locally, written in Go with a llama.cpp backend, and its REST API listens on port 11434 once the server is running. The container only uses the card if the host passes the GPU through, so the decision is less about Docker itself and more about whether the card's driver stack is one Ollama's ROCm build supports. Start by confirming the card's model against the current support list in the Ollama documentation and the image tags published with each release, since both change between versions.
On the ROCm path, the container needs access to the /dev/kfd compute interface and the /dev/dri render nodes on the host, and the user inside the container must belong to the group IDs that own those devices. Check the group IDs on the host with ls -l /dev/kfd /dev/dri and pass them to the container rather than running it privileged. Confirm that the host kernel driver and ROCm user-space components meet the version requirements listed in the Ollama documentation for the ROCm release you plan to use. Before going further, run a model inside the container and check the Ollama logs for the detected GPU, because a container that starts cleanly can still fall back to the CPU.
If the card is not on the ROCm support list, the Vulkan image tag is the fallback, but it changes the operating assumptions. Vulkan support depends on the host's Vulkan driver and on the device nodes passed through, so the same /dev/dri access and group membership checks still apply. Treat Vulkan as a tested configuration for your exact card and driver version, not a general promise, and record the image tag, driver version and kernel version together so a later upgrade can be rolled back. Ask your hardware vendor and the Ollama release notes which tag to use for each card, and plan a load test before users depend on the server. Because a Vulkan build may be slower or less complete for some models, put the chosen path in your capacity plan rather than assuming parity with NVIDIA.
Which container path fits your AMD card
This table compares the ROCm image tag, the Vulkan path and CPU-only operation for an Ollama container on an AMD host. Read each column as a decision point: start with card support, then check host and device requirements before choosing a path. Confirm the current support matrix and any Vulkan build or configuration against Ollama's documentation and GitHub releases before you commit.
| Path | Card support | Host requirements | Device mappings | What to verify | When it fits |
|---|---|---|---|---|---|
| ROCm image tag | Cards on Ollama's current ROCm support list only; confirm the exact list for your release | Supported AMD driver stack and ROCm v7 driver requirements on the host | /dev/kfd and /dev/dri passed to the container, plus group IDs for device access | GPU detected in server logs and model loads on the GPU, not the CPU | Supported AMD card with a host set up to ROCm v7 requirements |
| Vulkan path | Cards that ROCm does not support, subject to Vulkan build or configuration confirmed in current docs | Vulkan-capable driver on the host; confirm the required packages and Ollama build | /dev/dri passed to the container, with group access for the container user | Vulkan device visible inside the container and reported in logs | ROCm does not support the card and the team accepts a fallback with its own verification |
| CPU-only operation | Any host, no GPU acceleration | Enough system memory for the chosen model and context size | No GPU device mappings required | Token speed and memory use under realistic load | Small models, testing, or a card that neither ROCm nor Vulkan can use |
| Verification effort | Applies to every path | Test host with the same driver and container image as production | Check mappings after host reboots and container recreation | Run a model, confirm the GPU in logs and record the image tag and version | Required before any shared service goes live |
How /dev/kfd and /dev/dri reach the container
Two device paths decide whether Ollama in a container can use an AMD GPU. /dev/kfd is the kernel fusion driver interface that ROCm uses for compute, so it carries the work that loads model weights and runs inference. /dev/dri is a directory of direct rendering nodes, including the card and render nodes that graphics and compute stacks open to reach the GPU. The container needs both mapped in with --device /dev/kfd and --device /dev/dri. Mapping only one usually produces a container that starts but cannot initialize the GPU. Mapping the whole host, or running privileged, gives the container far more access than these two paths require, and that is rarely justified on a shared server.
Device nodes are owned by groups, and the process inside the container must belong to a group that can open them. On most Linux distributions the GPU nodes are owned by the video and render groups, but the numeric group IDs differ between hosts and images, so a name that matches on one machine may not match on another. Pass the host's numeric IDs with --group-add and confirm them with ls -l /dev/kfd /dev/dri and getent group video render on the host. Confirm the exact device nodes and group membership for your distribution and driver stack before you rely on them, because the required set can vary with the kernel driver and ROCm release.
A group mismatch is easy to miss because the container still starts, the API still answers on port 11434, and models still load. Ollama falls back to the CPU when it cannot open the GPU, so responses arrive, only slowly. Check the server logs after startup for the GPU discovery lines and confirm that the model reports GPU use while it is loaded. If the logs show CPU only, treat it as a device permission problem first, not a model problem. Plan this check into your container acceptance test so the fallback is caught before users see slow responses.
How a request reaches the AMD GPU through the container
The request starts at a client on the network and hits the host's published port 11434, which Docker forwards into the Ollama container. The container does not reach the GPU directly. It uses the mapped /dev/kfd and /dev/dri device nodes, and the group IDs granted to the container decide whether those nodes can be opened. Below the device layer sits the host driver stack, which is where a missing or mismatched ROCm driver shows up. The Vulkan branch is the fallback when ROCm does not support a card. Check each hand-off in that order when a request falls back to CPU or fails.
Request path from the API client through the container to the AMD GPU.
Run the ROCm image with device access and check it
This sequence takes a Docker host with an AMD GPU from a confirmed driver state to a running Ollama container that loads a model on the GPU and serves its API on a deliberate address. Each step ends with a check, so a failure shows up at the step that caused it. Confirm exact flags and image tags against current Ollama documentation before you run them.
Confirm the host sees the AMD card
On the Docker host, confirm that the AMD GPU is visible and the driver is loaded before any container is involved. Run
lspci | grep -i vgato find the card, then check that/dev/kfdand the/dev/dridirectory exist. Confirm the ROCm driver version that your card and the current Ollama documentation require, because the driver lives on the host and the container cannot supply it. The step is done when the card appears in the PCI listing and both device nodes are present.Identify the group IDs that own devices
Device nodes are owned by groups, and the user inside the container must belong to those groups to open them. Run
ls -ln /dev/kfd /dev/drito see the numeric group IDs on the nodes, then usegetent groupto map those IDs to names on your host. Record the numeric IDs, since group names can differ between the host and the image. The step is done when you have one numeric group ID for/dev/kfdand one for the render nodes under/dev/dri.Start the container from the ROCm tag
Start the container from the rocm tag of the ollama/ollama image. Map both
/dev/kfdand/dev/driinto the container with--device, and add the group IDs from the previous step with--group-add. Run it detached so the logs can be read withdocker logs. Check the exact tag name and flag syntax in current Ollama documentation before you run it. The step is done whendocker execwithls -l /dev/kfd /dev/drishows both device nodes inside the container and the server starts without device errors in the logs.Persist the model directory with a volume
Mount a named volume or a host directory at the path where Ollama stores models inside the container. Set
OLLAMA_MODELSif you want models written to a different path. Without a mount, models pulled into the container layer are lost when the container is recreated. Make sure the directory is writable by the user the Ollama process runs as. Confirm the default model path in the Ollama FAQ. The step is done whendocker inspectlists the mount and a model file written to it is still present after the container restarts.Bind the API deliberately with OLLAMA_HOST
Ollama binds to 127.0.0.1 on port 11434 by default, and inside a container that address is reachable only from within the container. Set
OLLAMA_HOSTto the address your design needs, and publish the port with-pto the host interface you choose. Keep it off public interfaces unless an access layer, such as a reverse proxy with authentication, sits in front of it. The step is done when a simple request from the host, using the address you chose, gets a response from the server, and a request from a machine you did not intend to allow fails.Load a small model and send one request
Pull a small model into the container with
docker exec, then send one prompt through the API from the host. Choose a model small enough to fit in the memory of the card you confirmed, so that a memory shortfall does not look like a device access failure. Send the request with the same address you set inOLLAMA_HOST. The step is done when the model returns a response and the model appears in the list of models stored in the volume you mounted.Confirm GPU use in container logs
Check that the model ran on the AMD GPU and not on the CPU. Read
docker logsfrom the model load, looking for the messages that name the compute backend and the GPU that was detected. If the logs report CPU only, return to the group IDs and device mappings in the earlier steps, and confirm the driver version again. If ROCm does not support your card, the Vulkan fallback in the next section applies. The step is done when the logs name the AMD GPU as the compute device for the loaded model.
Choosing between the ROCm path and the Vulkan fallback
Choose this path when AMD's current compatibility documentation lists your card and your host driver stack matches what the ROCm image expects. This is the most direct route to GPU acceleration, but it depends on a matching set of host driver and container components, so confirm both before you build anything.
- Preparation: Install the AMD kernel driver on the host, confirm that
/dev/kfdand/dev/driexist, and record the group IDs that own them. - Container changes: Run the
rocmimage tag with--device /dev/kfd --device /dev/dri, add the required group IDs with--group-add, and mount a persistent volume for models. - Verification: Check the container logs for GPU detection, run a small model, and confirm GPU activity with AMD's monitoring tools while the prompt runs.
- Typical failure: The model loads but runs on the CPU because the container cannot open
/dev/kfd. This usually comes from a missing group ID or a host driver that does not match the image.
Confirm card support against the current Ollama and AMD documentation before you choose this path.
Consider Vulkan when ROCm does not support your card but the card has a working Vulkan driver. Whether Ollama uses Vulkan, which image variant includes it and which platforms it covers all change between releases, so verify the setting in current Ollama documentation first. Vulkan results depend heavily on the card and driver, so test speed and stability as separate questions.
- Preparation: Install the vendor's Vulkan driver on the host and confirm it lists the card with a Vulkan information tool.
- Container changes: Pass the same
/dev/dridevices and group IDs, then set the Vulkan enablement variable documented for your Ollama release, using the image variant that release supports. - Verification: Look for the GPU in the startup logs, then run the same fixed prompt on the GPU path and on CPU to confirm the GPU is doing the work.
- Typical failure: Ollama detects the device but quietly runs on the CPU, or a driver update changes behavior after an upgrade. Pin the driver and image versions, then retest after every change.
Confirm the Vulkan setting, image and driver combination your Ollama version supports before you commit to this path.
Choose CPU-only when neither ROCm nor Vulkan works on the card, or when the host has no supported GPU at all. This is an honest outcome, not a failure of the project. It can serve small models to a small group of users, but response times and memory limits set the boundaries of what the service can handle, so write those expectations down before users arrive.
- Preparation: Size memory for the model and its context window, plan the model directory on a disk with room to grow, and agree on the response times users will accept.
- Container changes: Use the standard image without GPU devices or group additions, and remove any GPU-related variables so the container does not expect hardware it lacks.
- Verification: Confirm the startup logs report no GPU, run the same prompt set you used in the GPU tests, and record latency and memory use as a baseline.
- Typical failure: Users expect GPU-level speed from a CPU host, or a container carries leftover device flags from an earlier attempt and fails to start. Test with the real user workload and correct the flags before launch.
Confirm with current Ollama documentation that your chosen model is practical on CPU before you promise a service level to users.
Security risks of passing GPU devices into containers
Passing AMD GPU devices into a container, opening a host port and running as a privileged user each widen what an attacker can reach. The cards below name one risk and one control per item, so the team can decide what to change and what to confirm before the server serves anyone.
Direct access to GPU device nodes
Mapping /dev/kfd and /dev/dri gives the container direct access to kernel driver interfaces on the host, not a virtualized GPU. A flaw in the driver or a compromised container process can reach that interface. Confirm which device nodes your chosen image and card actually need, map only those, and check the driver version on the host against the ROCm release you test with.
Unauthenticated API on the host port
The local Ollama API has no authentication. Publishing port 11434 with -p on a host that other machines can reach exposes every model and endpoint to anyone on that network. Keep the published port bound to 127.0.0.1 where possible, and place an authenticating reverse proxy in front of any address that is shared. Confirm the bind address from inside the running container.
Broad group IDs on the host
Device access depends on the host group IDs that own /dev/kfd and /dev/dri, passed to the container with --group-add. Adding a group that owns more devices than the GPU needs widens access for every process in the container. Confirm the numeric group IDs on your host with ls -l on the device nodes, and add only the groups that grant access to the GPU.
Running the container as root
A container running as root that also holds device access gives a compromised process root-level reach over the mapped devices and any mounted volumes. Run the server as a non-root user where the image and device permissions allow it, and mount the model directory with ownership that user can write. Confirm the effective user with docker exec and id after startup.
Cloud features left enabled
Cloud features send requests to Ollama's hosted services and can be turned off. Where prompts or documents must stay on your infrastructure, set OLLAMA_NO_CLOUD=1 in the container environment or the server configuration file. Confirm the variable reaches the running process, and test that a model call does not leave the network before you approve the setup for regulated data.
Keeping the AMD container stable after go-live
The first successful run proves little about the next six months. Once the container is answering requests on an AMD GPU, the main risk is silent drift: an image tag that moves, a host driver or kernel update that changes how the GPU is exposed, or a group ID that no longer matches the device nodes. Pin the image to a specific tag rather than latest, so every upgrade is a deliberate change you can roll back. Before moving to a newer tag, read the release notes on the Ollama GitHub releases page, paying attention to pre-releases, which the project publishes alongside stable builds. Test the new tag on a non-production host with the same card and driver stack before it reaches the shared server.
Host changes are the most common cause of lost GPU access. After any kernel update, ROCm driver change or Vulkan driver update on the host, check the container logs for GPU detection messages and confirm the model still loads on the GPU rather than falling back to CPU. Then verify that the numeric group IDs used for /dev/kfd and /dev/dri still match the video and render groups on the host, since those IDs can change when a host is rebuilt or reprovisioned. Record the expected IDs in your runbook so a mismatch is a quick comparison rather than a debugging session.
Concurrency settings decide how much of the card's memory is in use at any moment. OLLAMA_NUM_PARALLEL defaults to 1 parallel request per model, OLLAMA_MAX_LOADED_MODELS defaults to 3 times the number of GPUs (or 3 on CPU), and OLLAMA_MAX_QUEUE defaults to 512 queued requests. Set these deliberately, because each parallel slot and each loaded model consumes GPU memory. How many models actually fit depends on VRAM against model size and context length, which the Ollama hardware and GPU sizing guide covers in detail. Confirm your card's usable memory under Vulkan and ROCm separately, since the two backends may report different limits on the same hardware.
What to confirm for your card, driver and image before you start
The AMD path through Docker depends on three things that change independently: the exact GPU model, the image tag and its driver requirements, and the device permissions on the host. Confirm each one against current vendor and Ollama documentation before you build anything, because a mismatch in any of them can leave the container running on the CPU without an obvious error.
Exact card on the ROCm list
Check that your precise GPU model, not just its product family, appears on the AMD ROCm support list for the image tag you plan to use. Architecture support can differ between cards that share a name, and laptop or workstation variants are often listed separately. Record the model name and the tag in your change request so the decision can be reviewed later. If the card is missing from the list, plan for the Vulkan path and test it before you commit to the design.
Ollama FAQHost driver and kernel versions
The ROCm image expects a compatible AMD driver stack on the host, and the kernel version and driver version must fit the requirements published for the tag you choose. Do not assume the host driver shipped by your distribution is correct. Ask the platform team to record the kernel, the driver package and the ROCm release notes they validated against, and confirm them with AMD's compatibility documentation before rollout.
Vulkan build and settings
If ROCm does not support your card, Vulkan may still provide GPU acceleration, but it depends on a build or setting that your Ollama version exposes. Confirm with the Ollama documentation and release notes whether Vulkan is enabled for the image you run, which environment variable or tag selects it, and whether your card's Vulkan driver is installed on the host. Test a small model and check the logs to confirm the GPU is in use.
Ollama releasesGroup IDs across distributions
Access to /dev/kfd and /dev/dri depends on the numeric group IDs for the video and render groups, and those IDs are not the same on every Linux distribution. Read the IDs on the exact host with getent group video render and pass those values to the container. Hard-coding IDs copied from a tutorial is a common cause of permission errors, so verify them on each host image and after any OS upgrade.
Device node permissions
Confirm that /dev/kfd and /dev/dri exist on the host and that the render nodes are readable by the groups you pass into the container. Check the permissions on each device file with ls -l after a reboot, since udev rules can change them. Keep the device mapping as narrow as your tag allows, and document which devices the container receives so security reviewers can see the GPU access it has.
Throughput and memory on this path
Driver support alone does not show that your workload is viable. Run your own models, context lengths and concurrency settings on the ROCm or Vulkan path and measure throughput, latency and VRAM use. Compare the result with the same model on a CPU or a supported GPU, and record which layers ran on the GPU. Results from a small test model do not predict behavior with a larger model at your target context size.
Questions buyers ask about AMD GPUs in Docker for Ollama
Can our own team set up Ollama with an AMD GPU in Docker?
Yes, if your engineers already run Docker on GPU hosts and can verify card and driver support before they start. The core steps are passing /dev/kfd and /dev/dri into the container, adding the host group IDs that let the container user reach those devices, and running the rocm image tag. The harder part is confirming that your specific card is supported by the ROCm release you plan to run, and deciding what to do if it is not. Teams without this experience often lose time on driver mismatches and on container permissions that look correct but still block GPU access. Check the vendor's current support matrix before buying hardware or scheduling work, and use a test host so changes do not reach the shared server first.
What drives the effort of an AMD GPU Docker deployment?
Card support, the driver stack, the security review and testing set most of the effort. Card support decides whether the rocm path works at all. The host driver must match the ROCm requirements for the release you target, so confirm the current requirements instead of assuming an older host setup still fits. Security review adds work because the container receives access to GPU device nodes, and the group IDs you map must fit your host access policy. Testing covers model loading, GPU use and behavior after restarts under your real workload. Each combination of card model, driver version and container image adds another case to test, so a mixed fleet takes more effort than a single host.
What does our team need to provide before a partner starts?
Plan on providing access, a test card, an owner and a security decision before work begins. The work needs the following from your side:
- Root-level access to the GPU host, or a change window with an engineer who holds that access.
- A test AMD card that matches the production model, plus a spare host if the production card is shared with other workloads.
- A named owner who can approve changes to device access, group mappings and the container image source.
- Security sign-off on GPU device exposure and on the network path to port 11434, which is where the Ollama API listens by default.
Agree these items in the written scope so that delays from access or approvals do not appear later as unplanned work.
Does self-hosting Ollama on AMD hardware cost money?
Running Ollama on your own hardware carries no license fee, and the Ollama pricing page says running models on your own hardware is always unlimited. Paid plans apply to cloud models: Pro at $20 per month ($200 per year), Max at $100 per month, Team at $500 per month and Enterprise at custom pricing. Your costs for this work are the GPU hardware, host time, the engineering effort to verify the card and driver stack, and any partner fees, which follow from a written scope. Recurring costs include power, maintenance and the team time spent on upgrades and retesting. Ask for a quote that separates one-time setup from ongoing support, and confirm whether any cloud plan is in scope at all.
How long does an AMD GPU Docker setup take?
Duration depends on the card and driver checks, the number of hosts and the testing your security team requires. No duration figure is supplied for this work, so treat any date as provisional until the scope is written. A host with a card already on the support list and a suitable driver stack moves faster than one where the card must be verified first or a driver must change on a shared machine. Ask for milestones tied to card verification, a working container with GPU access, a model load test and a security review. Those milestones show progress clearly without relying on a single estimate made before the checks are complete.
What happens if ROCm does not support our AMD card?
The fallback is Vulkan, which may run Ollama on cards the ROCm path does not cover, but only if the Vulkan path works on your specific card. Verify that first rather than assuming it. Start by confirming the card against the ROCm support list. If it is not listed, test the Vulkan configuration on the same host and measure model loading and response behavior under your workload. Record the image, driver and card combination as a separate, named configuration so operators know which setup is in use. Retest after every driver or image update, because a change that works today can break a fallback path without any warning.
Which host settings should we check before the first container start?
Check the device nodes, group IDs, driver version and network binding before you start the first container. The checks are:
/dev/kfdand/dev/driexist on the host and are passed into the container.- The group IDs that own those device nodes on the host are added to the container user so it can open them.
- The host driver version fits the ROCm requirements for the release you run.
- The Ollama bind address is set with
OLLAMA_HOSTonly as far as your design needs, since the default bind address is 127.0.0.1 on port 11434. - Model storage is on a volume you control, with the path set through
OLLAMA_MODELS.
Record each value in the runbook so a later upgrade can be compared against a known state.
How DeployOpen scopes and delivers AMD GPU container setups
DeployOpen plans, builds, documents and supports Ollama in Docker on AMD GPUs inside infrastructure you control. The work starts with a written scope that records your host, card model, driver level and fallback decision, then moves through a tested build and a handover your team can run.
How we scope
- Record the host OS, AMD card models and kernel driver level before choosing the ROCm or Vulkan path
- Confirm which GPU device nodes, group IDs and container runtime settings the target host exposes
- Agree in writing which models, concurrency settings and persistent model volumes the engagement covers
How we build
- Build the container with the rocm image tag or the Vulkan configuration, depending on the scoping result
- Verify device access through /dev/kfd and /dev/dri with the group IDs your host actually uses
- Test model loading and inference on each card, and document the fallback path for any unsupported card
How we hand over
- Deliver the compose or run configuration, host prerequisites and model volume layout as versioned files
- Provide a runbook covering driver checks, image upgrades and the steps to switch a card between ROCm and Vulkan
- Walk your platform team through the verification checklist so they can repeat it after changes
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer when your team wants us to keep the setup current
- Retest the container after Ollama and driver upgrades, since the supported card list can change between releases
- Engagements are fixed-scope, so any additional card, host or integration is agreed in writing before work starts

