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

Loader messages for environment variables are confusing and don't follow VK_LOADER_DEBUG or vk_loader_settings.json settings #1580

Closed
christophe-lunarg opened this issue Oct 23, 2024 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@christophe-lunarg
Copy link
Contributor

christophe-lunarg commented Oct 23, 2024

The issue was experienced on Windows.

  • When stderr_log is set empty in vk_loader_settings.json, and VK_LOADER_DEBUG is unset (I tried to set it nothing too) I am still getting these loader messages:
WARNING: [Loader Message] Code 0 : env var 'VK_INSTANCE_LAYERS' defined and adding layers: VK_LAYER_KHRONOS_validation
  • There is no log message for layers added with both VK_LOADER_LAYERS_ENABLE and 'VK_INSTANCE_LAYERS', I will only get:
WARNING: [Loader Message] Code 0 : env var 'VK_INSTANCE_LAYERS' defined and adding layers "VK_LAYER_KHRONOS_profiles"

If I unset 'VK_INSTANCE_LAYERS', I am getting:

WARNING: [Loader Message] Code 0 : Layer "VK_LAYER_KHRONOS_profiles" forced enabled due to env var 'VK_LOADER_LAYERS_ENABLE'

The messages are not consistent which is also unnecessary confusing.

@christophe-lunarg christophe-lunarg added the bug Something isn't working label Oct 23, 2024
@charles-lunarg
Copy link
Collaborator

I am 98% sure that those messages are because whatever application is being run is adding a Debug Utils messenger with the Error & Warning flags.

I cannot reproduce this in any other fashion on linux and windows.

@christophe-lunarg
Copy link
Contributor Author

I am 98% sure that those messages are because whatever application is being run is adding a Debug Utils messenger with the Error & Warning flags.

I cannot reproduce this in any other fashion on linux and windows.

vulkaninfo is setting up a Debug Utils messenger?

@charles-lunarg
Copy link
Collaborator

Yes, vulkaninfo does create a debug report object. Not debug utils but the effect is the same.

@christophe-lunarg
Copy link
Contributor Author

Ok then I think think it would be useful if the loader would report itself what layers are find using VK_LOADER_LAYERS_ENABLE VK_LOADER_LAYERS_DISABLE and VK_INSTANCE_LAYERS.

@christophe-lunarg
Copy link
Contributor Author

I looked at vulkaninfo and didn't find the log message but I found it in the Vulkan Loader.

loader_log(inst, VULKAN_LOADER_WARN_BIT | VULKAN_LOADER_LAYER_BIT, 0, "env var \'%s\' defined and adding layers \"%s\"",

@charles-lunarg
Copy link
Collaborator

Yes, the loader creates that log message. The loader then calls the debug report callback that Vulkaninfo setup, and the callback makes the call to printf putting it in the console. The fact that only Warning and Error level messages appear in the output reinforces that this isn't a loader settings or VK_LOADER_DEBUG env-var bug, but expected behavior.

@christophe-lunarg
Copy link
Contributor Author

So there are a type of log message filtered by VK_LOADER_DEBUG and other type of log messages for Debug Utils messenger?

I am not understanding this. Why only some messages goes to the Debug Utils messenger?

@charles-lunarg
Copy link
Collaborator

The Vulkaninfo debug report (not utils in this case, but debug utils has the same behavior) callback was setup with only warning and error level messages. When the loader logs anything, it checks to see if the message level matches what the callbacks want. So in loader_log, the loader doesn't call the callback if the message isn't a warning or error.

@christophe-lunarg
Copy link
Contributor Author

Ahhhh, so WARNING: [Loader Message] Code 0 : env var 'VK_INSTANCE_LAYERS' defined and adding layers should appear twice, when VK_LOADER_DEBUG with warning or error is set?

I think that's the case, I'll double check tomorrow.

@charles-lunarg
Copy link
Collaborator

Yep! That would help explain why loader logs are so verbose sometimes.

@christophe-lunarg
Copy link
Contributor Author

Closing this issue as I colelcted all the log improvements in this issue: #1595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants