Group Group Group Group Group Group Group Group Group

Chapter 20 GPU Error and App Crash

#1

When running the project on my device, and pressing the “Start Game” button, the screen goes black and an error message displays in the debug console.

xcode execution of the command buffer was aborted due to an error during execution caused gpu hang error ioaf code 3

If I comment out the isHidden = true for either the truckNode or the groundNode I do not get the error, but obviously both are needed for the app to be of use. Additionally, if I comment out the line:

scene.lightingEnvironment.contents = “MonsterTruck.scnassets/Textures/Environment_CUBE.jpg”

in the initScene method, it seems to work, but then the truck is completely black.

Thoughts?

#2

@bmmiller Does this happen when you run the chapter sample project?

#3

It does occur with the sample project. Though, I should have prefaced that I have been working through all of the projects, changing the target iOS version to 12, and overall no issues.

For this one, though, changing back to 11 allowed both the sample and my working projects to work as expected. I’m guessing it’s an iOS 12 issue.

That said, is there a better way of accomplishing or getting around this issue for 12? I mean, if I were to build something using similar techniques for a personal project?

#4

@chrislanguage Can you please help with this when you get a chance? Thank you - much appreciated! :]

#5

Hi there, we’re currently in the process of updating the book and source-code to support iOS13. I will take extra special notice with that chapter.

In the meantime, instead of supplying an environment texture manually, just use ARKit’s one instead. Just add this line of code when setting up the AR config.

if #available(iOS 12.0, *) { config.environmentTexturing = .automatic }