intel: split URB space between task and mesh proportionally to entry sizes

Improves performance by 0.5-2.5% in vk_meshlet_cadscene
depending on the model.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22445>
This commit is contained in:
Marcin Ślusarz 2023-04-12 16:17:52 +02:00 committed by Marge Bot
parent f11a4a09b0
commit cf90be90ad

View file

@ -323,19 +323,24 @@ intel_get_mesh_urb_config(const struct intel_device_info *devinfo,
float task_urb_share = 0.0f;
if (r.task_entry_size_64b > 0) {
/* By default, assign 10% to TASK and 90% to MESH, since we expect MESH
* to use larger URB entries since it contains all the vertex and
* primitive data. Environment variable allow us to tweak it.
/* By default, split memory between TASK and MESH proportionally to
* their entry sizes. Environment variable allow us to tweak it.
*
* TODO(mesh): Re-evaluate if this is a good default once there are more
* workloads.
*/
static int task_urb_share_percentage = -1;
if (task_urb_share_percentage < 0) {
if (task_urb_share_percentage == -1) {
task_urb_share_percentage =
MIN2(debug_get_num_option("INTEL_MESH_TASK_URB_SHARE", 10), 100);
MIN2(debug_get_num_option("INTEL_MESH_TASK_URB_SHARE", -2), 100);
}
if (task_urb_share_percentage >= 0) {
task_urb_share = task_urb_share_percentage / 100.0f;
} else {
task_urb_share = 1.0f * r.task_entry_size_64b /
(r.task_entry_size_64b + r.mesh_entry_size_64b);
}
task_urb_share = task_urb_share_percentage / 100.0f;
}
const unsigned one_task_urb_kb = ALIGN(r.task_entry_size_64b * 64, 1024) / 1024;