Fix NameError in cluster nodes API

- Fixed undefined variable 'local_gpu_backends' in api_cluster_nodes function
- Properly defined local_available_backends, local_gpu_backends, and local_cpu_backends
- Updated local node detection to show nodes with any available backends (GPU or CPU)
- Ensured CPU-only nodes are correctly identified and displayed
- Maintained backward compatibility with existing GPU-only node detection
parent bd087af5
...@@ -486,10 +486,12 @@ def api_cluster_nodes(): ...@@ -486,10 +486,12 @@ def api_cluster_nodes():
nodes.append(node_data) nodes.append(node_data)
# Detect and aggregate local worker processes on master # Detect and aggregate local worker processes on master
# Only show local node if GPU backends are available # Show local node if any backends are available (GPU or CPU)
from vidai.compat import get_available_backends from vidai.compat import get_available_backends
local_available_gpu_backends = [b for b in get_available_backends() if b in ['cuda', 'rocm']] local_available_backends = get_available_backends()
if local_available_gpu_backends: local_gpu_backends = [b for b in local_available_backends if b in ['cuda', 'rocm']]
local_cpu_backends = [b for b in local_available_backends if b == 'cpu']
if local_available_backends:
local_workers = detect_local_workers() local_workers = detect_local_workers()
if local_workers: if local_workers:
# Group local workers by type # Group local workers by type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment