Vulkan-Loader icon indicating copy to clipboard operation
Vulkan-Loader copied to clipboard

Implement a device sorting for all systems

Open MarkY-LunarG opened this issue 4 years ago • 9 comments

Implement a mechanism to sort devices based on some user preferences. These should include being able to prioritize most performant or most power-efficient devices. Also, it should be consistent from one run to another. A possible second alternative option might be to allow power adapter settings affect it in an "auto" mode (plugged in -> performance, battery -> power efficient). Experiment with this in a layer first.

MarkY-LunarG avatar Aug 26 '21 21:08 MarkY-LunarG

I'm curious how this will interact with the existing vendor-specific layers? Is there some guarantee that the LunarG layer will load below these vendor layers or vice-versa?

cubanismo avatar Sep 15 '21 16:09 cubanismo

If we implement it as a layer, we are planning on this being lower (closer to the Implementation). But that will either take forcing the loading location in the loader for now or the implementation of #328. I have ideas for #328, but am only working on this part-time currently.

MarkY-LunarG avatar Sep 15 '21 17:09 MarkY-LunarG

How is the plan for games that have their own selection criteria? For example, games that always grab the most performant device. Then any sorting being done at layer/loader is not going to affect them. Does it mean some sort of filtering is still necessary?

Jason0214 avatar Oct 21 '21 09:10 Jason0214

This proposal is not to filter, only to sort. Any application that does extensive sorting on their own hand shouldn't be affected because this will only change the relative order of entries.

charles-lunarg avatar Oct 21 '21 15:10 charles-lunarg

Actually, my proposal is to allow users to filter themselves. By default, it will not filter just sort. I plan to release a doc internal soon on my sorting algorithm proposal. Once that's reviewed I'll start making it more visible.

MarkY-LunarG avatar Oct 21 '21 16:10 MarkY-LunarG

Hi @MarkY-LunarG glad to see https://github.com/KhronosGroup/Vulkan-Loader/pull/764. Thanks for doing the work!

Still, I want to kindly check with the “proposal is to allow users to filter themselves”. We would be more happier to see that in the loader : )

Jason0214 avatar Dec 06 '21 10:12 Jason0214

The option is there to force a device first using the new VK_LOADER_DEVICE_SELECT option which you set with vendorID hex value ":" deviceID hex value. Just like the Mesa device select layer. In fact, I also pay attention to the Mesa select option of MESA_VK_DEVICE_SELECT. I still plan on improving this even more in the future, but for now, I aimed for the easiest to get quorum from Khronos members.

MarkY-LunarG avatar Dec 06 '21 15:12 MarkY-LunarG

The option is there to force a device first using the new VK_LOADER_DEVICE_SELECT option which you set with vendorID hex value ":" deviceID hex value. Just like the Mesa device select layer. In fact, I also pay attention to the Mesa select option of MESA_VK_DEVICE_SELECT. I still plan on improving this even more in the future, but for now, I aimed for the easiest to get quorum from Khronos members.

Got it. Thanks Mark

Jason0214 avatar Dec 09 '21 03:12 Jason0214

Linux consistent sorting enabled

MarkY-LunarG avatar Jan 28 '22 16:01 MarkY-LunarG