-
Notifications
You must be signed in to change notification settings - Fork 158
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
vkcube with VK_KHR_display fails when acquirable displays are on not-the-first physical devices #308
Comments
Note this isn't specific to VK_KHR_display. It will also fail on NVIDIA Linux drivers with multiple GPUs and an X11 screen on each GPU, since we don't currently support cross-GPU presentation on X11. I think the right way to solve both is to use vkGetPhysicalDeviceSurfaceSupportKHR(). That will only fix the X11 issue on the very latest NVIDIA drivers, but it should fix the VK_KHR_display issue (assuming additional changes cause vkcube to try to enumerate displays on all GPUs before selecting a GPU for actual rendering) everywhere as well. |
As a workaround on an Optimus system, I'm able to set This "fix" has been floating around on various wikis and projects, and also works with |
I've looked into this a little, and it looks like detecting which physical devices have WSI support via vkGetPhysicalDeviceSurfaceSupportKHR would be a pretty big refactor to what is meant to be a fairly simple demo. I've not seen any demos that consider a physical device with no WSI support, including the Khronos sanctioned samples, which simply look for a discrete GPU and if not found, use the first physical device. So I propose adding a command line option to vkcube and vkcupepp to allow specifying which physical device to use. That, to me, seems like the best compromise between the problem described here, and code simplicity. |
Closing with workaround |
I disagree with the proposed workaround upon which this issue was closed. vkcube serves as sample code that ISVs can mimick when writing their code. A bad sample encourages ISVs to write (and ship) bad code. The issue here is not that some physical devices HAVE WSI SUPPORT while other physical devices LACK WSI SUPPORT. The issue is that a given physical device might not have any devices that are usable via VK_KHR_display. Or, the app could be trying to use a particular display, and it needs to find the physical device to which that display is connected. A typical user does not know which number to use in a hacky command line argument that selects the Nth GPU. Rather than a hacky command line argument enabling the user to specify a chosen GPU, and letting vkcube find ANY display on that GPU; I'd prefer that a command line argument enables the user to specify a chosen display, and vkcube finds a physical device that can present to the chosen display. Then a QA testplan could run vkcube several times, once for each display. Indirectly, this would cover all physical devices that can present to at least one physical display. Related is #494. Related is #429. |
vkcube is not advertised as a sample to be mimicked but rather a "turn on" test for your Vulkan installation. Good samples for ISVs are in the KhronosGroup/Vulkan-Samples repository. Perhaps you may want to do a PR to this repository demonstrating the technique? Due to the work effort of the refactor, if you are willing to submit a PR for this change we would be willing to code review and test it. Otherwise I believe the work-around is an acceptable solution.
It isn't a hacky command line argument. It is easy to determine the GPU by running vulkaninfo and choosing the GPU you desire. |
The way that vkcube's support for
VK_KHR_display
is implemented, vkcube fails when no direct-to-displayVkDisplayKHR
can be acquired on thevkPhysicalDevice
that is sorted first in the list of physical devices, even when additional physical devices do have displays that can be acquired.This is an app bug. It prevents using vkcube to test some multi-GPU scenarios.
This bug happens because vkcube is "lazy" in how it selects a physical device. It always selects the first physical device, even if this physical device does not have any displays that can be acquired.
demo->gpu
is hard-coded to the first physical device without regard to the presence of an acquirable display on the physical device.The text was updated successfully, but these errors were encountered: