-
Notifications
You must be signed in to change notification settings - Fork 628
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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:
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.
Change tested on:
I have tested 3 different setups, 1. Display connected+GDM3 started, 2. Display connected+GDM3 shutdown and 3. Display disconnected.
A bit of investigation led me to a failure in the wsi-layer where the usage of vkImportSemaphoreFdKHR when found available fails, leading to the error we see above.
|
My current setup is using Swiftshader https://github.com/google/swiftshader "a high-performance CPU-based implementation of the Vulka 1.3 graphics AP" the headless flag seems to work correctly in all tested examples I can reproduce SaschaWillems crash. Needs more investigation, but seems to be valid use of the API, and only reproducible if you enable ICDs for Nvidia and SwiftShader. As a workaround you can avoid the crash explicitily selecting the valid GPU using the --gpu flag |
f73c125
to
f403630
Compare
Change the name of the flag and add some comments to better explain it. |
7617d5c
to
68fe8fa
Compare
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
Use offscreen when speaking about no swapchain Add warning when using headless on multiple GPUs
68fe8fa
to
e477c24
Compare
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 enableVK_EXT_headless_surface
inHeadlessWindow::get_required_surface_extensions
like the other windows types. Now we can remove theheadless
paramater fromInstance::Instance
andVulkanSample<>::create_instance
simplifying the framework.To keep the samples
hello_world
andhpp_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:
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batch
command line argument to make sure all samples still work properlyFixes #830
Fixes #314