corona icon indicating copy to clipboard operation
corona copied to clipboard

MacOS Simulator: GPU Hang

Open personalnadir opened this issue 2 years ago • 6 comments

Describe the bug The following code produces the message 'GPU hang occurred, CoreAnalytics returned false' before causing the simulator to crash on my machine (produced in an attempt to reproduce an issue which is causing the simulator to hard crash my MacBook)

To Reproduce Steps to reproduce the behavior:

  1. Run the following code:
local group = display.newGroup()
local c = display.newCircle(group,0,0,400)
c:setFillColor(1,0,0)
local topClear=display.newRect(0, 0, display.contentWidth, display.contentHeight/2)
topClear:setFillColor(0,1,1)

local dot = display.newImage("dot.png")
dot:setFillColor(0,1,1)
dot.blendMode = "multiply"
dot.alpha = 0.4
dot:scale(4,3)

local topTexture, bottomTexture, sharedTexture
function create()
	sharedTexture = graphics.newTexture( { type="canvas", width=display.contentWidth, height=display.contentHeight/2 } )
	topTexture = graphics.newTexture( { type="canvas", width=display.contentWidth, height=display.contentHeight/2 } )
	bottomTexture = graphics.newTexture( { type="canvas", width=display.contentWidth, height=display.contentHeight/2 } )

	local topImg = display.newImageRect(
		sharedTexture.filename,
	    sharedTexture.baseDir,
	    display.contentWidth,
	    display.contentHeight/2
	)
	topImg.x = display.contentCenterX
	topImg.y = display.contentHeight/4
	topImg.xScale=-1
	topImg.yScale=-1

	local bottomImg = display.newImageRect(
	    sharedTexture.filename,
	    sharedTexture.baseDir,
	    display.contentWidth,
	    display.contentHeight/2
	)
	bottomImg.x = display.contentCenterX
	bottomImg.y = display.contentHeight*3/4

	local topImg = display.newImageRect(
	    topTexture.filename,
	    topTexture.baseDir,
	    display.contentWidth,
	    display.contentHeight/2
	)
	topImg.x = display.contentCenterX
	topImg.y = display.contentHeight/4

	local bottomImg = display.newImageRect(
	    bottomTexture.filename,
	    bottomTexture.baseDir,
	    display.contentWidth,
	    display.contentHeight/2
	)
	bottomImg.x = display.contentCenterX
	bottomImg.y = display.contentHeight*3/4
end

create()

Runtime:addEventListener("enterFrame", function()
	sharedTexture:setBackground( 0, 0, 1 )
	sharedTexture:draw(topClear)
	sharedTexture:draw(c)
	sharedTexture:invalidate()

	bottomTexture:draw(topClear)
	bottomTexture:draw(c)
	bottomTexture:draw(dot)
	bottomTexture:invalidate()

	topTexture:draw(c)
	topTexture:draw(dot)
	topTexture:invalidate()
end)
  1. Wait for crash Target platform and where build was made:
  • Device: MacOS Simulator 2022.3674
  • OS: MacOS 12.4

personalnadir avatar Jul 13 '22 09:07 personalnadir

Here's what the above code looks like for me in the simulator

Screenshot 2022-07-13 at 10 36 19

personalnadir avatar Jul 13 '22 10:07 personalnadir

dot The image asset used

personalnadir avatar Jul 13 '22 10:07 personalnadir

Adding the line

topClear.alpha = 0.2

after the setBackground call cause the above code to crash my 2018 MacBook Pro

personalnadir avatar Jul 13 '22 13:07 personalnadir

The code above does not crash on my M1 Mac Mini Machine, Does this occur for people on the newest MacOS and Corona Sim?

Test.zip

scottrules44 avatar Apr 23 '23 17:04 scottrules44

I've tested the code on M1 Mac, with MacOS Ventura 13.3 and Corona Sim v.2023.3688 and it doesn't crash.

elpida-v avatar Apr 24 '23 06:04 elpida-v

Crashes for me on MBP 2020, Intel device. macOS Ventura 13.3.1. This seems to be an Intel-related issue.

GPU hang occurred, CoreAnalytics returned false
GPU hang occurred, CoreAnalytics returned false
[Finished in 10.5s with exit code -6]

sekodev avatar Apr 25 '23 09:04 sekodev