On Mon May 20 13:18:17 2024 +0000, Zhiyi Zhang wrote:
I don't feel comfortable with matching with PCI IDs or just the random Vulkan device here. Even with PCI IDs you can have two or more GPUs of the same spec. The PCI ID must be unique to use as a fallback. So you shouldn't use the PCI IDs to match devices when there are two GPUs of the same model. But then again, I don't think there is a good solution to this. The root cause is that we don't have the infrastructure to do it properly. We need something like hardware device paths to correctly implement this. Can we not match a GPU to a Vulkan GPU if matching by UUID fails? Add then we consider the rest of Vulkan GPUs not added as offscreen and add them later. Would that work?
I don't really see the issue with selecting one or the other GPU if they are both the same model. And I think this is more a limitation of the backends, which we cannot do much about: if Wayland abstracts the GPU information there is no way we can bind a Wayland output to a particular GPU, but that's also probably not an issue.
Instead, not matching any Vulkan GPU, we would still need to expose a fake GPU to the Windows applications, and that GPU would not have any associated Vulkan device. I think that can cause more problems than selecting an arbitrary, by PCI ID, or the first, GPU we find.