Okay, let's break down that Docker command and discuss running it on Windows.
The Challenge: ROCm and Linux Devices
The core components making this command Linux-specific and difficult to translate directly to Windows are:
--device /dev/kfd and --device /dev/dri: These flags map specific Linux device files into the container.
/dev/kfd (Kernel Fusion Driver) is essential for ROCm (AMD's GPU computing stack) to interact with the AMD GPU hardware on Linux.
/dev/dri (Direct Rendering Infrastructure) is the standard Linux interface for graphics and GPU acceleration.
--group-add=video: This adds the container user to the video group on the host Linux system. This is often necessary on Linux to grant permissions for accessing the GPU devices (/dev/dri/*).
vllm-rocm image: This image is explicitly built and configured for the ROCm stack, which primarily targets Linux.
Windows Context:
- Windows Native Containers: These run Windows processes and cannot run Linux images like
vllm-rocm. They also don't have /dev/kfd or /dev/dri.
- Docker Desktop on Windows (WSL 2 Backend): This is the most likely scenario. Docker Desktop uses a lightweight Linux VM (via the Windows Subsystem for Linux 2). This can provide access to host hardware, including GPUs, but it requires specific setup and driver support.
Is it Possible on Windows?
Yes, but with significant caveats and potential difficulties:
-
ROCm Support: ROCm's support for running on Windows via WSL 2 is less mature than NVIDIA's CUDA support. You need:
- Up-to-date AMD Drivers: Install the latest recommended AMD Adrenalin drivers on your Windows host, ensuring they have WSL support.
- WSL 2 GPU Support: Ensure Docker Desktop is configured to use the WSL 2 backend and that GPU acceleration is enabled for WSL 2 (this is usually automatic if drivers are installed correctly).
- ROCm Inside WSL: The
vllm-rocm image expects ROCm libraries and drivers to be available within the Linux environment (WSL 2) that the container runs in. You might need to install ROCm components inside your WSL distribution or hope Docker Desktop's passthrough is sufficient (less likely for direct device access).
-
Device Mapping Equivalence: You cannot use --device /dev/kfd or --device /dev/dri directly because those files don't exist on the Windows host. Docker Desktop (WSL 2) handles the GPU passthrough differently. You typically omit these specific --device flags when using Docker Desktop with GPU support, as Docker Desktop manages the mapping implicitly.
-
Group Membership Equivalence: --group-add=video is also Linux-specific and generally not needed or applicable when using Docker Desktop's WSL 2 GPU integration.
How to Attempt It on Windows (Using Docker Desktop with WSL 2):
-
Prerequisites:
- Install Docker Desktop for Windows.
- Ensure it's configured to use the WSL 2 backend (Settings -> General -> "Use the WSL 2 based engine").
- Install the latest AMD Adrenalin drivers on your Windows host. Verify they support WSL/GPU compute if possible (check AMD/ROCm documentation).
- Have your
vllm-rocm Docker image available (pulled or built).
- Ensure your model files are accessible from your WSL 2 environment. The path might need to be adjusted (e.g.,
/mnt/c/Users/... or //wsl$/<YourDistroName>/...).
-
Modified Command:
Try removing the Linux-specific device flags. You might also reconsider --network=host and --ipc=host as they reduce isolation, but here they are included as requested:
# Using Windows Command Prompt (cmd.exe) - use ^ for line continuation
docker run -it ^
--network=host ^
--ipc=host ^
--cap-add=SYS_PTRACE ^
--security-opt seccomp=unconfined ^
-v <path/on/windows/or/wsl>:/app/model ^
vllm-rocm ^
bash
# --- OR ---
# Using PowerShell - use ` for line continuation (or just run on one line)
docker run -it `
--network=host `
--ipc=host `
--cap-add=SYS_PTRACE `
--security-opt seccomp=unconfined `
-v <path/on/windows/or/wsl>:/app/model `
vllm-rocm `
bash
# --- OR ---
# Using Git Bash or WSL's bash - use \ for line continuation
docker run -it \
--network=host \
--ipc=host \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
-v <path/on/windows/or/wsl>:/app/model \
vllm-rocm \
bash
Replace <path/on/windows/or/wsl>: This needs to be a path accessible from within WSL 2.
- If your model is on
C:\path\to\model, you might use -v C:/path/to/model:/app/model or -v /c/path/to/model:/app/model.
- Alternatively, navigate to your WSL distro's filesystem (e.g.,
\\wsl$\Ubuntu\home\user\model) and use that path.
If it Still Doesn't Work:
- ROCm Installation in WSL: The
vllm-rocm image might fundamentally rely on ROCm being pre-installed within the container or expecting a specific host setup that Docker Desktop doesn't fully replicate. You might need to find or build a version of the vLLM image specifically designed for Windows/WSL or install ROCm components within your WSL distro first and then try running the container. Check the official ROCm documentation for WSL installation guides.
- Image Compatibility: The
vllm-rocm image might simply not be compatible with the way GPUs are exposed through Docker Desktop on Windows.
- Networking/IPC: While kept here as requested,
--network=host and --ipc=host can sometimes cause issues or are unnecessary. Try removing them and using Docker's default bridge networking if you encounter problems.
In Summary:
Directly translating the command isn't possible due to Linux-specific device files. You need to rely on Docker Desktop's WSL 2 GPU integration, remove the problematic --device and --group-add flags, ensure your Windows host drivers are correct, and be aware that the vllm-rocm image itself might have compatibility limitations on Windows/WSL.