Skip to content
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 compiled to use VK_KHR_display should (but does not) automatically select the correct vkPhysicalDevice #429

Closed
jjulianoatnv opened this issue Jul 22, 2020 · 7 comments
Assignees
Labels

Comments

@jjulianoatnv
Copy link
Contributor

When you compile vkcube to use VK_KHR_display, it does not automatically select a vkPhysicalDevice that matches the vkDisplayKHR that it selects. This can happen when more than one physical device is present. The result is that the app fails with error message, or it crashes.

Commit 50e737c added a new command-line option for selecting the Nth physical device (from the order that the Vulkan loader/runtime enumerates physical devices). But it's not really satisfying to require the user to try various values of N until one of them finally succeeds.

The app should have a default behavior that is reasonable. It should, by default, select a physical device that is viable for the chosen display.

@kaimast
Copy link

kaimast commented Feb 7, 2021

This is still an issue on master I think?

@TonyBarbour
Copy link
Contributor

Yes, but you can specify the physical device to use on the command line (--gpu_number )

@kaimast
Copy link

kaimast commented Feb 10, 2021

Yes, but you can specify the physical device to use on the command line (--gpu_number )

But this only allows me to test one one specific gpu right? The tool crashes for me on any other GPU, I assume because of this issue.

@karl-lunarg
Copy link
Contributor

The option lets you select the GPU that supports VK_KHR_display. Even if we were to add code to select a GPU on your system that supports it, it still would only work on that GPU. Adding this "automatic" selection code won't magically make the other GPUs support the extension. In other words, you'll only be able to "test" this on the GPUs that support it, regardless of how they are selected.

If you are curious about the code that would do this selection, take a look at this sample.

The cube demo could be easily modified to do this same sort of selection on Linux-like platforms because the cube app is already set up to support multiple types of presentation platforms, selected at compile time via VK_USE_PLATFORM.... But Windows, at least originally, had only one of these platforms, and the cube app wasn't originally coded to support more. It would just take more work to get it going on Windows.

@jjulianoatnv
Copy link
Contributor Author

jjulianoatnv commented Mar 1, 2021

Yes, this is still an issue.
The app really should be improved to select a vkPhysicalDevice that works, rather than defaulting to whichever thing happens to enumerate first. It is not a great service to ISVs when the sample app from Khronos does not demonstrate a robust way to select devices and displays.

Here's a variation of the general issue:

There was a recent bug in our bug tracker where an end user had an AMD iGPU plus an NV dGPU. There was a driver for the NV GPU but no driver installed for the AMD GPU. Because the AMD GPU is the one that cube selected by default, the user got a "VkEnumeratePhysicalDevices Failure" popup when he launched cube.exe. After installing the AMD driver cube.exe would run. The bug report indicates that this was not the VK_KHR_display version of cube, but rather the desktop version on Windows 10.

@kaimast
Copy link

kaimast commented Mar 1, 2021

The option lets you select the GPU that supports VK_KHR_display. Even if we were to add code to select a GPU on your system that supports it, it still would only work on that GPU. Adding this "automatic" selection code won't magically make the other GPUs support the extension. In other words, you'll only be able to "test" this on the GPUs that support it, regardless of how they are selected.

Okay, so I think my problem is actually related to #370. Everything works fine when running under X11.

@TonyBarbour
Copy link
Contributor

Fixed in #494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants