Reach the integrated-graphics check on a box with no nvidia-smi
This commit is contained in:
@@ -176,11 +176,12 @@ function vv_docker_stopped(): array {
|
||||
// per GPU, so splitting the whole output on commas (as this once did) runs the rows together
|
||||
// and only ever describes GPU 0.
|
||||
function vv_gpu_stats_all(): array {
|
||||
// No early return when nvidia-smi is absent: a box with no discrete card still has to reach
|
||||
// the integrated-graphics check below. Returning here is what kept HOST2 reporting no GPU
|
||||
// even after that check existed.
|
||||
$out = shell_exec('nvidia-smi --query-gpu=index,uuid,name,memory.used,memory.total,utilization.gpu,temperature.gpu,power.draw,utilization.encoder,utilization.decoder --format=csv,noheader,nounits 2>/dev/null');
|
||||
if (!$out) return [];
|
||||
|
||||
$gpus = [];
|
||||
foreach (explode("\n", trim($out)) as $line) {
|
||||
foreach (explode("\n", trim((string)$out)) as $line) {
|
||||
if (!$line) continue;
|
||||
$p = array_map('trim', explode(',', $line));
|
||||
if (count($p) < 10) continue;
|
||||
|
||||
Reference in New Issue
Block a user