s-r-s-i should list all Vulkan GPUs, not just GPU 0
s-r-s-i currently uses vulkaninfo --json
to query Vulkan information, and its own check-vulkan
to detect whether we can successfully render (currently only on X11).
Unfortunately, vulkaninfo --json
only gives information about GPU 0, which is not enough in multi-GPU scenarios. Similarly, check-vulkan
checks that GPU 0 can draw an invisible window. If GPU enumeration/reordering goes wrong (as in #49 (closed)) then this isn't enough information to diagnose a problem.
In recent versions you can do vulkaninfo --json=1
to give info about GPU 1, etc., but I don't think there's actually any guarantee that the enumeration order will be consistent between vulkaninfo runs (?) - so we should probably get all the information from the same process.
We should have our own helper that dumps information about all GPUs, and redesign the SrtSystemInfo API and JSON output to be able to deal with that.
Straw-man design:
- Write a helper that does this:
- List all GPUs, with their version, renderer etc. Write information about them to stdout, probably one JSON object per line. Do this before we start trying to render, to minimize the chance of crashing.
- Then, try to draw a triangle into an invisible window using each GPU in turn, and output which ones succeed and which ones fail, again probably one per line (with the output format distinguishable).
-
srt_graphics_get_renderer_string()
etc. either give information about an arbitrarily chosen GPU (implementation detail: for Vulkan it's GPU 0), or combine information about all the GPUs. - Have a new
srt_graphics_get_devices()
returning an ordered list ofSrtGraphicsDevice
. - JSON output something like this (assume we have AMD, Intel and lavapipe, and the Intel driver is broken):
"x11/vulkan" : {
"renderer" : "...", /* either list all three with "/" between, or just the first */
"version" : "...", /* same */
"devices" : [
{
"renderer" : "AMD Radeon RX 5700 XT",
"version" : ...,
},
{
"renderer" : "Intel(R) UHD Graphics 620 (KBL GT2)",
"version" : ...,
"issues" : "cannot-draw",
},
{
"renderer" : "llvmpipe (LLVM 11.0.1, 256 bits)",
"version" : ...,
"issues" : "software-rendering",
},
],
},