xcode 应用启动时DYMTLInitPlatform平台初始化成功日志是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39518088/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is DYMTLInitPlatform platform initialization successful log when the application starts?
提问by Can Poyrazo?lu
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.
我刚刚更新到 Xcode 8/iOS 10 SDK,现在当我编译和运行我的应用程序时,我[DYMTLInitPlatform] platform initialization successful
在输出中的所有其他日志之前得到。
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.
它没有害处或任何东西,但我想知道该消息与什么有关,Xcode 7.3/iOS 9.3 SDK 中没有。
回答by Paul Solt
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.
这是来自 Apple 的 Metal API 捕获逻辑(Apple 内部)的调试消息......所以它显示在 SpriteKit 或 SceneKit 应用程序中有点令人困惑。
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).
您可以通过禁用 GPU 帧捕获(阅读下面的警告)来禁用这些日志消息以及调试工具。
Click on Your App Name > Edit Scheme > Run > Change "GPU Frame Capture" from "Automatically Enabled" to "Disabled"
单击您的应用程序名称 > 编辑方案 > 运行 > 将“GPU 帧捕获”从“自动启用”更改为“禁用”
SpriteKit/SceneKit Developers
SpriteKit/SceneKit 开发人员
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.
如果您只是在制作 SpriteKit 游戏而您没有使用 Metal 进行操作,那么您可能可以通过禁用 GPU 帧捕获来提高性能,直到您需要使用它来调试图形伪像。
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).
如果您使用 Metal,您将希望启用 GPU Frame Capture 以及验证,因为这是防止误用 Metal API(导致 GPU 重新启动)的唯一方法。
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.
Mac/iOS 上的 GPU 重新启动看起来像是“很好的暂停”……那是因为当您的命令缓冲区指令不正确时,缓冲区会被丢弃,并且 GPU 会真正关闭并重新打开。您将丢失该命令缓冲区中的数据,并且您将看到渲染暂停。有时,您可以判断发生的唯一方法是查看系统日志。
Apple's Documentation and GPU Debugging Video
Apple 的文档和 GPU 调试视频
Apple's Metal documentation recommendsthat 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.
Apple 的 Metal 文档建议您保留这些以确保您正确使用 Metal API,但如果日志很烦人,您可以在开发和定期检查时禁用。
You can learn more about the GPU Frame Capture and debugging tools in Apple's Metal 2 Optimization and Debugging 2017 WWDC video
您可以在Apple 的 Metal 2 Optimization and Debugging 2017 WWDC 视频中了解有关 GPU 帧捕获和调试工具的更多信息
回答by Edwin Cen
I came across with the same situation.
我遇到了同样的情况。
Guess 1:I assume it might be Graphic related log, since MTL is short for Metal.
猜测 1:我认为它可能是与图形相关的日志,因为 MTL 是 Metal 的缩写。
Guess 2:Did you use ffmpeg related library in your project? Since before I import them there's no such logs.
猜想2:你的项目有没有使用ffmpeg相关的库?因为在我导入它们之前没有这样的日志。
Also I find a way to hide those logs: Hide strange unwanted Xcode 8 logs
我还找到了一种隐藏这些日志的方法: 隐藏奇怪的不需要的 Xcode 8 日志
I've tried out and it works
我已经试过了,它有效