pub(crate) fn detect_gpu_count(override_val: Option<usize>) -> usizeExpand description
Detects the number of NVIDIA GPU devices available on this instance.
Detection order (first success wins):
override_val— the parsed value ofBGE_M3_GPU_COUNTenv var, if set.- Linux
/proc/driver/nvidia/gpus/directory entry count (compiled out on non-Linux targets). - Default:
1(macOSCoreMLis always single-device; Linux fallback when the NVIDIA driver proc path is absent or empty).
Returns at least 1 regardless of the detection path. Logs the chosen
count and source at INFO.