KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.34k stars 648 forks source link

Add new plugin for GPU selection via command line #828

Closed SaschaWillems closed 1 year ago

SaschaWillems commented 1 year ago

Description

This PR adds a new plugin that adds GPU selection via command line. With this plugin, a user can now override the default GPU selection and explicitly request a GPU by a given index. This is esp. useful if you want to debug/test samples on GPUs other than your main GPU. I currently use this to test and fix things using swiftshader as a second ICD on my system. This PR also removes the get_first_gpu instance function that wasn't used anywhere.

The plugin itself is pretty simple, and GPU selection is done as follows:

sample instancing --gpu 1

General Checklist:

Please ensure the following points are checked: