@mytec: iter2.4 ready for testing
This commit is contained in:
@@ -21,25 +21,24 @@ async def get_system_info():
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Check GPU
|
||||
gpu_info = None
|
||||
try:
|
||||
import cupy as cp
|
||||
if cp.cuda.runtime.getDeviceCount() > 0:
|
||||
props = cp.cuda.runtime.getDeviceProperties(0)
|
||||
gpu_info = {
|
||||
"name": props["name"].decode(),
|
||||
"memory_mb": props["totalGlobalMem"] // (1024 * 1024),
|
||||
}
|
||||
except Exception:
|
||||
pass
|
||||
# Check GPU via gpu_service
|
||||
from app.services.gpu_service import gpu_service
|
||||
gpu_info = gpu_service.get_info()
|
||||
|
||||
# Determine parallel backend
|
||||
if ray_available:
|
||||
parallel_backend = "ray"
|
||||
elif cpu_cores > 1:
|
||||
parallel_backend = "process_pool"
|
||||
else:
|
||||
parallel_backend = "sequential"
|
||||
|
||||
return {
|
||||
"cpu_cores": cpu_cores,
|
||||
"parallel_workers": min(cpu_cores, 14),
|
||||
"parallel_backend": "ray" if ray_available else "sequential",
|
||||
"parallel_backend": parallel_backend,
|
||||
"ray_available": ray_available,
|
||||
"ray_initialized": ray_initialized,
|
||||
"gpu": gpu_info,
|
||||
"gpu_enabled": gpu_info is not None,
|
||||
"gpu_available": gpu_info.get("available", False),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user