The current Vulkan specification does not expose this behavior well and may cause applications to make suboptimal memory choices when allocating memory. For example, in a system with multiple applications running, the application may think that device-local memory is full and revert to making performance-sensitive allocations from host-local memory. In reality the memory heap might not have been full, it just appeared to be at the time memory consumption was queried, and a device-local allocation would have succeeded. A well designed operating system that implements pageable device-local memory will try to have all memory allocations for the foreground application paged into device-local memory, and paged out for other applications as needed when not in use.
When this extension is exposed by the Vulkan implementation it indicates to the application that the operating system implements pageable device-local memory and the application should adjust its memory allocation strategy accordingly. The extension also exposes a new SetDeviceMemoryPriorityEXT function to allow the application to dynamically adjust the priority of existing memory allocations based on its current needs. This will help the operating system page out lower priority memory allocations before higher priority allocations when needed. It will also help the operating system decide which memory allocations to page back into device-local memory first.
To take best advantage of pageable device-local memory the application must create the Vulkan device with the VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT::pageableDeviceLocalMemory feature enabled. When enabled the Vulkan implementation will allow device-local memory allocations to be paged in and out by the operating system, and may not return VK_ERROR_OUT_OF_DEVICE_MEMORY even if device-local memory appears to be full, but will instead page this, or other allocations, out to make room. The Vulkan implementation will also ensure that host-local memory allocations will never be promoted to device-local memory by the operating system, or consume device-local memory.
VK_EXT_pageable_device_local_memoryVK_EXT_memory_priority| Modifier and Type | Field and Description |
|---|---|
| public static final String | VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME
The extension name. |
| public static final int | VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION
The extension specification version. |
| public static final int | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT
Extends |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static void | vkSetDeviceMemoryPriorityEXT(VkDevice
the logical device that owns the memory. device, long the memory, float VkDeviceMemory object to which the new priority will be applied.a floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations. Larger values are higher priority. The granularity of the priorities is implementation-dependent. priority)Change a memory allocation priority. |
| VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME | back to summary |
|---|---|
| public static final String VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME The extension name. | |
| VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION | back to summary |
|---|---|
| public static final int VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION The extension specification version. | |
| VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT Extends | |
| EXTPageableDeviceLocalMemory | back to summary |
|---|---|
| protected EXTPageableDeviceLocalMemory() | |
| vkSetDeviceMemoryPriorityEXT | back to summary |
|---|---|
| public static void vkSetDeviceMemoryPriorityEXT(VkDevice device, long memory, float priority) Change a memory allocation priority. C SpecificationTo modify the priority of an existing memory allocation, call:
DescriptionMemory allocations with higher priority may be more likely to stay in device-local memory when the system is under memory pressure. Valid Usage
Valid Usage (Implicit)
| |