Skip to content

docs: document Docker Desktop /dev/kfd limitation on Linux#98

Merged
sgopinath1 merged 6 commits intoROCm:mainfrom
nikhilsk:fix/86-docker-desktop-kfd-docs
Feb 17, 2026
Merged

docs: document Docker Desktop /dev/kfd limitation on Linux#98
sgopinath1 merged 6 commits intoROCm:mainfrom
nikhilsk:fix/86-docker-desktop-kfd-docs

Conversation

@nikhilsk
Copy link
Contributor

@nikhilsk nikhilsk commented Feb 16, 2026

Fixes #86

Problem

On Linux, when Docker Desktop is running, containers cannot access host GPU devices (/dev/kfd, /dev/dri). Users see:

docker: Error response from daemon: error gathering device information while adding custom device "/dev/kfd": no such file or directory

See issue #86.

Proposed workaround

  • Use Docker Engine (e.g. docker.io or Docker's official repository) on Linux for GPU workloads so the daemon runs on the host and can expose /dev/kfd and /dev/dri.
  • Or quit Docker Desktop (or log out and back in) so the host Docker Engine is used instead.

Test results

Verified on a Linux host with Docker Engine (default context, unix:///var/run/docker.sock):

1. Same command as in issue #86 (with --rm added so the container is removed on exit):

docker run -it --rm \
    --cap-add=SYS_PTRACE \
    --security-opt seccomp=unconfined \
    --device=/dev/kfd \
    --device=/dev/dri \
    --group-add video \
    --ipc=host \
    --shm-size 8G \
    rocm/pytorch:latest
  • Container started successfully (no /dev/kfd error).
  • Inside container: rocm-smi showed GPU devices; python -c "import torch; print(torch.cuda.is_available())" returned True.

2. Quick smoke test:

docker run --rm --device=/dev/kfd --device=/dev/dri rocm/rocm-terminal rocm-smi
  • Image pulled, container ran, rocm-smi showed the GPU. No leftover container.

This confirms that when Docker Engine is used (not Docker Desktop), the documented workaround works and the exact run command from #86 succeeds.

@nikhilsk nikhilsk requested a review from sgopinath1 February 16, 2026 12:50
@nikhilsk nikhilsk marked this pull request as ready for review February 16, 2026 12:50
@shiv-tyagi shiv-tyagi self-requested a review February 16, 2026 13:21
Copy link
Member

@shiv-tyagi shiv-tyagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nikhilsk. Posted comments. PTAL.

@shiv-tyagi shiv-tyagi changed the title docs: document Docker Desktop /dev/kfd limitation on Linux (fixes #86) docs: document Docker Desktop /dev/kfd limitation on Linux Feb 16, 2026
@nikhilsk nikhilsk requested a review from shiv-tyagi February 17, 2026 08:58
nikhilsk and others added 3 commits February 17, 2026 15:04
Co-authored-by: Shiv Tyagi <67995771+shiv-tyagi@users.noreply.github.com>
Co-authored-by: Shiv Tyagi <67995771+shiv-tyagi@users.noreply.github.com>
Co-authored-by: Shiv Tyagi <67995771+shiv-tyagi@users.noreply.github.com>
Copy link
Member

@shiv-tyagi shiv-tyagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@sgopinath1 sgopinath1 merged commit 5dff0b5 into ROCm:main Feb 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue]: Having Docker Desktop running blocks access to /dev/kfd when running none root docker run command

3 participants

Comments