Open starryalley opened 1 year ago
Update: I've tested more with the Mac mini M1 machine and with the min reproduction project attached above, it will always crash in the second cycle of loading texture to the sky.
===> doing load/unload of panorama texture:0
Load panorama sky from:res://assets/nancy_church_1.hdr
2023-09-11 15:29:33.434 godot.osx.opt.tools.x86_64[13029:183538] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=2 "Caused GPU Hang Error (00000003:kIOGPUCommandBufferCallbackErrorHang)" UserInfo={NSLocalizedDescription=Caused GPU Hang Error (00000003:kIOGPUCommandBufferCallbackErrorHang)}
Clear sky panorama texture
===> doing load/unload of panorama texture:1
Load panorama sky from:res://assets/nancy_church_1.hdr
2023-09-11 15:29:34.512 godot.osx.opt.tools.x86_64[13029:183538] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=2 "Caused GPU Hang Error (00000003:kIOGPUCommandBufferCallbackErrorHang)" UserInfo={NSLocalizedDescription=Caused GPU Hang Error (00000003:kIOGPUCommandBufferCallbackErrorHang)}
2023-09-11 15:29:34.512 godot.osx.opt.tools.x86_64[13029:183550] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=4 "Ignored (for causing prior/excessive GPU errors) (00000004:kIOGPUCommandBufferCallbackErrorSubmissionsIgnored)" UserInfo={NSLocalizedDescription=Ignored (for causing prior/excessive GPU errors) (00000004:kIOGPUCommandBufferCallbackErrorSubmissionsIgnored)}
With my real world app I usually got a crash within 10 cycles.
I just did the same test on Godot 4.1.1 with the same min reproduction project above, on the mac mini M1. I have to slightly update the gdscript obviously because the property names are a bit different. It turns out 4.1.1 isn't a problem at all. Code below for godot 4:
func _ready():
for i in range(100):
print("===> doing load/unload of panorama texture:%d" % i)
_setSkyPanoramaTexture("res://assets/panorama.hdr")
_clearSkyPanoramaTexture()
func _setSkyPanoramaTexture(path: String) -> void:
print("Load panorama sky from:%s" % path)
var img = Image.new()
img.load(path)
var tex = ImageTexture.create_from_image(img)
$WorldEnvironment.environment.sky.sky_material.panorama = tex
func _clearSkyPanoramaTexture() -> void:
print("Clear sky panorama texture")
$WorldEnvironment.environment.sky.sky_material.panorama = null
So this issue is specific to Godot 3. (reproducible on 3.4.x and 3.5.x. Older version not tested)
Godot version
3.5.stable
System information
Mac mini M1 (running OS 13.5.2)
Issue description
In my app user can specfiy which panorama sky texture (.hdr) to use. After downloading the hdr and loading the hdr to the sky texture, godot will sometimes crash (at least once per 10 runs) on a Mac mini M1 (2020 version with 8GB ram) right at the part where it tries to set the loaded texture to the panorama sky.
Note that this issue only happens with GLES3.0.
First noticed this issue with godot 3.4.stable and can reproduce reliably with 3.5.2.
The
Environment
background mode isBG_COLOR_SKY
, and the sky is aPanoramaSky
. Code below will sometimes crash:However it never crashes on my other macbook pro M1 (14" 2021) running the same OS version:
13.5.2 (22G91)
. I've added a test loop to load/unload the panorama texture and it won't crash after 500 load/unload cycles. On my Mac mini M1 however it usually crashes within 100 cycles.The crash log looks a bit different but always from RasterizerStorageGLES3::sky_set_texture():
Another:
Crash logs generated by the OS are attached too. crash_log3.txt crash_log2.txt crash_log1.txt
Steps to reproduce
Run the min reproduction project below. It will crash within 5-10sec on a Mac mini M1 with GLES3.0. By setting the project to run with GLES2.0 it will not crash.
Minimal reproduction project
sky_crash_3.zip