wslc preview: Missing --device flag and /dev/kfd CDI mapping breaks AMD ROCm GPU passthrough
@craigloewen-msft is already working on this.
Since Jul 7, 2026.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
Windows Version
Microsoft Windows [Version 10.0.26200.8655]
WSL Version
WSL-Version: 2.9.3.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
wslc backend VM kernel
Distro Version
alpine:latest (probe) and yanwk/comfyui-boot:rocm7
Other Software
Hardware: AMD Radeon 9070XT
Framework: AMD ROCm 7.2
Workload: ComfyUI / PyTorch (ROCm build)
Repro Steps
Attempt to run a ROCm-based container via the new wslc public preview using an AMD GPU.
Run the command using the --gpus all flag to map the hardware:
wslc run -d --name=comfyui-amd --gpus all -e HSA_OVERRIDE_GFX_VERSION=12.0.0 -p 8188:8188 yanwk/comfyui-boot:rocm7
Check container logs (wslc logs comfyui-amd) and observe the PyTorch crash: RuntimeError: No HIP GPUs are available.
To verify the hardware mount in the container namespace, run a basic probe:
wslc run --rm alpine ls -la /dev
Observe that /dev/dxg may be present (if DirectML is mapped), but /dev/kfd (Kernel Fusion Driver) and /dev/dri are completely missing from the container's device namespace.
Attempt to bypass this by manually volume mounting the devices (-v /dev/kfd:/dev/kfd), which fails due to standard Linux cgroup permissions.
Expected Behavior
The --gpus all CDI specification should map raw AMD compute devices (/dev/kfd and /dev/dri) into the container namespace alongside /dev/dxg so ROCm workloads can run natively.
Alternatively, wslc should support the standard Docker/Podman --device and --group-add flags to allow users to manually pass through AMD hardware with the correct cgroup permissions.
Actual Behavior
The wslc container namespace fundamentally lacks access to /dev/kfd and /dev/dri. Because --gpus all seems strictly tied to NVIDIA or DirectML mapping, and because the CLI omits the --device flag entirely, AMD users are currently locked out of running native ROCm ML workloads in WSL Containers.
Diagnostic Logs
Output of wslc run --rm alpine ls -la /dev proving the AMD compute devices are missing from the container namespace:
total 4
drwxr-xr-x 5 root root 340 Jul 3 14:28 .
drwxr-xr-x 1 root root 4096 Jul 3 14:28 ..
lrwxrwxrwx 1 root root 11 Jul 3 14:28 core -> /proc/kcore
lrwxrwxrwx 1 root root 13 Jul 3 14:28 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Jul 3 14:28 full
drwxrwxrwt 2 root root 40 Jul 3 14:28 mqueue
crw-rw-rw- 1 root root 1, 3 Jul 3 14:28 null
lrwxrwxrwx 1 root root 8 Jul 3 14:28 ptmx -> pts/ptmx
drwxr-xr-x 2 root root 0 Jul 3 14:28 pts
crw-rw-rw- 1 root root 1, 8 Jul 3 14:28 random
drwxrwxrwt 2 root root 40 Jul 3 14:28 shm
lrwxrwxrwx 1 root root 15 Jul 3 14:28 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Jul 3 14:28 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Jul 3 14:28 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 5, 0 Jul 3 14:28 tty
crw-rw-rw- 1 root root 1, 9 Jul 3 14:28 urandom
crw-rw-rw- 1 root root 1, 5 Jul 3 14:28 zero
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.