From 73969c2fb6ff03e62bd7b856fc59c6af5416df49 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Sat, 25 Oct 2025 15:22:50 +0900 Subject: [PATCH] =?UTF-8?q?compute=5Ftypes=E3=82=92=E3=82=BD=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=97=E3=81=A6=E5=87=BA=E5=8A=9B=E3=82=92=E5=AE=89?= =?UTF-8?q?=E5=AE=9A=E5=8C=96=E3=80=81getBestComputeType=E3=81=AEselected?= =?UTF-8?q?=5Ftypes=E3=82=92=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E3=82=92=E7=B0=A1=E7=B4=A0?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src-python/utils.py b/src-python/utils.py index 1e250e87..a251e9b5 100644 --- a/src-python/utils.py +++ b/src-python/utils.py @@ -100,7 +100,7 @@ def getComputeDeviceList() -> List[Dict[str, Any]]: "device": "cpu", "device_index": 0, "device_name": "cpu", - "compute_types": ["auto"] + list(get_supported_compute_types("cpu", 0)), + "compute_types": ["auto"] + sorted(list(get_supported_compute_types("cpu", 0))), } ] @@ -108,7 +108,7 @@ def getComputeDeviceList() -> List[Dict[str, Any]]: if torch is not None and hasattr(torch, "cuda") and torch.cuda.is_available(): for device_index in range(torch.cuda.device_count()): gpu_device_name = torch.cuda.get_device_name(device_index) - gpu_compute_types = ["auto"] + list(get_supported_compute_types("cuda", device_index)) + gpu_compute_types = ["auto"] + sorted(list(get_supported_compute_types("cuda", device_index))) # デバイスごとの計算タイプの制限 if "GTX" in gpu_device_name: @@ -157,12 +157,11 @@ def getBestComputeType(device: str, device_index: int) -> str: } # デバイス名に基づいて優先タイプを選択 + selected_types = preferred_types["default"] for key in preferred_types: if key in device_name: selected_types = preferred_types[key] break - else: - selected_types = preferred_types["default"] # 利用可能な計算タイプを返す for compute_type in selected_types: