Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intel(R) Graphics (ADL GT2) RasterizerStorageGLES3::_render_target_allocate freezes on linux #72871

Closed
jamie-pate opened this issue Feb 8, 2023 · 3 comments

Comments

@jamie-pate
Copy link
Contributor

jamie-pate commented Feb 8, 2023

Godot version

3.5.1-stable

System information

Intel(R) Graphics (ADL GT2), Linux VAN-200937-LT0 5.15.0-58-generic #64~20.04.1-Ubuntu,Ubuntu 20.04.5 LTS, GLES3

Issue description

WORKAROUND:

Removing my 'precaching' logic seems to prevent the lockup in my application (see repro _precache_shaders())

Main thread locks up during call to glTexImage2D(target, i, internalformat, width, height, 0, format, type, nullptr);

i: 0
target: 3553
levels: 10
internalformat: 32856
width:2560
height:1800
format:6408
type:5121

Similar issue on GLES2 for windows: #55395

libpthread.so.0!__lll_lock_wait(int * futex, int private) (/build/glibc-SzIz7B/glibc-2.31/nptl/lowlevellock.c:52)
libpthread.so.0!__GI___pthread_mutex_lock(pthread_mutex_t * mutex) (/build/glibc-SzIz7B/glibc-2.31/nptl/pthread_mutex_lock.c:80)
iris_dri.so![Unknown/Just-In-Time compiled code] (Unknown Source:0)
glTexStorage2DCustom(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type) (/home/jpate/build/src/godot/drivers/gles3/rasterizer_storage_gles3.cpp:127)
RasterizerStorageGLES3::_render_target_allocate(RasterizerStorageGLES3 * const this, RasterizerStorageGLES3::RenderTarget * rt) (/home/jpate/build/src/godot/drivers/gles3/rasterizer_storage_gles3.cpp:7244)
RasterizerStorageGLES3::render_target_set_size(RasterizerStorageGLES3 * const this, RID p_render_target, int p_width, int p_height) (/home/jpate/build/src/godot/drivers/gles3/rasterizer_storage_gles3.cpp:7340)
VisualServerViewport::viewport_set_size(VisualServerViewport * const this, RID p_viewport, int p_width, int p_height) (/home/jpate/build/src/godot/servers/visual/visual_server_viewport.cpp:407)
VisualServerRaster::viewport_set_size(VisualServerRaster * const this, RID arg1, int arg2, int arg3) (/home/jpate/build/src/godot/servers/visual/visual_server_raster.h:482)
VisualServerWrapMT::viewport_set_size(VisualServerWrapMT * const this, RID p1, int p2, int p3) (/home/jpate/build/src/godot/servers/visual/visual_server_wrap_mt.h:391)
Viewport::set_size(Viewport * const this, const Size2 & p_size) (/home/jpate/build/src/godot/scene/main/viewport.cpp:717)
MethodBind1<Vector2 const&>::call(MethodBind1<Vector2 const&> * const this, Object * p_object, const Variant ** p_args, int p_arg_count, Variant::CallError & r_error) (/home/jpate/build/src/godot/core/method_bind.gen.inc:759)
ClassDB::set_property(Object * p_object, const StringName & p_property, const Variant & p_value, bool * r_valid) (/home/jpate/build/src/godot/core/class_db.cpp:1010)
Object::set(Object * const this, const StringName & p_name, const Variant & p_value, bool * r_valid) (/home/jpate/build/src/godot/core/object.cpp:422)
Variant::set_named(Variant * const this, const StringName & p_index, const Variant & p_value, bool * r_valid) (/home/jpate/build/src/godot/core/variant_op.cpp:1540)
GDScriptFunction::call(GDScriptFunction * const this, GDScriptInstance * p_instance, const Variant ** p_args, int p_argcount, Variant::CallError & r_err, GDScriptFunction::CallState * p_state) (/home/jpate/build/src/godot/modules/gdscript/gdscript_function.cpp:613)
GDScriptInstance::call(GDScriptInstance * const this, const StringName & p_method, const Variant ** p_args, int p_argcount, Variant::CallError & r_error) (/home/jpate/build/src/godot/modules/gdscript/gdscript.cpp:1196)
Object::call(Object * const this, const StringName & p_method, const Variant ** p_args, int p_argcount, Variant::CallError & r_error) (/home/jpate/build/src/godot/core/object.cpp:899)
MessageQueue::_call_function(MessageQueue * const this, Object * p_target, const StringName & p_func, const Variant * p_args, int p_argcount, bool p_show_error) (/home/jpate/build/src/godot/core/message_queue.cpp:241)
MessageQueue::flush(MessageQueue * const this) (/home/jpate/build/src/godot/core/message_queue.cpp:284)
Main::iteration() (/home/jpate/build/src/godot/main/main.cpp:2281)

Steps to reproduce

Multiple (> 32) Viewports of various sizes

Seems to happen more frequently with larger pixel sizes.

May also happen in RasterizerStorageGLES3::texture_set_data (called from ImageTexture:::create_from_image())

Maybe related to background loading of resources.. combined with 'material precaching' logic (adding all materials from a scene onto MeshInstances in front of the camera before adding the scene to the tree, after loading it in the background)

Minimal reproduction project

Reproduces by randomly setting the window size until it locks up
repro-intel-gles3-lockup.zip

This does not reproduce the issue, but has a bunch of suspicious code :) I ran out of time trying to reproduce it.
repro-intel-gles3-xe-linux-driver-vp-lock.zip

@jamie-pate
Copy link
Contributor Author

jamie-pate commented Feb 9, 2023

Also seems to freeze when resizing the window!

@jamie-pate
Copy link
Contributor Author

Also reproduced on the following versions with the repro-intel-gles3-lockup.zip
3.2.3
3.3.4
3.4.4

Reported against mesa here:

https://gitlab.freedesktop.org/mesa/mesa/-/issues/8266

@jamie-pate
Copy link
Contributor Author

Unable to reproduce on ubuntu 22.04

OpenGL: renderer: Mesa Intel Graphics (ADL GT2)
v: 4.6 Mesa 23.0.4-0ubuntu1~22.04.1 direct render: Yes
Kernel: 6.5.0-18-generic x86_64 bits: 64 compiler: N/A
Desktop: GNOME 42.9 tk: GTK 3.24.33 wm: gnome-shell dm: GDM3
Distro: Ubuntu 22.04.4 LTS (Jammy Jellyfish)

@Calinou Calinou removed this from the 3.x milestone Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants