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

Headless mode seems to be broken #830

Open
SaschaWillems opened this issue Oct 15, 2023 · 2 comments · May be fixed by #1090
Open

Headless mode seems to be broken #830

SaschaWillems opened this issue Oct 15, 2023 · 2 comments · May be fixed by #1090
Assignees
Labels
framework This is relevant to the framework

Comments

@SaschaWillems
Copy link
Collaborator

SaschaWillems commented Oct 15, 2023

None of the samples seem to work in headless mode anymore. I get the following validation error when running with --headless:

[error] [framework\core\instance.cpp:50] -437968512 - VUID-vkCreateInstance-ppEnabledExtensionNames-01388: Validation Error: [ VUID-vkCreateInstance-ppEnabledExtensionNames-01388 ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xe5e52180 | Missing extension required by the instance extension VK_EXT_headless_surface: VK_KHR_surface. The Vulkan spec states: All required extensions for each extension in the VkInstanceCreateInfo::ppEnabledExtensionNames list must also be present in that list (https://vulkan.lunarg.com/doc/view/1.3.261.1/windows/1.3-extensions/vkspec.html#VUID-vkCreateInstance-ppEnabledExtensionNames-01388)

As per the spec VK_EXT_headless_surface requires VK_KHR_surface, yet at instance creation we do this:

	// Try to enable headless surface extension if it exists
	if (headless)
	{
		const bool has_headless_surface = enable_extension(VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME,
		                                                   available_instance_extensions, enabled_extensions);
		if (!has_headless_surface)
		{
			LOGW("{} is not available, disabling swapchain creation", VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME);
		}
	}
	else
	{
		enabled_extensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
	}

Imo this is wrong and the else path should always be run. But even changing that will then cause the sample to fail at surface creation, as the base sample class always expects a valid surface:

	if (!surface)
	{
		throw std::runtime_error("Failed to create window surface.");
	}

It looks like headless isn't properly handled, at least not on windows and possibly completely broken.

Refs #314

@SaschaWillems SaschaWillems self-assigned this Oct 16, 2023
@JoseEmilio-ARM
Copy link
Collaborator

Hi @SaschaWillems , did you have a chance to investigate this further? We have an internal solution and I think we can share in the next couple of months after some refining

@SaschaWillems
Copy link
Collaborator Author

I did some initial testing, but nothing that's ready to be merged. So feel free to fix it :)

@SaschaWillems SaschaWillems added the framework This is relevant to the framework label Feb 12, 2024
@iagoCL iagoCL linked a pull request Jul 8, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework This is relevant to the framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants