Skip to content

Add drivers field to settings file#1695

Merged
charles-lunarg merged 4 commits into
KhronosGroup:mainfrom
charles-lunarg:driver_support_in_settings_file
Jul 15, 2025
Merged

Add drivers field to settings file#1695
charles-lunarg merged 4 commits into
KhronosGroup:mainfrom
charles-lunarg:driver_support_in_settings_file

Conversation

@charles-lunarg

@charles-lunarg charles-lunarg commented May 2, 2025

Copy link
Copy Markdown
Collaborator

Allows the settings file to contain 'additional drivers' which are just paths to ICD manifest files.

Adds the use_additional_drivers_exclusively boolean field and additional_drivers list to settings array on a per-application basis (AKA in the same object as the layers list.

TODO:
Finish writing tests. Make sure environment variables work properly or at least don't make things more complicated.
Document changes to manifest file.
Double check that additional drivers are 'last' in the list in all situations (linux ordering, windows ordering).

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 435747.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 435764.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3017 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3017 aborted.

Comment thread loader/settings.c Outdated
VkResult res = VK_SUCCESS;

cJSON* use_additional_drivers_exclusively_json =
loader_cJSON_GetObjectItem(settings_object, "use_additional_drivers_exclusively");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great! I think it allows Vulkan Configurator to fully control Vulkan drivers as I can search for the installed drivers and put them in the additional drivers list as requested by the Vulkan developer in Vulkan Configurator

@charles-lunarg charles-lunarg force-pushed the driver_support_in_settings_file branch from 37abe1a to cce11ac Compare May 15, 2025 01:01
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 444249.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 444266.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3039 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3039 failed.

@charles-lunarg charles-lunarg force-pushed the driver_support_in_settings_file branch from cce11ac to 4d8e98c Compare May 21, 2025 14:40
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 447994.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 448011.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3045 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3045 failed.


The Loader Settings File is located by searching for a file named vk_loader_settings.json in the following locations:

`$HOME/.local/share/vulkan/loader_settings.d/`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@charles-lunarg Not sure if that matters, but this location is the only one I am taking into account with Vulkan Configurator, it's where I am always writing vk_loader_settings.json.

Comment thread loader/settings.c
}
if (settings->additional_driver_count > 0) {
loader_log(inst, VULKAN_LOADER_DEBUG_BIT, 0, "----");
loader_log(inst, VULKAN_LOADER_DEBUG_BIT, 0, "Use Additional Drivers Exclusively = %s",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@charles-lunarg I am not convinced it's a debug level message. For me "debug level" is for the Loader developer but this is a relevant information for application developer. So I think it's a VULKAN_LOADER_NOFICATION_BIT level message.

@charles-lunarg charles-lunarg force-pushed the driver_support_in_settings_file branch from 4d8e98c to 623a730 Compare June 4, 2025 12:17
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 457678.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 457695.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3054 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3054 passed.

@charles-lunarg charles-lunarg force-pushed the driver_support_in_settings_file branch from 623a730 to 9b8c953 Compare June 5, 2025 06:06
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 458290.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 458307.

@charles-lunarg charles-lunarg force-pushed the driver_support_in_settings_file branch from 9b8c953 to eeb159c Compare June 5, 2025 06:10
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 458309.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3057 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 458344.

@charles-lunarg charles-lunarg force-pushed the driver_support_in_settings_file branch from eeb159c to f7f140f Compare June 5, 2025 06:16
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 458346.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3059 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 458381.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3060 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3060 passed.

@charles-lunarg charles-lunarg force-pushed the driver_support_in_settings_file branch from f7f140f to 79298ab Compare June 5, 2025 19:13
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 458747.

@christophe-lunarg christophe-lunarg self-requested a review June 5, 2025 19:14
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3061 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 458765.

@christophe-lunarg christophe-lunarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two mains issues found but being fixed, good to merge to main!

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3062 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3062 passed.

The loader settings file now can specify additional drivers to include, whether
to use those drivers exclusively, and filter/sort the VkPhysicalDevices using
the settings file provided list of deviceUUID's.

This lets the settings file control which drivers and/or devices are reported
by the loader, giving greater control over the runtime behavior of the loader.

device_configurations is an array of JSON objects which contain two fields
each, deviceUUID and deviceName.
deviceUUID is an array of 16 uint8_t's (expressed simply as numbers) which
takes the value of the
VkPhysicalDeviceVulkan11Properties::deviceUUID struct member.
deviceName is a
string taken from VkPhysicalDeviceProperties::deviceName. Only deviceUUID is
used to filter and sort VkPhysicalDevices, deviceName is for convenience and
ease of understanding the JSON loader settings file.

additional_drivers is an array of JSON object which contain just one field,
path, which is a path to the Manifest ICD JSON file for a driver.

additional_drivers_use_exclusively is a boolean field indicating whether the
loader should:
if false (default if unspecified) - look for drivers in the normal locations
and append the  additional_drivers to the back of the driver list.
if true - only use drivers in the additional_drivers, ignoring all other
driver search locations.
@charles-lunarg charles-lunarg force-pushed the driver_support_in_settings_file branch from 79298ab to 7ca69c4 Compare June 6, 2025 04:35
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 459062.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 459079.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3064 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3064 passed.

@charles-lunarg

Copy link
Copy Markdown
Collaborator Author

Now that the most recent SDK has shipped, it is time to merge this in so that the feature can be robustly tested during the next handful of weeks.

@charles-lunarg charles-lunarg merged commit f946876 into KhronosGroup:main Jul 15, 2025
44 checks passed
@charles-lunarg charles-lunarg deleted the driver_support_in_settings_file branch July 15, 2025 21:27
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.

3 participants