# Inference Node Container Detection

> An inference node reports direct-process instead of container execution, shows no container capacity, or fails container verification. Covers every Docker detection reason code and its fix.

An inference node probes Docker once at startup and declares one execution class from the result. When the probe does not reach `AVAILABLE`, the node registers as direct-process and becomes ineligible for container workloads. The node reports a stable reason code; this guide maps every code to its fix.

The commands here run on the inference-node host. That is expected: they repair host prerequisites such as drivers, Docker, and device permissions, which are part of preparing a machine, not routine platform operation. Everything the platform itself does stays in the control plane.

## Symptoms

- A server shows **Direct-process** in the fleet view when container execution was expected
- A GPU server shows no container capacity and receives no container replicas
- The server detail view shows a container-runtime error beneath the execution class
- Container verification fails when triggered from the control plane
- The node is healthy, telemetry flows, and GPUs appear correctly, but no container replica schedules

Telemetry arriving normally is expected here. The node's connection to the control plane, its hardware detection, and its metrics are all independent of container detection, so a node with a Docker fault still looks alive.

## Step 1: Read the verdict

Open the inference node in the control plane. The execution class and its reason code appear together. The reason code is the identifier used throughout this guide.

Open the inference node's actions menu and select **Verify containers** to run the on-demand check. The result shows all three checks, their elapsed time and detail, and whether the temporary container was removed. If the action says control-plane verification is unavailable, that inference node does not yet advertise the diagnostic capability; use `onprem-ai-node doctor --verify-containers` directly on the inference node until its software and control-plane contract are upgraded.

## Step 2: Read the probe trace

Every check the node performed is in the service log with a fixed prefix:

```bash
# systemd
journalctl -u onprem-ai-inference-node | grep "Docker runtime"

# launchd
log show --predicate 'process == "onprem-ai"' --last 1h | grep "Docker runtime"
```

The trace lists every check, in order, with its result. Checks after a fatal failure appear as `skipped` with the name of the check that stopped the sequence, so the trace always accounts for all of them.

```text
Docker runtime check: name=docker-daemon-reachable result=failed elapsed_ms=3 detail=ConnectionRefusedError: [Errno 61] Connection refused
Docker runtime check: name=gpu-reachable-from-containers result=skipped detail=short-circuited by docker-daemon-reachable
Docker runtime probe: status=misconfigured execution_class=direct-process reason_code=docker-daemon-not-running retryable=true passed=2 failed=1 skipped=4
```

Send this block to support. It is the complete decision, including which socket paths were tried and what each one answered:

```text
Docker runtime check: name=docker-socket-present result=failed elapsed_ms=1 detail=no socket found; docker binary at /usr/bin/docker; tried: /var/run/docker.sock(standard,denied(EACCES)), /run/docker.sock(systemd,absent), tcp://10.0.0.1:2375(docker-host,unusable-scheme(this node connects to unix sockets only))
```

`denied(EACCES)` means the node could not check that path at all, which is a permissions problem, not a missing socket. `unusable-scheme` means a `DOCKER_HOST` was set to something other than a `unix://` socket, so the node could not use it.

## Step 3: Apply the fix for the reason code

Detection runs once when the inference node starts. **After any fix below, restart the inference node**, or it keeps reporting the execution class it determined at startup.

Restart it from the control plane. If the node is unreachable from the control plane, restart the service directly on the host:

```bash
# Linux
sudo systemctl restart onprem-ai-inference-node

# macOS
sudo launchctl kickstart -k system/ai.onprem.inference-node
```

Confirm the new verdict with `onprem-ai-node doctor` on the host, or by reloading the server in the control plane.

`onprem-ai-node doctor` answers whether the node is working **as configured**, not whether it is doing everything it could. It reports `degraded` and exits non-zero only when the probe itself broke, when `EXECUTION_CLASS=container` is set and the node could not reach container execution, or when no hardware provider is usable at all. Running direct-process is not a fault on its own — on any of the reasons in this guide — so an unpinned node whose Docker daemon is stopped still reports `ok`, and the reason code and trace still say exactly what happened. Set `EXECUTION_CLASS=container` on a server that must run container workloads, and `doctor` will then fail on anything that prevents it. `declared_execution_class` is the class the node registers with the control plane, pin included, so it always matches the fleet view.

## Key log patterns

| Grep string | Meaning |
|---|---|
| `Docker runtime probe:` | The verdict line; one per process start |
| `Docker runtime check:` | One line per check performed |
| `result=skipped` | Check did not run; the detail names what stopped it |
| `reason_code=` | The identifier to look up in this guide |
| `retryable=false` | The host can never satisfy this; do not retry |

## Root causes and fixes

### `gpu-not-supported-in-docker-macos`

**Not a fault.** macOS runs containers inside a Linux virtual machine with no Metal passthrough, so a container receives CPU only while the Apple GPU sits idle. This is reported even when Docker Desktop is installed and perfectly healthy.

**Fix:** none. Use direct-process execution on macOS and install a native engine such as llama.cpp or MLX-LM on the host.

### `gpu-not-supported-in-docker-desktop`

Docker Desktop for Linux also runs a virtual machine, so it cannot pass host accelerators through. This usually appears on a developer workstation where Docker Desktop was installed instead of Docker Engine.

**Fix:** replace Docker Desktop with Docker Engine.

```bash
docker info --format '{{.OperatingSystem}}'   # "Docker Desktop" confirms it
```

### `nvidia-container-runtime-not-registered`

The node reports NVIDIA GPUs, but the daemon exposes no route to them: no `nvidia` runtime and no CDI spec directories.

```bash
docker info --format '{{json .Runtimes}}'
nvidia-ctk --version
```

**Fix:** install the NVIDIA Container Toolkit and register it.

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

Under rootless Docker, also set `no-cgroups = true` in `/etc/nvidia-container-runtime/config.toml`, then restart the user daemon with `systemctl --user restart docker`.

### `amd-gpu-devices-not-available-in-docker`

The node reports AMD GPUs, but `/dev/kfd` is not exposed to containers.

```bash
ls -l /dev/kfd /dev/dri
```

**Fix:** confirm the `amdgpu` driver is loaded and that the account running the daemon belongs to the `render` and `video` groups.

### `gpu-not-available-in-docker`

An accelerator was reported whose vendor has no known container route. This is expected on hardware the platform does not yet support for container execution.

**Fix:** use direct-process execution, and send the probe trace so the vendor can be added.

### `docker-not-installed`

No socket at any candidate path and no `docker` binary on `PATH`.

**Fix:** install Docker Engine. On Rocky Linux and RHEL 10, and on the EL10 cloud images, Docker 29 needs `kernel-modules-extra` for the running kernel: run `dnf install kernel-modules-extra-$(uname -r)`, then `modprobe xt_addrtype`. Without it the Docker daemon does not start, and its log says "failed to add jump rules to ipv4 NAT table".

### `docker-socket-not-found`

Docker is installed, but no socket was found at any candidate. The trace lists every path tried. This usually means a rootless or relocated daemon.

**Fix:** point the node at the socket.

```bash
systemctl --user status docker      # rootless daemon?
echo "$XDG_RUNTIME_DIR/docker.sock"
```

Set `DOCKER_HOST` or `DOCKER_API_SOCKET_PATH` in the node's environment.

### `docker-daemon-not-running`

The socket exists but refuses connections. Docker is installed and stopped. A socket file left behind by a stopped daemon is a common cause of this being misread as a Docker installation problem.

**Fix:**

```bash
sudo systemctl start docker && sudo systemctl enable docker
# rootless
systemctl --user start docker && loginctl enable-linger "$USER"
```

`enable-linger` matters for rootless: without it the user daemon stops when the operator logs out, and the node reports this code after the next reboot.

### `docker-daemon-timeout`

The daemon accepted the connection but did not answer within the probe timeout. It is hung or the host is severely loaded, rather than absent.

**Fix:** check host load and daemon health, then restart Docker. Raise `DOCKER_PROBE_TIMEOUT_SECONDS` only on a host known to be slow at boot.

### `docker-socket-permission-denied`

The node's service account is not authorized for the socket. There are two shapes of this. On a plain Docker socket there is no authentication at all, so the refusal happens when the node opens the socket and appears in the trace as a permission error from the operating system:

```text
Docker runtime check: name=docker-daemon-reachable result=failed elapsed_ms=1 detail=ConnectError: [Errno 13] Permission denied (caused by PermissionError: [Errno 13] Permission denied)
```

Where the inference node's container admission control sits in front of the socket, it answers `401` or `403` itself instead, and the detail carries that status and its own explanation. Both mean the same thing: authorize the account, do not restart Docker.

```bash
ls -l /var/run/docker.sock          # or the container admission control's socket the trace names
```

**Fix:** ensure the container admission control is running and its socket is owned by the service account. **Do not add the service account to the `docker` group** — that grants effective root, because any client holding the real socket can start a privileged container that mounts the host filesystem.

### `docker-api-version-too-old`

The daemon's API version is below the required minimum, so the node cannot read the CDI information it needs to confirm accelerator routing.

**Fix:** upgrade Docker Engine to a release providing API 1.44 or newer.

```bash
docker version --format '{{.Server.APIVersion}}'
```

### `docker-api-version-unreadable`

The daemon answered `GET /version`, but the response had no usable `ApiVersion` value: the key was absent, empty, or not a version the node could parse. This is not the same condition as `docker-api-version-too-old` and does not mean Docker needs upgrading — it most plausibly means the resolved socket is not a Docker API at all: a misconfigured proxy, the wrong socket path, or an API contract that changed underneath the node.

**Fix:** inspect what the endpoint actually returned, and confirm it is really Docker on the other end of the resolved socket.

```bash
# resolved socket
curl -s --unix-socket /var/run/docker.sock http://localhost/version | jq .

# if a proxy sits in front of the socket, check it directly instead
curl -s --unix-socket <proxy-socket-path> http://localhost/version | jq .
```

If the response is not Docker's own JSON, or `ApiVersion` is missing from it, the socket the node resolved is answering as something else. Check `DOCKER_API_SOCKET_PATH` and `DOCKER_HOST` for a stale or wrong override, and check any proxy in front of the socket for a bug that drops or rewrites fields in the `/version` response.

### `container-admission-control-not-running`

The inference node reaches Docker only through its container admission control, and that service is not running: its socket is missing, or nothing answers on it.

**Fix:** start it with `sudo systemctl enable --now onprem-ai-container-admission-control`, then run `onprem-ai-node doctor` again. If it does not stay running, `sudo journalctl -u onprem-ai-container-admission-control` shows why.

### `container-admission-control-bypassed`

The inference node is set up to reach Docker through its container admission control, but it resolved another socket, so its requests would go around the checks the admission control makes. A setting in `/etc/onprem-ai/inference-node/config.env` points elsewhere: `DOCKER_HOST` or `DOCKER_API_SOCKET_PATH`.

**Fix:** remove that override from `/etc/onprem-ai/inference-node/config.env`, restart the inference node (`sudo systemctl restart onprem-ai-inference-node`), then run `onprem-ai-node doctor` again.

### `docker-probe-failed`

The probe hit an unexpected error. The node degraded to direct-process rather than failing to start, and the original error is preserved in both the trace and the reported message.

**Fix:** send the probe trace. This code indicates a gap in detection rather than a known host condition.

### `docker-verification-image-unavailable`

Full verification could not obtain its verification image. This is a registry or network fault, deliberately reported separately so it is never mistaken for a GPU problem.

**Fix:** pre-pull the image on the host, or allow the node to reach the registry.

### `docker-verification-container-failed`

The verification container could not be created or started. The detail carries the daemon's own error.

**Fix:** read the detail. Device-request rejections point at the accelerator fixes above; other failures usually indicate disk or resource limits.

## Relevant files

| Path | Purpose |
|---|---|
| `planes/inference/docker-runtime-detection.md` | Design: check sequence, reason codes, trace format |
| `planes/inference/native-packaging.md` | Service privileges and why the container admission control exists |
| `/etc/nvidia-container-runtime/config.toml` | NVIDIA runtime configuration, rootless flag |
| `$XDG_RUNTIME_DIR/docker.sock` | Rootless Docker socket |
