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

Took more than 10minutes to create compute pipeline on Linux #6110

Open
GopherJ opened this issue Aug 13, 2024 · 9 comments
Open

Took more than 10minutes to create compute pipeline on Linux #6110

GopherJ opened this issue Aug 13, 2024 · 9 comments
Labels
area: performance How fast things go external: upstream Issues happening in lower level APIs or platforms

Comments

@GopherJ
Copy link

GopherJ commented Aug 13, 2024

Description
creating compute pipeline becomes super slow once some changes have been made to the shader

Repro steps
Ideally, a runnable example we can check out.

Expected vs observed behavior
faster

Extra materials
N/A

Platform
Linux Mint based on ubuntu 22.04, i7-13gen, 64GB, GTX4090

@ErichDonGubler ErichDonGubler added type: bug Something isn't working area: performance How fast things go labels Aug 13, 2024
@ErichDonGubler
Copy link
Member

@GopherJ: This issue does not actually provide instructions for running an example of the behavior described. I don't think it's reasonable to expect contributors here to build and run binaries that are not trivial to validate for safety and security without instructions, so: Unless you can make your example small (i.e., everything in a pair of Cargo.toml and main.rs), determine what changes specifically are causing this behavior (perhaps as a diff), and quantify what "slow" means, I intend to close this issue.

@GopherJ
Copy link
Author

GopherJ commented Aug 13, 2024

hi @ErichDonGubler it's more a problem of running wgpu on linux. If more context is needed I can try to make one later.

And it's not related to my code because the bottle neck is on create_compute_pipeline API

@Wumpf
Copy link
Member

Wumpf commented Aug 13, 2024

our ci regularly runs create_compute_pipeline with various inputs on all platforms without this issue, so it clearly is related to either the sample at hand or your setup. So yes, more context is needed!

@GopherJ
Copy link
Author

GopherJ commented Aug 13, 2024

I'll try to provide a reproducible example later.

@cwfitzgerald
Copy link
Member

It would be useful to know the timing of the underlying vkCreateComputePipelines call is taking, as I suspect that the hang is entirely within that call.

@cwfitzgerald cwfitzgerald added external: upstream Issues happening in lower level APIs or platforms and removed type: bug Something isn't working labels Aug 13, 2024
@GopherJ
Copy link
Author

GopherJ commented Aug 17, 2024

https://github.com/GopherJ/webgpu-shaders

@ErichDonGubler @cwfitzgerald here the reproduce repro

if you try to run:

cargo test --release --no-default-features --features std -- --test-threads 1 --nocapture

it basically hangs for a while to compile OR create compute pipeline, on macos I don't observe, things are super fast

Environment:
image

@GopherJ
Copy link
Author

GopherJ commented Aug 23, 2024

any idea?

@ErichDonGubler
Copy link
Member

I don't have a Linux environment handy at the moment, so I can't directly contribute debugging hre. Inspecting the reproducible example repro, however, I suspect there is still some work to do to make the example smaller:

  1. If the issue is creating a compute pipeline, not executing one, we shouldn't need to keep any of the code past the stage of creating a compute pipeline. Things like constructing and executing compute passes should be unnecessary.
  2. I see multiple compute pipelines being created, but this bug has only mentioned a specific pipeline being slow. We should be able to limit the reproducible example to code that creates only that pipeline.
  3. Your cargo test reproduction steps don't note which #[test] entries are slow. Is it all of them? Only some of them? We should narrow the reproduction steps down to only one of these cases, if possible.

@jimblandy
Copy link
Member

The Mozilla folks aren't going to be prioritizing this for the moment. As always, others are welcome to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: performance How fast things go external: upstream Issues happening in lower level APIs or platforms
Projects
Status: Todo
Development

No branches or pull requests

5 participants