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

Fix support for --headless. #1090

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iagoCL
Copy link

@iagoCL iagoCL commented Jul 8, 2024

Description

The main objective of this PR is to fix the --headless flag. Currently it does not work in the framework, due to not requesting a surface and swap chain.

This PR reworks HeadlessWindow to make it more similar to the other window classes. This will allow us to enable VK_EXT_headless_surface in HeadlessWindow::get_required_surface_extensions like the other windows types. Now we can remove the headless paramater from Instance::Instance and VulkanSample<>::create_instance simplifying the framework.

To keep the samples hello_world and hpp_hello_world as simple as possible, I did not add support for headless. Instead, an assert is run to ensure the are not enabling with headless in those samples.

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

If this PR contains framework changes:

  • I did a full batch run using the batch command line argument to make sure all samples still work properly

Fixes #830
Fixes #314

Now --headless will create a swap_chain and a surface, now the feature will work correctly.
Remove headless parameter from Instance::Instance and VulkanSample<>::create_instance.
VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME  added in HeadlessWindow::get_required_surface_extensions like other window types
Added an assert if headless is enabled to hello_triangle and hpp_hello_triangle
@CLAassistant
Copy link

CLAassistant commented Jul 8, 2024

CLA assistant check
All committers have signed the CLA.

@JoseEmilio-ARM JoseEmilio-ARM requested a review from a team July 10, 2024 13:47
@SaschaWillems SaschaWillems self-requested a review July 11, 2024 14:55
Copy link
Collaborator

@SaschaWillems SaschaWillems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This crashes for me when trying to start any sample in headless mode.

The crash happens in getSurfaceSupportKHR in the vulkan hpp header and is coming from get_suitable_gpu in hpp_instance.cpp.

Callstack:

image

It works fine without headless.

System is Windows 11 with an NV RTX 4070 and recent Vulkan drivers. The K_EXT_headless_surface extension is supported.

I also have a switfshader ICD installed to test features not supported by my GPU, but the crash happens when calling getSurfaceSupportKHR for my discrete RTX 4070.

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

Successfully merging this pull request may close these issues.

Headless mode seems to be broken Headless mode crashes with API samples
3 participants