Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebGPU] Support PIX Capture for WebGPU EP #23192

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

shaoboyan091
Copy link

PIX Capture tool requires 'present' to end a frame capture. ORT doesn't have rendering work so no 'present' happens.

To avoid endless waiting for PIX capture tool, this PR added a blank surface and 'present' on it in each session run.

The surface is created in WebGPU ep constructor and closed in WebGPU ep destructor.

Description

Motivation and Context

PIX Capture tool requires 'present' to end a frame capture. ORT doesn't
have rendering work so no 'present' happens.

To avoid endless waiting for PIX capture tool, this PR added a blank
surface and 'present' on it in each session run.

The surface is created in WebGPU ep constructor and closed in WebGPU ep
destructor.
@shaoboyan091
Copy link
Author

@qjia7 @fs-eire PTAL, thanks!

@shaoboyan091
Copy link
Author

@microsoft-github-policy-service agree [company="Microsoft"]

@shaoboyan091
Copy link
Author

@microsoft-github-policy-service agree

@shaoboyan091 shaoboyan091 changed the title Support PIX Capture for WebGPU EP [WebGPU] Support PIX Capture for WebGPU EP Dec 26, 2024
@snnn snnn added the ep:WebGPU ort-web webgpu provider label Dec 30, 2024
@shaoboyan091 shaoboyan091 requested a review from fs-eire January 2, 2025 08:04
@shaoboyan091
Copy link
Author

@fs-eire Please take another look, thanks!

@guschmue guschmue requested a review from Copilot January 6, 2025 19:15

Choose a reason for hiding this comment

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

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

Files not reviewed (8)
  • cmake/CMakeLists.txt: Language not supported
  • cmake/external/onnxruntime_external_deps.cmake: Language not supported
  • onnxruntime/core/providers/webgpu/webgpu_context.cc: Language not supported
  • onnxruntime/core/providers/webgpu/webgpu_context.h: Language not supported
  • onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc: Language not supported
  • onnxruntime/core/providers/webgpu/webgpu_execution_provider.h: Language not supported
  • onnxruntime/core/providers/webgpu/webgpu_provider_factory.cc: Language not supported
  • onnxruntime/core/providers/webgpu/webgpu_provider_options.h: Language not supported
@guschmue
Copy link
Contributor

guschmue commented Jan 6, 2025

lint is not happy

@shaoboyan091
Copy link
Author

@guschmue Ok, I thought it was bots error when I see 403 state instead of lint error. So run lint -A seems not handle all things right. Thanks for the info.

@shaoboyan091
Copy link
Author

Turns out the lintrunner doesn't work correctly because it cannot find clang-format.exe(Maybe due to I have a depot_tools? The error message seems related). However, after I fixed it locally, the lintrunner works.

@@ -69,6 +71,8 @@ class WebGpuExecutionProvider : public IExecutionProvider {
bool IsGraphCaptured(int graph_annotation_id) const override;
Status ReplayGraph(int graph_annotation_id) override;

bool IsPIXCaptureEnabled() const { return enable_pix_capture_; }
Copy link
Contributor

Choose a reason for hiding this comment

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

seems unnecessary getter. the only usage is in OnRunEnd() and it's totally OK to just use enable_pix_capture_ there.

Copy link
Author

Choose a reason for hiding this comment

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

Move this one from webgpu ep to webgpu context so that we could check pix enable in onRunEnd to call GeneratePixFrame.

tools/ci_build/build.py Outdated Show resolved Hide resolved
@shaoboyan091 shaoboyan091 requested a review from fs-eire January 8, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:WebGPU ort-web webgpu provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants