Running Xcode tests involving metal fails / impossible to create a Metal device using MTLCreateSystemDefaultDevice

Description of the issue

We’re running Xcode unit test that require Metal. The tests are running on our local machines but on Bitrise, we can’t create a Metal device:

let device = MTLCreateSystemDefaultDevice()

Returns nil

There’s a message from @cskata that says that “Metal graphics API will not work on our build VMs as there is no GPU acceleration”. The Bitrise support told me that Metal was since enabled. If Metal is available on Bitrise, how to create a Metal device from code?


Where did the issue happen?

On Elite Machine, Xcode 13.3.x (beta) on macOS 12.2 (Monterey)

Which build Step causes the issue and which version of the step?
Steps: run a Xcode Unit Test that creates a Metal device using MTLCreateSystemDefaultDevice


  • Does a “Rebuild” help? No
  • Does a rebuild without caches help? No
  • Does the issue happen sporadically, or every time? Every time
  • Does upgrading the build Step to the latest version help? : No
  • When did the issue start? : Since we added tests that are using Metal

Local reproduction

_Can it be reproduced on your own Mac/PC by following our local debug guide? No

Build log

The exact build was shared with support privately

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.