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

Editor crashes after seconds on the native Linux version (Fedora 40 X11, works fine under Proton) #991

Open
HRudyPlayZ opened this issue Dec 15, 2024 · 9 comments
Labels
linux Only reproducible on Linux

Comments

@HRudyPlayZ
Copy link

HRudyPlayZ commented Dec 15, 2024

Everything is in the title.
Was using the latest Steam release.
I'm using an Nvidia GPU with the latest official drivers.

@turanszkij turanszkij added the linux Only reproducible on Linux label Dec 21, 2024
@Takuyax
Copy link

Takuyax commented Dec 28, 2024

I'm experiencing what might be the same issue. When I start it and only add primitives like cubes, planes, point lights to the scene, the editor keeps running fine for maybe up to a minute if I'm lucky. But when I try to load a scene, load an external file like a video, or mess around in menus, it will quickly stop responding and will not recover.

Running it in a terminal, then loading a scene and having it freeze, this is what it outputs:

config.ini loaded in 0.232828 milliseconds

Created GraphicsDevice_Vulkan (336 ms)
Adapter: NVIDIA GeForce RTX 3060

[wi::initializer] Initializing Wicked Engine, please wait...
Version: 0.71.625

Embedded shaders found: 389

wi::jobsystem Initialized with 32 cores in 3.60 ms
        High priority threads: 31
        Low priority threads: 30
        Streaming threads: 1

wi::input Initialized (0 ms)
wi::physics Initialized [Jolt Physics 5.2.0] (0 ms)
wi::lua Initialized (1 ms)
wi::texturehelper Initialized (49 ms)
wi::font Initialized (58 ms)
wi::audio Initialized [FAudio] (70 ms)
wi::TrailRenderer Initialized (133 ms)
wi::gpusortlib Initialized (134 ms)
wi::GPUBVH Initialized (143 ms)
wi::HairParticleSystem Initialized (157 ms)
wi::Ocean Initialized (168 ms)
wi::image Initialized (179 ms)
wi::renderer Initialized (241 ms)
wi::EmittedParticleSystem Initialized (246 ms)

[wi::initializer] Wicked Engine Initialized (250 ms)
Executed startup file: /home/tx/Applications/WickedEngine/startup.lua
Created envprobe depth buffer for request
        Resolution = 64 * 64 * 6
        Sample Count = 1
        Mip Levels = 1
        Format = D16_UNORM
        Memory = 48.0 KB

Created envprobe render target for request
        Resolution = 64 * 64 * 6
        Sample Count = 1
        Mip Levels = 3
        Format = R11G11B10_FLOAT
        Memory = 126.0 KB

Created envprobe filtering target for request
        Resolution = 64 * 64 * 6
        Sample Count = 1
        Mip Levels = 3
        Format = R11G11B10_FLOAT
        Memory = 126.0 KB

BlockCompress created a new raw block texture to fit request: BC6H_UF16 (64, 64)
        Format = R32G32B32A32_UINT
        Resolution = 64 * 64
        Array Size = 6
        Memory = 384.0 KB

wi::gui Initialized (0 ms)
[Resource check] Started checking resource manager for changes...
[Resource check] All up to date
[Resource check] Started checking resource manager for changes...
[Resource check] All up to date
[Editor] started loading model: /home/tx/wickedengine/test1.wiscene
Scene::Serialize took 0.00 seconds
[Editor] finished loading model: /home/tx/wickedengine/test1.wiscene
Killed

The scene I loaded is just the startup scene saved to a new file.
I'm running Kubuntu 24.04, with nvidia driver version 550.120

@brakhane
Copy link
Collaborator

The linux version accidentially allocated the editor object (which can be 8MB) on the stack, which could lead to stack overflows. This was fixed yesterday, and while it probably doesn't fix the crashes you see, it's still a possiblity, so it would be great if you could re check with the lastest master.

@Takuyax
Copy link

Takuyax commented Jan 12, 2025

With 0.71.645 the editor doesn't start at all for me. I just built from master and the behavior is back to how I described it with 0.71.625. It seems to run fine as long as I manipulate primitives, but crashes when I try to load files, or save the scene. When saving the scene, I still get the "Scene Saved" message before it crashes.

@brakhane
Copy link
Collaborator

brakhane commented Jan 13, 2025

@Takuyax
did 0.71.645 consistently crash? I ask because another known weird behaviour is that the editor can crash the first 1-2 times after significant changes (it shouldn't stay that way, but right now there are bigger issues)

For the master build: could you compile RelWithDebInfo and run it with gdb to dump the stacktrace?

The following should do it:

cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build     # adding --parallel speeds things up, but you might run out of memory
cd build/Editor
gdb WickedEngineEditor

then, in gdb, use run to start the program and bt to print the stacktrace once it crashes. Then post the stacktrace here

@Takuyax
Copy link

Takuyax commented Jan 13, 2025

When the problem occurs in the master build, the editor doesn't close, but just hangs indefinitely, so I can't enter the bt command to get the stacktrace. After I kill the editor, it says there is no stack, but when I terminate it instead, it outputs this:

[...]
Scene saved: /home/tx/wickedengine/test2.wiscene
[Shader check] All up to date
[Resource check] Started checking resource manager for changes...
[Resource check] All up to date

Thread 1 "WickedEngineEdi" received signal SIGTERM, Terminated.
0x00007ffff771b4cd in __GI___poll (fds=0x55555c0ab190, nfds=1, timeout=10) at ../sysdeps/unix/sysv/linux/poll.c:29
warning: 29     ../sysdeps/unix/sysv/linux/poll.c: No such file or directory
(gdb) bt
#0  0x00007ffff771b4cd in __GI___poll (fds=0x55555c0ab190, nfds=1, timeout=10) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffeaa07a43 in ?? () from /lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
#2  0x00007fffeae22db9 in ?? () from /lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
#3  0x00007fffeae077b0 in ?? () from /lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
#4  0x00007fffead2378e in ?? () from /lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
#5  0x0000555555a770c4 in operator() (__closure=__closure@entry=0x7fffffffd450)
    at /home/tx/src/WickedEngine/WickedEngine/wiGraphicsDevice_Vulkan.cpp:7233
#6  0x0000555555aaee23 in wi::graphics::GraphicsDevice_Vulkan::SubmitCommandLists (this=<optimized out>)
    at /home/tx/src/WickedEngine/WickedEngine/wiGraphicsDevice_Vulkan.cpp:7233
#7  0x0000555555a19ca0 in wi::Application::Run (this=this@entry=0x55555685b4c0 <editor>)
    at /home/tx/src/WickedEngine/WickedEngine/wiApplication.cpp:289
#8  0x0000555555a05d8a in sdl_loop () at /home/tx/src/WickedEngine/Editor/main_SDL2.cpp:18
#9  0x000055555565d814 in main (argc=<optimized out>, argv=<optimized out>)
    at /home/tx/src/WickedEngine/Editor/main_SDL2.cpp:145

I included the output from the point when I saved the scene, which reliably causes it to freeze. Then I termintated it. I hope this is useful.

@brakhane
Copy link
Collaborator

brakhane commented Jan 13, 2025

Thank you for the stacktrace. This seems to be the same issue as in #804 (of which #855 is a duplicate), it seems to hang when waiting for fences.

Could you try the following: in wiGraphicsDevice_Vulkan.cpp, around line 2951 there should be

if (videoFamily == VK_QUEUE_FAMILY_IGNORED &&
	queueFamily.queueFamilyProperties.queueCount > 0 &&
	(queueFamily.queueFamilyProperties.queueFlags & VK_QUEUE_VIDEO_DECODE_BIT_KHR) &&
	(queueFamilyVideo.videoCodecOperations & VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR)
	)
{
	videoFamily = i;
}

Just comment out the if or just the videoFamily = i. This should stop the video queue from being used, in the past, the hangs were mostly there; it would be interesting to know if that works around the issue you're seeing

@brakhane
Copy link
Collaborator

@Takuyax can you try the workaround above and say if it fixes the crash?

@Takuyax
Copy link

Takuyax commented Jan 21, 2025

I commented it out, but the problem still is the same. Saving the scene still causes the problem:

Scene saved: /home/tx/wickedengine/test2.wiscene
[Shader check] All up to date
[Resource check] Started checking resource manager for changes...
[Resource check] All up to date

Thread 1 "WickedEngineEdi" received signal SIGTERM, Terminated.
0x00007ffff771b4cd in __GI___poll (fds=0x55555c244470, nfds=1, timeout=10) at ../sysdeps/unix/sysv/linux/poll.c:29
warning: 29     ../sysdeps/unix/sysv/linux/poll.c: No such file or directory
(gdb) bt
#0  0x00007ffff771b4cd in __GI___poll (fds=0x55555c244470, nfds=1, timeout=10) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffeaa07a43 in ?? () from /lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
#2  0x00007fffeae22db9 in ?? () from /lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
#3  0x00007fffeae077b0 in ?? () from /lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
#4  0x00007fffead2378e in ?? () from /lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
#5  0x0000555555a77094 in operator() (__closure=__closure@entry=0x7fffffffd420)
    at /home/tx/src/WickedEngine/WickedEngine/wiGraphicsDevice_Vulkan.cpp:7233
#6  0x0000555555aaedf3 in wi::graphics::GraphicsDevice_Vulkan::SubmitCommandLists (this=<optimized out>)
    at /home/tx/src/WickedEngine/WickedEngine/wiGraphicsDevice_Vulkan.cpp:7233
#7  0x0000555555a19c90 in wi::Application::Run (this=this@entry=0x55555685b4c0 <editor>)
    at /home/tx/src/WickedEngine/WickedEngine/wiApplication.cpp:289
#8  0x0000555555a05d7a in sdl_loop () at /home/tx/src/WickedEngine/Editor/main_SDL2.cpp:18
#9  0x000055555565d804 in main (argc=<optimized out>, argv=<optimized out>)
    at /home/tx/src/WickedEngine/Editor/main_SDL2.cpp:145

@brakhane
Copy link
Collaborator

Thanks for checking 🤔

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

No branches or pull requests

4 participants