1

I'm learning how to use the Metal API. I've been following this tutorial: Audio Visualization in Swift using Metal and Acceleration

Building the project in Xcode succeeds but the program does not function and I get these errors in Xcode console:

2021-10-19 21:09:46.224427-0400 AudioVisualizer[12507:279963] Metal GPU Frame Capture Enabled
2021-10-19 21:09:46.236923-0400 AudioVisualizer[12507:279963] MTLIOAccelDevice bad MetalPluginClassName property (null)
2021-10-19 21:09:46.931271-0400 AudioVisualizer[12507:279963] +[MTLIOAccelDevice registerDevices]: Zero Metal services found
2021-10-19 21:09:46.962145-0400 AudioVisualizer[12507:279963] [CAMetalLayer nextDrawable] returning nil because allocation failed.
2021-10-19 21:09:46.980649-0400 AudioVisualizer[12507:279963] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600001098100> F8BB1C28-BAE8-11D6-9C31-00039315CD46
<AVAudioFormat 0x600003350140:  2 ch,  44100 Hz, Float32, non-inter>

I'm using a MacBook Pro with an integrated GPU. Intel and AMD Radeon with automatic graphic switching. If anyone has any advice to fix or a work around, that'd be great.

Hamid Yusifli
  • 9,688
  • 2
  • 24
  • 48
  • 1
    Are you running your code on OSX, iOS, or an iOS simulator? Does updating the OS help? Is it any different if you toggle metal validation (Product->Scheme->Edit Scheme->Diagnostics->Metal API Validation)? – Columbo Oct 20 '21 at 12:00
  • 2
    Is your program a command line application? It might not have the right entitlements to create `MTLDevice`s – JustSomeGuy Oct 20 '21 at 19:59

0 Answers0