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

[Windows] Offload RenderingDevice creation test to subprocess. #103245

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Feb 24, 2025

Might fix #101659

@akien-mga
Copy link
Member

akien-mga commented Feb 24, 2025

I get this build error with mingw-gcc from Fedora 41:

platform/windows/crash_handler_windows_signal.cpp: In function 'void CrashHandlerException(int)':
platform/windows/crash_handler_windows_signal.cpp:137:17: error: 'quick_exit' was not declared in this scope; did you mean '_c_exit'?
  137 |                 quick_exit(1);
      |                 ^~~~~~~~~~
      |                 _c_exit

Seems like Fedora's mingw64 cstdlib has it depend on _GLIBCXX_HAVE_QUICK_EXIT, and that define is not enabled in /usr/include/c++/x86_64-w64-mingw32/bits/c++config.h. Not sure why, MSVC seems to have it since VS 2015, maybe mingw maintainers just never caught it and enabled it.

@bruvzg
Copy link
Member Author

bruvzg commented Feb 24, 2025

I get this build error with mingw-gcc from Fedora 41

Replaced it with std::_Exit, we do not care about at_quick_exit, just need a "normal" termination to avoid any system error popups.

@akien-mga
Copy link
Member

akien-mga commented Feb 24, 2025

I'm now getting this linking error:

x86_64-w64-mingw32-g++ -o bin/godot.windows.editor.x86_64.exe -Wl,--subsystem,windows -static -flto=64 -fno-use-linker-plugin -fwhole-program -Wl,--stack,8388608 -s -O2 platform/windows/godot_windows.windows.editor.x86_64.o platform/windows/os_windows.windows.editor.x86_64.o platform/windows/display_server_windows.windows.editor.x86_64.o platform/windows/key_mapping_windows.windows.editor.x86_64.o platform/windows/joypad_windows.windows.editor.x86_64.o platform/windows/tts_windows.windows.editor.x86_64.o platform/windows/windows_terminal_logger.windows.editor.x86_64.o platform/windows/windows_utils.windows.editor.x86_64.o platform/windows/native_menu_windows.windows.editor.x86_64.o platform/windows/gl_manager_windows_native.windows.editor.x86_64.o platform/windows/gl_manager_windows_angle.windows.editor.x86_64.o platform/windows/wgl_detect_version.windows.editor.x86_64.o platform/windows/rendering_context_driver_vulkan_windows.windows.editor.x86_64.o platform/windows/drop_target_windows.windows.editor.x86_64.o platform/windows/test_rd_and_gl.windows.editor.x86_64.o platform/windows/crash_handler_windows_signal.windows.editor.x86_64.o platform/windows/godot_res.windows.editor.x86_64.o -L/root/mesa/bin -L/root/angle main/libmain.windows.editor.x86_64.a modules/libmodules.windows.editor.x86_64.a modules/libmodule_text_server_adv.windows.editor.x86_64.a modules/libmodule_fbx.windows.editor.x86_64.a modules/libmodule_gltf.windows.editor.x86_64.a modules/libmodule_ktx.windows.editor.x86_64.a modules/libmodule_msdfgen.windows.editor.x86_64.a modules/libmodule_navigation.windows.editor.x86_64.a modules/libmodule_theora.windows.editor.x86_64.a modules/libmodule_vorbis.windows.editor.x86_64.a modules/libmodule_astcenc.windows.editor.x86_64.a modules/libmodule_basis_universal.windows.editor.x86_64.a modules/libmodule_bcdec.windows.editor.x86_64.a modules/libmodule_betsy.windows.editor.x86_64.a modules/libmodule_bmp.windows.editor.x86_64.a modules/libmodule_camera.windows.editor.x86_64.a modules/libmodule_csg.windows.editor.x86_64.a modules/libmodule_cvtt.windows.editor.x86_64.a modules/libmodule_dds.windows.editor.x86_64.a modules/libmodule_enet.windows.editor.x86_64.a modules/libmodule_etcpak.windows.editor.x86_64.a modules/libmodule_freetype.windows.editor.x86_64.a modules/libmodule_gdscript.windows.editor.x86_64.a modules/libmodule_glslang.windows.editor.x86_64.a modules/libmodule_godot_physics_2d.windows.editor.x86_64.a modules/libmodule_godot_physics_3d.windows.editor.x86_64.a modules/libmodule_gridmap.windows.editor.x86_64.a modules/libmodule_hdr.windows.editor.x86_64.a modules/libmodule_interactive_music.windows.editor.x86_64.a modules/libmodule_jolt_physics.windows.editor.x86_64.a modules/libmodule_jpg.windows.editor.x86_64.a modules/libmodule_jsonrpc.windows.editor.x86_64.a modules/libmodule_lightmapper_rd.windows.editor.x86_64.a modules/libmodule_mbedtls.windows.editor.x86_64.a modules/libmodule_meshoptimizer.windows.editor.x86_64.a modules/libmodule_minimp3.windows.editor.x86_64.a modules/libmodule_mobile_vr.windows.editor.x86_64.a modules/libmodule_multiplayer.windows.editor.x86_64.a modules/libmodule_noise.windows.editor.x86_64.a modules/libmodule_ogg.windows.editor.x86_64.a modules/libmodule_openxr.windows.editor.x86_64.a modules/libmodule_raycast.windows.editor.x86_64.a modules/libmodule_regex.windows.editor.x86_64.a modules/libmodule_svg.windows.editor.x86_64.a modules/libmodule_tga.windows.editor.x86_64.a modules/libmodule_tinyexr.windows.editor.x86_64.a modules/libmodule_upnp.windows.editor.x86_64.a modules/libmodule_vhacd.windows.editor.x86_64.a modules/libmodule_webp.windows.editor.x86_64.a modules/libmodule_webrtc.windows.editor.x86_64.a modules/libmodule_websocket.windows.editor.x86_64.a modules/libmodule_webxr.windows.editor.x86_64.a modules/libmodule_xatlas_unwrap.windows.editor.x86_64.a modules/libmodule_zip.windows.editor.x86_64.a platform/libplatform.windows.editor.x86_64.a drivers/libdrivers.windows.editor.x86_64.a editor/libeditor.windows.editor.x86_64.a scene/libscene.windows.editor.x86_64.a servers/libservers.windows.editor.x86_64.a core/libcore.windows.editor.x86_64.a modules/freetype/libfreetype_builtin.windows.editor.x86_64.a modules/msdfgen/libmsdfgen_builtin.windows.editor.x86_64.a modules/text_server_adv/libharfbuzz_builtin.windows.editor.x86_64.a modules/text_server_adv/libgraphite_builtin.windows.editor.x86_64.a modules/text_server_adv/libicu_builtin.windows.editor.x86_64.a -lmingw32 -ldsound -lole32 -ld3d9 -lwinmm -lgdi32 -liphlpapi -lshlwapi -lwsock32 -lws2_32 -lkernel32 -loleaut32 -lsapi -ldinput8 -ldxguid -lksuser -limm32 -lbcrypt -lcrypt32 -lavrt -luuid -ldwmapi -ldwrite -lwbemuuid -lntdll -lpsapi -ldbghelp -ldxgi -ldxguid -lNIR.windows.x86_64 -lversion -lEGL.windows.x86_64 -lGLES.windows.x86_64 -lANGLE.windows.x86_64 -ldxgi -ld3d9 -ld3d11 -lpsapi
/usr/lib/gcc/x86_64-w64-mingw32/14.2.1/../../../../x86_64-w64-mingw32/bin/ld: main/main.windows.editor.x86_64.o:main.cpp:(.text+0x17e37): undefined reference to `test_create_rendering_device_and_gl()'

Building with scons production=yes use_mingw=yes angle_libs=/root/angle mesa_libs=/root/mesa d3d12=yes

@bruvzg

This comment was marked as outdated.

@bruvzg
Copy link
Member Author

bruvzg commented Feb 24, 2025

Moved it to OS, should prevent LTO linking issues and avoid platform specific code outside platforms.

@akien-mga
Copy link
Member

akien-mga commented Feb 24, 2025

I made a test build with the official buildsystem for Windows x86_64 and x86_32, both standard and mono:

https://editor.godotengine.org/testing/4.4-rc1-pr103245/

Edit: New build from ab71749, please test this one:

https://editor.godotengine.org/testing/4.4-rc1-pr103245-v2/

I'll ask in the issue for testers.

@clayjohn
Copy link
Member

This will block users from creating new projects using the Forward+ and Mobile renderers on the affected drivers.

We will need to use a different check for project creation because there we only care if RD is supported, we don't care if RD can run at the same time as OpenGL

@bruvzg
Copy link
Member Author

bruvzg commented Feb 24, 2025

This will block users from creating new projects using the Forward+ and Mobile renderers on the affected drivers.

Added second RD only check version.

Verified

This commit was signed with the committer’s verified signature.
AThousandShips A Thousand Ships
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have two confirmations that it fixes the crash for affected users on Windows, so let's go!

Some more testing will be needed to validate whether VRAM compression and lightmap baking works, but this will be easier to do once this is included in 4.4.rc2 (and worst case, this can be fixed after the 4.4 release if it doesn't work, as long as it's not crashing).

@akien-mga akien-mga merged commit 82aacc1 into godotengine:master Feb 25, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

return true;
} else {
created_rendering_device = RenderingDeviceCreationStatus::FAILURE;
return false;
Copy link
Member

@AThousandShips AThousandShips Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes unreachable code error, will write a fix (Seems we need more fine-grained testing for Windows builds as this is the second regression in a short bit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility renderer crash with Nvidia GPU and 566.36 drivers on Windows
4 participants