mirror of
https://github.com/blender/blender
synced 2026-10-25 03:07:01 +03:00
This PR allows to run benchmarks on multiple GPUs (one at a time). It also contains some fixes to the reporting and normalization of the device ID's. Device ID normalization is done as some existing configs only contain `VULKAN` which need to be matched against `VULKAN_0` and vise-versa. Device selection doesn't use `blender --gpu-device help` to detect devices as that option doesn't exist in older builds. Now with fixed python validations. Original Pull Request: https://projects.blender.org/blender/blender/pulls/158898 Pull Request: https://projects.blender.org/blender/blender/pulls/159234
11 lines
353 B
Python
11 lines
353 B
Python
# SPDX-FileCopyrightText: 2026 Blender Authors
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
def normalize_device_id(device_id: str) -> str:
|
|
"""Normalize a device ID by adding _0 suffix when there is no index."""
|
|
parts = device_id.rsplit('_', 1)
|
|
if len(parts) == 1 or not parts[1].isdigit():
|
|
return device_id + '_0'
|
|
return device_id
|