Skip to content

Conversation

@jeroenbakker-atmind
Copy link
Contributor

@jeroenbakker-atmind jeroenbakker-atmind commented Dec 22, 2025

This is a change to allow headless rendering on Linux systems. In this case the
instance will have enabled VK_KHR_surface and VK_KHR_xlib_surface but no
X11 display could be created.

XOpenDisplay will return nullptr (See https://www.x.org/releases/X11R7.7/doc/man/man3/XOpenDisplay.3.xhtml)
but vkGetPhysicalDeviceXlibPresentationSupportKHR requires a valid pointer to
a display struct.

Other solutions would be to check this during instance creation. I didn't go for
that solution as instance creation only does extension checking and not usage
checking.

A more future proof solution would be for the client to tell the renderer in what setup
it is being used. Now it is a bit hardcoded.

This fixes an issue in Blender to be able to render usd/Hydra images headless.
See https://projects.blender.org/blender/blender/issues/149631

Description of Change(s)

Link to proposal (if applicable)

Fixes Issue(s)

Checklist

@jeroenbakker-atmind jeroenbakker-atmind force-pushed the fix/vulkan-incorrect-surface-check branch from 15bbd02 to 242734e Compare December 22, 2025 12:54
@jeroenbakker-atmind jeroenbakker-atmind changed the title HgiVulkan: Incorrect Surface Check HgiVulkan: Incorrect Surface Availability Check Dec 22, 2025
@jeroenbakker-atmind jeroenbakker-atmind force-pushed the fix/vulkan-incorrect-surface-check branch from 242734e to 895d0ff Compare December 22, 2025 13:10
The current code only checks if the base surface extension is available,
but doesn't check if the platform specific surface extension is
available. Resulting in the `_hasPresentation` to be set in cases where it
shouldn't.

Detected when trying to render via SSH using Vulkan.
See https://projects.blender.org/blender/blender/issues/149631 for
information.

Revert instance changes
@jeroenbakker-atmind jeroenbakker-atmind force-pushed the fix/vulkan-incorrect-surface-check branch from 895d0ff to aedfa98 Compare December 23, 2025 07:34
@jeroenbakker-atmind jeroenbakker-atmind changed the title HgiVulkan: Incorrect Surface Availability Check HgiVulkan: Allow Headless Rendering on X11 Dec 23, 2025
@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-11750

(This is an automated message. See here for more information.)

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.

2 participants