Skip to content

CLI: GPU and init options#40301

Closed
AmelBawa-msft wants to merge 2 commits into
feature/wsl-for-appsfrom
user/amelbawa/gpu
Closed

CLI: GPU and init options#40301
AmelBawa-msft wants to merge 2 commits into
feature/wsl-for-appsfrom
user/amelbawa/gpu

Conversation

@AmelBawa-msft
Copy link
Copy Markdown
Contributor

@AmelBawa-msft AmelBawa-msft commented Apr 24, 2026

Summary of the Pull Request

  • Added --gpus and --init flags to container create and container run
  • E2E tests verifying --init replaces the shell as PID 1, and --gpus is accepted for container creation and execution.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI review requested due to automatic review settings April 24, 2026 07:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds CLI surface area for container GPU access and init behavior in the Windows wslc toolchain, wiring new flags through argument parsing, models, and container launch flags, and extending E2E coverage and help output.

Changes:

  • Add --gpus and --init to container run / container create commands and parse them into ContainerOptions.
  • Forward the new options as WSLCContainerFlagsGpu / WSLCContainerFlagsInit when launching containers.
  • Add localization entries and update E2E tests (including expected --help output) for both commands.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp Adds E2E tests for container run --init / --gpus and updates expected help text.
test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp Adds E2E tests for container create --init / --gpus and updates expected help text.
src/windows/wslc/tasks/ContainerTasks.cpp Maps new CLI args to ContainerOptions (Gpu, Init).
src/windows/wslc/services/ContainerService.cpp Translates ContainerOptions into WSLC container flags for launch.
src/windows/wslc/services/ContainerModel.h Extends ContainerOptions with Gpu and Init booleans.
src/windows/wslc/commands/ContainerRunCommand.cpp Registers ArgType::Gpu and ArgType::Init for container run.
src/windows/wslc/commands/ContainerCreateCommand.cpp Registers ArgType::Gpu and ArgType::Init for container create.
src/windows/wslc/arguments/ArgumentDefinitions.h Defines new argument types Gpu (--gpus) and Init (--init) with localized descriptions.
localization/strings/en-US/Resources.resw Adds localized descriptions for --gpus and --init.

Comment thread localization/strings/en-US/Resources.resw
Comment thread src/windows/wslc/services/ContainerService.cpp
@benhillis
Copy link
Copy Markdown
Member

benhillis commented Apr 25, 2026

--gpus sets the flag but nothing in the backend reads it. No DeviceRequests in HostConfig, no handling in WSLCContainer.cpp, IDL still has a TODO. This is a silent no-op. Either wire it up or pull the flag until it works.

@benhillis
Copy link
Copy Markdown
Member

The feature/wsl-for-apps branch is now defunct. If your PR is still valid, please retarget the master branch. Reach out to @benhillis for help if needed.

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.

3 participants