diff --git a/.github/workflows/release-nesdoctor.yml b/.github/workflows/release-nesdoctor.yml index 9bb12c4f..f1c54ca6 100644 --- a/.github/workflows/release-nesdoctor.yml +++ b/.github/workflows/release-nesdoctor.yml @@ -130,6 +130,29 @@ jobs: echo "::group::${{ matrix.target }} — JSON" cat "$RUNNER_TEMP/probe.json" 2>/dev/null || echo "(no json written)" echo "::endgroup::" + # The raw output of the platform probes, so a field that comes back + # empty can be told apart from a parser that is wrong. `gpu=unknown` + # on the macOS runner could be either, and guessing which cost a + # round trip. + echo "::group::${{ matrix.target }} — raw platform probes" + case "${{ runner.os }}" in + macOS) + system_profiler SPDisplaysDataType 2>&1 | head -40 || true + sysctl -n machdep.cpu.brand_string 2>&1 || true + df -Pk 2>&1 | head -20 || true + ;; + Windows) + powershell -NoProfile -Command \ + "Get-CimInstance Win32_VideoController | Format-List Name,AdapterCompatibility,AdapterRAM" 2>&1 | head -30 || true + powershell -NoProfile -Command \ + "Get-PSDrive -PSProvider FileSystem | Format-Table Name,Free,Used" 2>&1 | head -20 || true + ;; + Linux) + df -Pk 2>&1 | head -20 || true + ls -l /sys/class/drm/ 2>&1 | head -20 || true + ;; + esac + echo "::endgroup::" - name: Package shell: bash diff --git a/apps/nesdoctor/src/sys.rs b/apps/nesdoctor/src/sys.rs index c87800aa..ccdf9082 100644 --- a/apps/nesdoctor/src/sys.rs +++ b/apps/nesdoctor/src/sys.rs @@ -293,6 +293,27 @@ fn gpus() -> Vec { }); } } + // Fallback for Apple Silicon, where the GPU *is* the SoC. + // + // The CI runner is a headless virtual Mac and still reported + // `gpu=unknown` after the parser above was added, which means either + // the parser is wrong or that machine genuinely has no display adapter + // to enumerate. Both are plausible and the second is likely, so rather + // than guess: on an arm64 Mac the integrated GPU is part of the chip, + // so the chip name is a true and useful answer even with no display + // attached. + if gpus.is_empty() && cfg!(target_arch = "aarch64") { + if let Some(soc) = sh("sysctl", &["-n", "machdep.cpu.brand_string"]) { + let soc = soc.trim(); + if !soc.is_empty() { + gpus.push(Gpu { + name: format!("{soc} (integrated)"), + vendor: Some("Apple".into()), + render_node: None, + }); + } + } + } return gpus; } #[cfg(not(any(target_os = "linux", windows, target_os = "macos")))]