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.
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.
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.
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.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
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.
| Symptom | Possible explanation |
|---|---|
| open(/dev/kfd) failed: No such file or directory inside Docker | 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. |
| rocminfo returns Unable to open /dev/kfd read-write or sees zero GPU agents | 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. |
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
- 1Run ls -l /dev/kfd /dev/dri and lsmod | grep amdgpu on the Docker host.
- 2Launch Docker with --device=/dev/kfd --device=/dev/dri and --group-add=$(getent group render | cut -d: -f3).
- 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.
Searchable error signature
rocminfo: Error: Failed to open /dev/kfd: No such file or directoryUse 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 logsNo 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
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 30This 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 / Stack | Recommendation | Notes |
|---|---|---|
| Missing host /dev/kfd | Install/load host amdgpu-dkms | Containers cannot create /dev/kfd if the host kernel driver failed to initialize. |
| Permission denied | Pass numeric render and video GIDs | Host and container /etc/group render GIDs often differ across Linux distributions. |
With the fix vs without the fix
| Dimension | With the fix | Without the fix |
|---|---|---|
| Container launch | Pass --device=/dev/kfd, --device=/dev/dri, and numeric render GID | Running privileged or omitting /dev/kfd passthrough |
| Host verification | Check host ls -l /dev/kfd and lsmod | grep amdgpu first | Debugging 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
host ls /dev/kfd -> missing? load amdgpu-dkms -> present? pass --device=/dev/kfd --device=/dev/dri + numeric render GID -> rocminfo
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 extensionFrequently 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?
Is passing --privileged recommended to fix ROCm /dev/kfd errors?
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.
Related Infrastructure errors
Dual ISP BGP Route Withdrawal Causing Complete GPU Cloud Region Outage
Infrastructure · critical
Routine UPS Maintenance Triggering Cascading Power and Cooling Failure Across GPU Cloud Region
Infrastructure · critical
Remediation Storm Prevention via Circuit Breaker Pattern in AutoClusters
Infrastructure · high
Network Storage Volume Causing Process Hangs on H100 GPU Nodes
Infrastructure · high