wgpu-profiler icon indicating copy to clipboard operation
wgpu-profiler copied to clipboard

Support multiple devices/queues with tracy

Open 9SMTM6 opened this issue 1 year ago • 3 comments

The way that tracy support is implemented, as least from what I can see, you can't have multiple devices on one profiler. But this is (currently) required to support multiple queues on wgpu side.

Maybe I'm missing something, thus, and for the case I'm right, I wanted to check in with you.

I don't really require this to work, it'd just be a nice to have.

9SMTM6 avatar Oct 27 '24 10:10 9SMTM6

Having multiple devices associated with a singe GpuProfiler won't work because one can't use buffers across devices easily. But that still shouldn't preclude from sharing the same tracy client between multiple profilers, which might be nice regardelss. That bit should be fairly easy to fix though with some changes in the interface, allowing to take in an existing tracy client plus Note that create_tracy_gpu_client itself only needs device & queue to establish a rough timestamp mapping, see https://docs.rs/tracy-client/latest/tracy_client/struct.Client.html#method.new_gpu_context That would be useful regardless and should be split out I think 🤔

Wumpf avatar Oct 27 '24 12:10 Wumpf

But that still shouldn't preclude from sharing the same tracy client between multiple profilers, which might be nice regardelss.

Ah, so that's not an issue. Good to know.

That bit should be fairly easy to fix though with some changes in the interface, allowing to take in an existing tracy client plus

TBH I don't know what you mean with that. ATM., as far as I can tell, the interface should probably just work, I just have to invoke it multiple times for each device and queue I want to look at?

9SMTM6 avatar Oct 27 '24 19:10 9SMTM6

Well, the issue is that right now that each GpuProfiler creates a tracy gpu context. You'd want to share a single tracy context across several GpuProfiler instances (one for each device/queue)

Wumpf avatar Oct 28 '24 08:10 Wumpf