Skip to content

fix(tests): disable GPU on macOS CI to avoid Metal paravirtual device timeout#31

Closed
leehack with Copilot wants to merge 1 commit into
mainfrom
copilot/investigate-macos-failure
Closed

fix(tests): disable GPU on macOS CI to avoid Metal paravirtual device timeout#31
leehack with Copilot wants to merge 1 commit into
mainfrom
copilot/investigate-macos-failure

Conversation

Copilot AI commented Feb 2, 2026

Copy link
Copy Markdown

Integration tests performing text generation were timing out after 5 minutes on macOS CI runners. The virtualized GPU (Apple Paravirtual device) causes Metal library initialization delays (11+ seconds) and text generation hangs.

Changes

  • Disable GPU layers on macOS (gpuLayers: 0) for integration tests that perform text generation
  • Other platforms continue using GPU acceleration (gpuLayers: 99)
  • Applied to 8 test cases across 3 files:
    • test/chat_session_test.dart (1 instance)
    • test/engine_integration_test.dart (4 instances)
    • test/grammar_regression_test.dart (3 instances)

Example

// Disable GPU on macOS CI to avoid Metal paravirtual device issues
final gpuLayers = Platform.isMacOS ? 0 : 99;

await engine.loadModel(
  modelFile.path,
  modelParams: ModelParams(
    contextSize: 256,
    logLevel: LlamaLogLevel.none,
    gpuLayers: gpuLayers,
  ),
);

This forces CPU-only inference on macOS while maintaining GPU acceleration on Linux/Windows where hardware GPU access is reliable.

Original prompt

investigate https://github.com/leehack/llamadart/actions/runs/21601294578/job/62247815048#step:5:1

why it's failing only macos?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@codecov-commenter

codecov-commenter commented Feb 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.18%. Comparing base (b6fcad5) to head (4234d6b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #31   +/-   ##
=======================================
  Coverage   47.18%   47.18%           
=======================================
  Files          23       23           
  Lines        1757     1757           
=======================================
  Hits          829      829           
  Misses        928      928           
Flag Coverage Δ
macos-latest 43.56% <0.00%> (+0.25%) ⬆️
ubuntu-latest 43.24% <0.00%> (ø)
web 80.11% <0.00%> (ø)
windows-latest 43.24% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI changed the title [WIP] Investigate CI job failure on macOS environment fix(tests): disable GPU on macOS CI to avoid Metal paravirtual device timeout Feb 2, 2026
Copilot AI requested a review from leehack February 2, 2026 19:13
@leehack leehack closed this Feb 2, 2026
@leehack leehack deleted the copilot/investigate-macos-failure branch February 2, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants