wings icon indicating copy to clipboard operation
wings copied to clipboard

Wings fails to start

Open slomomojo opened this issue 3 years ago • 6 comments

Hello,

On Arch Linux, Wings loads the splash image then immediately shuts down: https://aur.archlinux.org/packages/wings3d

There is a similar thread reported for Windows 10 on your official forum: http://www.wings3d.com/forum/showthread.php?tid=3079

Those two threads and the machine I tested use integrated Intel Graphics. I was also unable to get it to run on a different machine using an ATI card.

1/ As per the forum thread, I tried deleting the 'Preferences.txt' file to no effect. There are no 'wings_crash.dump' or 'erl_crash.dump' log files.

2/ The Arch Linux system log shows no errors

3/ I downgraded Erlang from 25.1 to 25.03 and 25.02 with no effect. Downgrading to Erlang 24.3.2 causes an application crash rather than a quick shutdown.

4/ Starting Wings from the console gives this message:

wings-2.2.9
Reading preferences from: /home/data/.config/Wings3D/Preferences.txt
14:06:20: Debug: "Tab" is not supported as a keyboard accelerator with GTK
14:06:20: Debug: "Shift+Tab" is not supported as a keyboard accelerator with GTK
OpenCL not available: {opencl_failed_previously,
                          "/home/data/.cache/Wings3D/opencl_tmp.txt"} 
Could not initialize OpenCL: env lighting limited 

5/ Deleting "/home/data/.cache/Wings3D/opencl_tmp.txt" has no effect and gives error message:

wings-2.2.9
Reading preferences from: /home/data/.config/Wings3D/Preferences.txt
14:09:28: Debug: "Tab" is not supported as a keyboard accelerator with GTK
14:09:28: Debug: "Shift+Tab" is not supported as a keyboard accelerator with GTK
InfoError: extensions [invalid_value]
Using OpenCL via gpu:Name Intel(R) OpenCL HD Graphics:VSN: OpenCL 3.0 
CL setup error: function_clause [{filename,join,
                                     [{error,bad_name},"shaders"],
                                     [{file,"filename.erl"},{line,453}]},
                                 {wings_cl,compile_1,3,
                                     [{file,"wings_cl.erl"},{line,121}]},
                                 {wings_light,cl_setup_1,0,
                                     [{file,"wings_light.erl"},{line,1301}]},
                                 {wings_light,cl_setup,1,
                                     [{file,"wings_light.erl"},{line,1275}]},
                                 {wings_light,init,2,
                                     [{file,"wings_light.erl"},{line,71}]},
                                 {wings,init_part2,3,
                                     [{file,"wings.erl"},{line,96}]},
                                 {proc_lib,init_p_do_apply,3,
                                     [{file,"proc_lib.erl"},{line,240}]}]
Could not initialize OpenCL: env lighting limited 

Other than that, I'm out of ideas. Is there a way to log/debug an Erlang program as it starts up? I did some reading but I'm not a developer and Erlang seems to be a rather unusual language.

slomomojo avatar Oct 30 '22 01:10 slomomojo

Hi @slomomojo. Thanks for give us some feedback we were waiting in that thread.

4/ Starting Wings from the console gives this message: That message isn't the cause of the crash for sure. It's a "normal" behaviour for some OpenCL incompatibility. It's the result of a fail like in 5/.

I noticed the InfoError: extensions [invalid_value] always appears when we are running on an Intel GPU with OpenCL 3.0 driver available.

So, not counting these two messages in console, after they be shown, does Wings3D is crashing and without any extra message has been appended to them?

Can you try something else, please? I don't know about Linux, but for Windows could you access the Intel control panel and switch the MSAA setting from Turn Off to Use Application Settings:

image

This was one issue I used as workaround after I get my Wings3D hard crashing without and apparent reason when I temporarily removed my NVidea GPU.

Micheus avatar Oct 31 '22 18:10 Micheus

Hi @Micheus

I've spent a week going down many rabbitholes:

1/ I can get the Wings interface to launch by bypassing the hardware drivers ('LIBGL_ALWAYS_SOFTWARE=1 wings3d' on Arch Linux) but no geometry is displayed. It will also launch in VirtualBox using vmware drivers again with no geometry.

2/ I don't use Windows but I tried various launch flags related to MSAA with no effect.

3/ There are no other errors in the standard output, system log, display server log, etc. I can attach a stacktrace but it's Linux specific.

4/ As mentioned, I also couldn't get it running on a computer with an AMD Radeon card. The motherboard has Intel integrated graphics but everything should be going through the Radeon.

Is it possible this is an Erlang problem? I'm not sure when Wings stopped working since I haven't used it in awhile due to health issues but I would guess August. OTP 25.0.4 was released August 18th and has a change to 'erlang:monotonic_time' which is used in wings_wm.erl (I think) [erlang/otp/issues/6165]. That seems to be the window manager. I'm grasping at straws here since I don't really understand Erlang at all.

I can raise an issue with the Intel driver folks but I wanted to rule out other issues first.

slomomojo avatar Nov 06 '22 02:11 slomomojo

Hi

function_clause [{filename,join,
                                     [{error,bad_name},"shaders"],
                                     [{file,"filename.erl"},{line,453}]},

This indicates that something is seriously wrong in your setup: it basically add the HOME dir path with another dir ("shaders")

{error, bad_name} indicates that something went wrong earlier, it should be a string holding the directory.

Looking at the first printout seems strange: is you user named data? '> Reading preferences from: /home/data/.config/Wings3D/Preferences.txt'

And does that directory exist, have the correct permissions and so on?

I.e. what $HOME set to and is it correct setup?

You don't write which wings-version you use, but the released wings will only work with OTP-24.3.xx Fixes to run with OTP-25 have been done in master branch on github.

dgud avatar Nov 06 '22 09:11 dgud

Hello,

This indicates that something is seriously wrong in your setup: it basically add the HOME dir path with another dir ("shaders") {error, bad_name} indicates that something went wrong earlier, it should be a string holding the directory.

I think that has more to do with the state of OpenCL on Linux. As far as I can tell, I had no OpenCL drivers installed and Wings worked fine before. I tried a few implementations (intel, amd, pocl) to no effect. From the error it looks like that's just for lighting? Wings uses OpenGL for rendering I assume?

Looking at the first printout seems strange: is you user named data? '> Reading preferences from: /home/data/.config/Wings3D/Preferences.txt'

Yeah, I was just trying to anonymize my setup and chose poorly. That is my user directory and it is configured correctly, yes.

You don't write which wings-version you use, but the released wings will only work with OTP-24.3.xx Fixes to run with OTP-25 have been done in master branch on github.

Wings 2.2.9. I'm the Arch linux maintainer. I'm responding to a user report and discovered my version didn't work either. To summarize, there are 2 incidents on Arch linux and one on Windows 10 of the same problem but obviously it isn't affecting everyone.

I'm going to try to roll back wxwidgets and see if that has any effect.

slomomojo avatar Nov 07 '22 03:11 slomomojo

The code in line 121 which crashes is:

Dir = filename:join(code:lib_dir(wings),"shaders"),

code:lib_dir(wings) should find the install directory of wings inside the wings installation, on my machine: On my machine that is: /home/dgud/wings-2.2.9/lib/wings-2.2.9

dgud avatar Nov 07 '22 09:11 dgud

If it can't find the shaders (or OpenCL code) it will never be able to even try to compile/load the OpenCL code. And it doesn't try to compile files without setting up OpenCL first, so that is successful, i.e. it could initialize OpenCL.

So this is caused by how you install wings on arch-linux, or something else but you should try to solve that first.

dgud avatar Nov 07 '22 09:11 dgud

Was just hit by this issue. Which actually seem like 2 separate issues.

First one for me was using Wayland, whereas the launcher script sets X11 backend. Removing this let the application launch. https://aur.archlinux.org/cgit/aur.git/tree/wings.sh?h=wings3d#n2

The second issue is a changed path (you can find it in the backtrace): https://github.com/dgud/wings/blob/4b36b97c999c16b36a4799612aa9b52e4c31d7d0/src/wings_cl.erl#L121

You package it to /usr/lib/wings3d, so this lookup fails. Symlinking this locally to /usr/lib/wings made this work for me. So I guess moving the directory inside the package should do it.

carstene1ns avatar Jan 03 '23 01:01 carstene1ns

@carstene1ns Thanks for looking at this.

First one for me was using Wayland, whereas the launcher script sets X11 backend.

Are you saying that things works with wayland backend nowadays? And not with X11?

The second issue is a changed path (you can find it in the backtrace):

That line in wings_cl is untouched since file was introduced in 2011, so I really don't understand why that stopped working the package must have changed.

dgud avatar Jan 03 '23 08:01 dgud

Are you saying that things works with wayland backend nowadays? And not with X11?

All I can say that Wayland is used on this system, so WX (and GTK) default to using their Wayland backend here. No idea why the XWayland backend does not work here, might be related to a recent wxwidgets update, but I can not verify, since I did not have to force it to X11 for other GTK apps yet (most problems related to that were Qt apps).

That line in wings_cl is untouched since file was introduced in 2011, so I really don't understand why that stopped working the package must have changed.

I agree with this. The package has been shipped with the /usr/lib/wings3d path for as long. I am a new user, so I have no idea if there is a big difference when using OpenCL or not. So far as I understand it, it is a optional dependency.

carstene1ns avatar Jan 03 '23 14:01 carstene1ns

The OpenCL printout tricked me. It have nothing to do with OpenCL

Something is buggy with EGL somewhere, compiling wxWidgets-3.2,x without EGL i.e. --disable-glanvasegl makes wings work on X11 again. This can be anything, erlang-wx (doubtful), wxWidgets (also doubtful), egl, gtk, X11, wayland. So this is way below my knowledge base.

The crash occurs after the OpenGL window is re-parented on another window/panel, this is internally done at startup, so it crashes after the splash window is shown.

I can rework the init code to not do a re-parent, but as soon as I attach a tools window to the wings main window on the "wrong" side a re-parent can not be avoided and it crashes, sigh.

I have attempted to make a simple example that crashes so I can report it upstream but I have so far failed with that.

So currently stuck with this issue.

dgud avatar Mar 03 '23 08:03 dgud

I have fixed this, but requires new erlang installation (i.e. Erlang/OTP-25.3.1 or later) and wings master branch or next release.

dgud avatar May 22 '23 13:05 dgud

Since the issue was fixed and the new release is already available I'm closing this issue.

Micheus avatar Oct 25 '23 12:10 Micheus

Just for the record is it this commit ? https://github.com/dgud/wings/commit/cacf19d40256e44a56b6432144802e5091f2a280

Mizux avatar Oct 25 '23 12:10 Mizux