gpu info for xpu and log exclude list

Signed-off-by: vladmandic <mandic00@live.com>
pull/4695/head
vladmandic 2026-03-19 15:01:49 +01:00
parent 97a16e5eb9
commit 87659823fc
4 changed files with 16 additions and 6 deletions

@ -1 +1 @@
Subproject commit ba8955c02f633da243b8dc66d3631f68d986f6ca
Subproject commit f1433f92986e2e6f2974738fb688e82a0e04616c

View File

@ -873,12 +873,15 @@ def check_torch():
if hasattr(torch, "xpu") and torch.xpu.is_available() and allow_ipex:
if shutil.which('icpx') is not None:
log.info(f'{os.popen("icpx --version").read().rstrip()}')
torch_info.set(type='xpu', oneapi=torch.xpu.runtime_version(), dpc=torch.xpu.dpcpp_version(), driver=torch.xpu.driver_version())
torch_info.set(type='xpu')
for device in range(torch.xpu.device_count()):
props = torch.xpu.get_device_properties(device)
gpu = {
'gpu': torch.xpu.get_device_name(device),
'vram': round(torch.xpu.get_device_properties(device).total_memory / 1024 / 1024),
'units': torch.xpu.get_device_properties(device).max_compute_units,
'platform': props.platform_name,
'driver': props.driver_version,
'vram': round(props.total_memory / 1024 / 1024),
'units': props.max_compute_units,
}
log.info(f'Torch detected: {gpu}')
gpu_info.append(gpu)

View File

@ -29,6 +29,8 @@ log_cost = {
"/sdapi/v1/platform": 60,
"/sdapi/v1/checkpoint": 60,
}
log_exclude_suffix = ['.css', '.js', '.ico', '.svg']
log_exclude_prefix = ['/assets']
class Limiter():
def __init__(self, limit):
@ -65,6 +67,10 @@ class Limiter():
def check_log(self, client: str, api: str):
if self.log_limit < 0:
return True
if any(api.endswith(s) for s in log_exclude_suffix):
return False
if any(api.startswith(s) for s in log_exclude_prefix):
return False
cost = log_cost.get(api, 1)
if cost < 0:
return False

View File

@ -17,9 +17,9 @@ from torch.utils._pytree import tree_flatten
from types import MappingProxyType
from hashlib import sha256
import functools
from modules import shared, devices, sd_models, sd_models_utils
import installer
from modules import shared, devices, sd_models_utils
from modules.logger import log
@ -31,6 +31,7 @@ try:
filterwarnings = warnings.filterwarnings
warnings.filterwarnings = lambda *args, **kwargs: None
import openvino.runtime # pylint: disable=unused-import
installer.torch_info.set(openvino=openvino.runtime.get_version())
warnings.filterwarnings = filterwarnings
except Exception:
pass