baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
8.9k stars 1.33k forks source link

Vulkan captures are not portable cross-vendor #814

Open hrydgard opened 6 years ago

hrydgard commented 6 years ago

Here's a straightforward dump, taken on Windows:

http://www.ppsspp.org/unofficial/burnout.rdc

I've sent it to someone using RenderDoc on Linux, and it crashes trying to load it.

Is cross platform dump compatibility expected?

baldurk commented 6 years ago

Vulkan captures are generally not portable between even different hardware on the same platform. Things like memory type index selection and allocation offset/requirements are baked into the capture, so it won't replay correctly on a different driver that reports different memory types or requirements for resources.

You might be lucky if you capture and replay on similar nvidia GPUs, since it's the same driver on both windows and linux.

In future I'm hoping I can add some system to remap memory types, and report worst-case requirements (regardless of what the implementation reports) for resources, so that captures made on one system can be replayed on a different system. It's not a trivial issue to solve though, and until then vulkan captures are generally not portable.

hrydgard commented 6 years ago

Noted, makes sense.

It could be nice to bake the driver name and version into the file, and check it on load, warning the user to expect failures if they don't match the local GPU. Just UX sugar though.

baldurk commented 6 years ago

The physical device params are stored, but that doesn't always mean the capture is incompatible. E.g. nv's drivers seem to be largely compatible up and down several GPU families.

Latest code on v1.x branch should at least check to see if any memory requirements are violated on replay and will gracefully fail instead of crashing - that is by far the most common cause of problems at least.

hrydgard commented 6 years ago

Ah, that sounds good. Thanks!

devshgraphicsprogramming commented 5 years ago

Maybe it should be possible to have some "restricted mode" when no replay is available, at least viewing the API call list and buffer states is helpful for remote debug.

baldurk commented 5 years ago

I don't know what you mean by 'buffer states', but you can export the capture to XML on any machine even if you can't replay, though it's not the most user friendly way to list all the API calls.

Viewing the calls in the normal UI won't be possible as the core replay code that populates the view of the capture is intrinsically linked to being able to replay the API calls, it's not feasible to separate the two.

devshgraphicsprogramming commented 5 years ago

I see, at least there is XML

But can one export to XML without having to open the normal UI and capture on a compatible machine?