fix hardware stats crash when audio transcription is enabled (#24164)

This commit is contained in:
Josh Hawkins
2026-09-12 07:30:04 -06:00
committed by Nicolas Mowen
parent 8cd36416e2
commit 6bd6d3383f
+7 -5
View File
@@ -427,13 +427,15 @@ class HardwareStats:
if config.lpr.enabled and (config.lpr.device or "AUTO") != "CPU": if config.lpr.enabled and (config.lpr.device or "AUTO") != "CPU":
names.add(gpu) names.add(gpu)
# audio transcription runs on CUDA only # audio transcription runs on CUDA only, and the device is global only
transcription_configs = [config.audio_transcription] + [ transcription = config.audio_transcription
camera.audio_transcription for camera in config.cameras.values() transcription_enabled = transcription.enabled or any(
] camera.audio_transcription.enabled for camera in config.cameras.values()
)
if ( if (
any(c.enabled and c.device == "GPU" for c in transcription_configs) transcription_enabled
and transcription.device == "GPU"
and "onnx:nvidia" in _present_hardware() and "onnx:nvidia" in _present_hardware()
and _gpu_device_nodes_exist("nvidia") and _gpu_device_nodes_exist("nvidia")
): ):