19

I've just updated to Xcode 8/iOS 10 SDK and now when I compile and run my app, I'm getting [DYMTLInitPlatform] platform initialization successful before all the other logs in the output.

It's not harmful or anything, but I was wondering what that message is related to, which wasn't there with Xcode 7.3/iOS 9.3 SDK.

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
  • My app is crash immediately after print that log, do you know what is the cause? – Quang Huynh Sep 21 '16 at 09:18
  • @QuangHuynh I don't think the crash is related to this log. It's probably something else. Set an exception breakpoint on Xcode to find out what's going wrong. – Can Poyrazoğlu Sep 21 '16 at 09:25
  • The app crash before get into main() function, do you know how to see the log of OS? – Quang Huynh Sep 21 '16 at 15:33
  • @QuangHuynh are you sure you've set up a generic Objective-C exception breakpoint? if yes, and you are crashing before you can catch anything, check any Xcode warnings, clean the build folder/deriveddata, remove the app from the device/simulator if possible, and try again. – Can Poyrazoğlu Sep 22 '16 at 09:55
  • you can see the logs output here : http://stackoverflow.com/questions/39629696/application-crash-immediately-when-deploy-to-iphone-running-ios10-from-xcode8/39633023#39633023 – Quang Huynh Sep 22 '16 at 10:08
  • @Paul Solt's answer explains it.. I think his answer should be accepted.. yani adam güzelce açıklamış, cevabı kabul etsen iyi olur bence :D – delavega66 Aug 09 '18 at 11:50

2 Answers2

6

It is a debug message from the Apple's Metal API capture logic (internal to Apple) ... so it's a little confusing that it's displaying in a SpriteKit or SceneKit app.

You'll probably also see the messages:

2018-05-08 13:03:01.166917-0400 <Your-App-Name>[1728:741547] [DYMTLInitPlatform] platform initialization successful
2018-05-08 13:03:01.255515-0400 <Your-App-Name>[1728:741333] Metal GPU Frame Capture Enabled
2018-05-08 13:03:01.255994-0400 <Your-App-Name>[1728:741333] Metal API Validation Enabled

You can disable these log message along with the debug tools by disabling GPU Frame Capture (Read the caveats below).

Click on Your App Name > Edit Scheme > Run > Change "GPU Frame Capture" from "Automatically Enabled" to "Disabled"

Disable GPU Frame Capture in Xcode 9

SpriteKit/SceneKit Developers

If you're just making a SpriteKit game and you're not doing things with Metal, you can probably get away with disabling GPU Frame Capture to improve performance until you need to use it for debugging graphics artifacts.

Metal Developers

If you're using Metal, you will want to leave GPU Frame Capture enabled, along with the validation, since it's the only way to prevent misusing the Metal APIs (which result in GPU restarts).

A GPU restart on Mac/iOS will look like a "nice pause" ... that's because when your command buffer instructions are incorrect the buffer is thrown away and the GPU is literally turned off and back on. You'll lose data from that command buffer and you'll see a pause in rendering. Sometimes the only way you can tell the happens is if you look at the system log.

Apple's Documentation and GPU Debugging Video

Apple's Metal documentation recommends that you leave these on to make sure you're using the Metal APIs correctly, but if the logs are annoying you can disable while you develop and check periodically.

You can learn more about the GPU Frame Capture and debugging tools in Apple's Metal 2 Optimization and Debugging 2017 WWDC video

Paul Solt
  • 8,375
  • 5
  • 41
  • 46
2

I came across with the same situation.

Guess 1: I assume it might be Graphic related log, since MTL is short for Metal.

Guess 2: Did you use ffmpeg related library in your project? Since before I import them there's no such logs.

Also I find a way to hide those logs: Hide strange unwanted Xcode 8 logs

I've tried out and it works

Community
  • 1
  • 1
Edwin Cen
  • 161
  • 2
  • 7
  • Nopes, I don't have any ffmpeg related library. I do have a suspect, `GPUImage` though, which may be linked against a framework that uses Metal. – Can Poyrazoğlu Sep 18 '16 at 14:07
  • I've added an answer after digging into this console message a bit more from the help of a friend. https://stackoverflow.com/a/50239497/276626 Anything that sits on top of the Metal APIs will cause this to output if the "GPU Frame Capture" is enabled. – Paul Solt May 08 '18 at 17:52
  • Hopefully Apple will fix the other unwanted Xcode 8 logs ... I've submitted a bug report for that: Bug #34767176 (Xcode 9 Displays System Framework Debug Print Statements), which is a duplicate of the open bug #32256894 File a duplicate bug to disable strange logs like the DYMLInitPlatform message: https://bugreport.apple.com – Paul Solt May 08 '18 at 17:53