Skip to content

Docker ROCm /dev/kfd No Such File or Directory

Fix Docker ROCm /dev/kfd and /dev/dri no such file or directory errors. Map host kernel devices, render and video groups, and amdgpu permissions.

Quick answer

ROCm containers fail with /dev/kfd: No such file or directory when the host amdgpu kernel driver is not loaded or when Docker is launched without passing --device=/dev/kfd and --device=/dev/dri plus matching render and video group IDs.

Symptom
rocminfo: Error: Failed to open /dev/kfd: No such file or directory
Root cause
The container either did not mount /dev/kfd and /dev/dri from the host, lacks host render/video supplementary group membership, or runs on a host whose amdgpu/amdkfd kernel module failed to load.
Recommended fix
Confirm /dev/kfd and /dev/dri/renderD* exist on the host with ls -l /dev/kfd /dev/dri and verify lsmod | grep amdgpu.
How Denpex helps
Denpex investigates Docker ROCm /dev/kfd No Such File or Directory using the evidence you provide or your connected workload collects. Earlier rank, host or application evidence is needed to distinguish an initiating failure from a downstream report.
Infrastructure#rocm#amd#docker#kfd#dri#containers

What this failure is

A container device-access error where ROCm user-space libraries cannot open the AMD Kernel Fusion Driver (/dev/kfd) or Direct Rendering Infrastructure (/dev/dri) nodes.

Live diagnosis, no signup

Is this what broke your run? Paste your log.

You're reading about Docker ROCm /dev/kfd No Such File or Directory. Paste your own traceback and relevant evidence for an investigation of your workload, with a next action or a specific missing fact. A reference entry does not establish your cause. No account or card for the free diagnosis. Review data handling before submitting sensitive logs.

Before uploading, review cloud data handling and local options.

training_logs.txt
No log to hand? Try one:

Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.

3 free cloud diagnoses per day

Why it happens (the mechanism)

Unlike NVIDIA Docker setups that inject device nodes via the Container Toolkit runtime hook, standard Docker ROCm containers require explicit device passthrough, matching host kernel amdgpu modules, and container UID/GID access to host render and video device groups.

What you'll observe

  • ROCm tools such as rocminfo, hipInfo, and PyTorch torch.cuda.is_available() fail inside Docker even though GPUs appear on the host.
  • Container initialization logs cannot open /dev/kfd: No such file or directory or Permission denied.

Common symptoms and what they mean

Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.

SymptomPossible explanation
open(/dev/kfd) failed: No such file or directory inside DockerThe container either did not mount /dev/kfd and /dev/dri from the host, lacks host render/video supplementary group membership, or runs on a host whose amdgpu/amdkfd kernel module failed to load.
rocminfo returns Unable to open /dev/kfd read-write or sees zero GPU agentsThe container either did not mount /dev/kfd and /dev/dri from the host, lacks host render/video supplementary group membership, or runs on a host whose amdgpu/amdkfd kernel module failed to load.

Which systems are affected

  • AMD Instinct and Radeon GPUs running ROCm containers in Docker, Docker Compose, or Kubernetes
  • Linux hosts missing amdgpu-dkms or configured with restrictive /dev/kfd group ownership

How to confirm this is the problem

Use this checklist to test the hypothesis against a small reproduction. No single line proves the root cause, so preserve the preceding events and compare one variable at a time.

  • ✓Run ls -la /dev/kfd /dev/dri on the host to verify device nodes and owning groups.
  • ✓Run docker run --rm --device=/dev/kfd --device=/dev/dri --group-add=video --group-add=$(getent group render | cut -d: -f3) rocm/dev-ubuntu-24.04 rocminfo.

Root cause

  • The container either did not mount /dev/kfd and /dev/dri from the host, lacks host render/video supplementary group membership, or runs on a host whose amdgpu/amdkfd kernel module failed to load.

The fix and how to prevent it

How to fix it

  • Confirm /dev/kfd and /dev/dri/renderD* exist on the host with ls -l /dev/kfd /dev/dri and verify lsmod | grep amdgpu.
  • If /dev/kfd is missing on the host, install or rebuild the host amdgpu-dkms kernel driver and reboot before launching containers.
  • Pass --device=/dev/kfd --device=/dev/dri plus host render and video group IDs (--group-add=$(getent group render | cut -d: -f3) --group-add video) to docker run.
  • Verify rocminfo inside the container lists the expected gfx architecture agent.

Step-by-step remediation

  1. 1Run ls -l /dev/kfd /dev/dri and lsmod | grep amdgpu on the Docker host.
  2. 2Launch Docker with --device=/dev/kfd --device=/dev/dri and --group-add=$(getent group render | cut -d: -f3).
  3. 3Execute rocminfo inside the container to verify GPU agents appear without permission errors.

How to prevent it

  • Pin explicit device mappings and render/video group_add entries in Docker Compose and container launch templates.
  • Add a host preflight check for /dev/kfd and host rocminfo output after kernel upgrades.

Save this diagnosis and catch the next crash automatically

All root cause, fix, and prevention steps above are free to read. Create a free account with any email or GitHub to keep your saved diagnosis history across the encyclopedia and run cloud checks, or use a work email below for the 30-day Team evaluation. No card required.

Or start a 30-day free Team trial (work email)

Verified work email unlocks all 14 fleet diagnostic tools, Slack alerts, and team history for 30 days. No card and no automatic charge.

Use your company email, for example alex@yourcompany.com.

Who qualifies?

Company email domains activate the free 30-day Team evaluation (up to 50 diagnoses a day) after an email and domain check, whatever mail provider you use. If we cannot verify your domain automatically, support reviews it: write to support@denpex.com. Free local diagnosis in the editor extension needs no account.

Using a personal email (Gmail, Outlook, Naver, QQ) or solo cluster? Create a free $0 account (no work email required) to save 7-day history and unlock AI fallback, or send a cluster crash log for a live walkthrough.
Already have an account? Sign in

Searchable error signature

search key
rocminfo: Error: Failed to open /dev/kfd: No such file or directory

Use this text as a lookup key in logs and upstream issue trackers. It is not presented as a captured customer log. Confirm the cause from your own preceding events, versions, configuration and the cited references.

Diagnose your own log automatically

The root cause and fix steps above stay free. Create a free account to analyze full job logs, attribute the first failed rank, and keep saved incident history.

Sign up free. Analyze your cluster logs

No credit card. Daily allowance follows verified trust tier. Instant access.

Why the recommended fix works

Exposing both /dev/kfd and /dev/dri with matching kernel group permissions allows ROCr runtime initialization inside the container to communicate with the host amdgpu driver.

Code examples

snippet
ls -la /dev/kfd /dev/dri
docker run --rm \
  --device=/dev/kfd \
  --device=/dev/dri \
  --group-add=$(getent group render | cut -d: -f3) \
  --group-add=video \
  rocm/pytorch:latest rocminfo | head -n 30

This snippet illustrates the entry-specific check. Verify the installed versions, permissions, target and workload context before using it. A command or API example is not proof of recovery.

Best practices by model family

Model / StackRecommendationNotes
Missing host /dev/kfdInstall/load host amdgpu-dkmsContainers cannot create /dev/kfd if the host kernel driver failed to initialize.
Permission deniedPass numeric render and video GIDsHost and container /etc/group render GIDs often differ across Linux distributions.

With the fix vs without the fix

DimensionWith the fixWithout the fix
Container launchPass --device=/dev/kfd, --device=/dev/dri, and numeric render GIDRunning privileged or omitting /dev/kfd passthrough
Host verificationCheck host ls -l /dev/kfd and lsmod | grep amdgpu firstDebugging container Python packages when host driver is missing

Diagnostic note

“Grounded in AMD ROCm Linux installation and Docker container configuration guidelines for KFD and DRI device passthrough.”

Visual fingerprint

ROCm Docker /dev/kfd checklist
host ls /dev/kfd -> missing? load amdgpu-dkms -> present? pass --device=/dev/kfd --device=/dev/dri + numeric render GID -> rocminfo
Separate missing host KFD driver setup from container device and group passthrough issues.

Diagnose this failure in VS Code

Select the traceback or open the failed terminal, then run Denpex locally to inspect matched failure patterns, supporting evidence and next checks without uploading the log. Verify recommendations against your workload before changing production.

Install the free VS Code extension

Frequently asked questions

Questions engineers and on-call staff commonly ask about this failure.

Why does rocminfo work on the host but fail inside Docker with /dev/kfd missing?
Docker isolates /dev by default. Without --device=/dev/kfd and --device=/dev/dri (and the host render/video group IDs for non-root containers), ROCm inside the container cannot access the host KFD character device.
Is passing --privileged recommended to fix ROCm /dev/kfd errors?
No. Passing --device=/dev/kfd, --device=/dev/dri, and numeric render/video group IDs grants ROCm device access without exposing full privileged host capabilities.

Don't just read the fix, diagnose your run

The encyclopedia explains documented failure patterns. Denpex investigates your logs, configuration and stack, shows the supporting evidence, and asks for missing details when needed.