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

Feature gate wgpu-core's api and resource level logging #6017

Closed
wants to merge 1 commit into from

Conversation

Elabajaba
Copy link
Contributor

Connections
Alternative to #6010
Fixes #6010

Description
This gates wgpu core's api_log and resource_log macros behind an enable_heavy_logs cargo feature (feature could probably use a better name).

Testing
Explain how this change is tested.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@jimblandy
Copy link
Member

In the absence of benchmark results, we can't take PRs like this. This isn't a final decision; if you are able to post numbers, by all means let's re-open.

@jimblandy jimblandy closed this Jul 24, 2024
@Elabajaba
Copy link
Contributor Author

Here's an older/outdated but well written look at wgpu's logging overhead https://danchia.github.io/posts/bevy-perf-deep-dive-2/

On linux+nvidia (not sure what specific GPU) zeux recently profiled wgpu's logging overhead at about 15% with bevy, (not sure what scene/example was used for testing though). wgpu's overhead was also about 4.5x the driver time on linux+nvidia, and ~6x on RADV. On Metal it's apparently around 50:50 wgpu:driver. (https://discord.com/channels/691052431525675048/743663924229963868/1257828514632044645 for logging numbers, and https://discord.com/channels/691052431525675048/743663924229963868/1257826346290122873 for wgpu overhead numbers)

I'll try to put together a more reproducible and up to date writeup this weekend.

@jimblandy
Copy link
Member

@Elabajaba wrote:

wgpu's overhead was also about 4.5x the driver time on linux+nvidia, and ~6x on RADV. On Metal it's apparently around 50:50 wgpu:driver.

That sounds high, and I'd like to know more. But it's hard for us to act on reports without the ability to reproduce the problem ourselves, which is why we have to raise the bar for perf issues. Ideally, perf issues would include a new benchmark that shows the issue, ready to be included in our suite: that would both help us fix the problem, and prevent it from arising again.

We have recently found quite a number of big improvements available from rearchitecture, like @teoxoy's recent PR changing the tracking of resources used by submitted command buffers. I expect we'll be able to continue to find these issues and tighten things up.

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.

2 participants