1// Copyright 2021-2024 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5include::{generated}/meta/{refprefix}VK_KHR_global_priority.adoc[] 6 7=== Other Extension Metadata 8 9*Last Modified Date*:: 10 2021-10-22 11*Contributors*:: 12 - Tobias Hector, AMD 13 - Contributors to `apiext:VK_EXT_global_priority` 14 - Contributors to `apiext:VK_EXT_global_priority_query` 15 16=== Description 17 18In Vulkan, users can specify device-scope queue priorities. 19In some cases it may be useful to extend this concept to a system-wide 20scope. 21This device extension allows applications to query the global queue 22priorities supported by a queue family, and then set a priority when 23creating queues. 24The default queue priority is ename:VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT. 25 26Implementations can report which global priority levels are treated 27differently by the implementation. 28It is intended primarily for use in system integration along with certain 29platform-specific priority enforcement rules. 30 31The driver implementation will attempt to skew hardware resource allocation 32in favour of the higher-priority task. 33Therefore, higher-priority work may retain similar latency and throughput 34characteristics even if the system is congested with lower priority work. 35 36The global priority level of a queue shall take precedence over the 37per-process queue priority 38(sname:VkDeviceQueueCreateInfo::pname:pQueuePriorities). 39 40Abuse of this feature may result in starving the rest of the system from 41hardware resources. 42Therefore, the driver implementation may deny requests to acquire a priority 43above the default priority (ename:VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT) if 44the caller does not have sufficient privileges. 45In this scenario ename:VK_ERROR_NOT_PERMITTED_EXT is returned. 46 47The driver implementation may fail the queue allocation request if resources 48required to complete the operation have been exhausted (either by the same 49process or a different process). 50In this scenario ename:VK_ERROR_INITIALIZATION_FAILED is returned. 51 52include::{generated}/interfaces/VK_KHR_global_priority.adoc[] 53 54=== Issues 55 561) Can we additionally query whether a caller is permitted to acquire a 57specific global queue priority in this extension? 58 59*RESOLVED*: No. 60Whether a caller has enough privilege goes with the OS, and the Vulkan 61driver cannot really guarantee that the privilege will not change in between 62this query and the actual queue creation call. 63 642) If more than 1 queue using global priority is requested, is there a good 65way to know which queue is failing the device creation? 66 67*RESOLVED*: No. 68There is not a good way at this moment, and it is also not quite actionable 69for the applications to know that because the information may not be 70accurate. 71Queue creation can fail because of runtime constraints like insufficient 72privilege or lack of resource, and the failure is not necessarily tied to 73that particular queue configuration requested. 74 75=== Version History 76 77 * Revision 1, 2021-10-22 (Tobias Hector) 78 ** Initial draft 79