Stellarium / stellarium

Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
https://stellarium.org
GNU General Public License v2.0
7.81k stars 825 forks source link

Cannot launch under wayland : Qt platform problem #3967

Open yrogge opened 3 weeks ago

yrogge commented 3 weeks ago

Expected Behaviour

Normal application launch, as worked "before" last system update.

Actual Behaviour

Freeze when launching (see log attached)

Steps to reproduce

Simply type "Stellarium" in terminal

System

Logfile

See attachments Terminal output: Stellarium Log.txt Log file: log.txt

gzotti commented 3 weeks ago

Reads like a driver setup problem to me.

10110111 commented 3 weeks ago

Does any other Qt6-based app work? The following hints that the problem may be quite general:

QEGLPlatformContext: Failed to create context: 3009

Also, do you have a discrete GPU installed, possibly in an NVIDIA Optimus-like way?

yrogge commented 3 weeks ago

I'm not using any NVIDIA driver. I tried to resintall avery Qt6 stuff, but still same behavior. The way to bypass is

10110111 commented 3 weeks ago

You should report this to your distro maintainers, because this looks like a breakage of Wayland OpenGL support for all Qt6 apps.

yrogge commented 3 weeks ago

OK. I'll do. Thank you.

alex-w commented 3 weeks ago

You should report this to your distro maintainers, because this looks like a breakage of Wayland OpenGL support for all Qt6 apps.

The package is from our PPA and standard package may have differences

alex-w commented 3 weeks ago

Yep, standard packages in Ubuntu are Qt5-based

10110111 commented 3 weeks ago

The package is from our PPA and standard package may have differences

In any case, the messages from Qt indicate a serious problem with OpenGL support. Or is Qt6 also provided by the PPA?

alex-w commented 3 weeks ago

The package is from our PPA and standard package may have differences

In any case, the messages from Qt indicate a serious problem with OpenGL support. Or is Qt6 also provided by the PPA?

No, we’re using qt packages from standard repository

10110111 commented 3 weeks ago

No, we’re using qt packages from standard repository

So then indeed, it looks like the standard Qt6 packages are broken.

gzotti commented 3 weeks ago

Can we just add that environment variable to the startup? Or detect the necessity to do so first? (Is there a system configuration where you won't set xcb?)

10110111 commented 3 weeks ago

Can we just add that environment variable to the startup?

We shouldn't try to work around all possible broken setups.

yrogge commented 3 weeks ago

I agree. Ubuntu does not even initialize the QT_QPA_PLATFORM variable (to value "wayland" normally) for Qt environments. If needed, it can be done in the .profile fille at session startup, but selecting "xcb" for all apps would be incoherent. Hopefully, "Open with QPA platform XCB" is one of the predefined option of the .desktop file used to launch Stellarium.

gzotti commented 3 weeks ago

I did not mean to set xcb globally. But just as we can set some OpenGL variable to ANGLE or SOFTWARE(?) for Windows, we could set another envvar to xcb on Linux, if needed. Is there a way to automatically detect if it's needed?

10110111 commented 3 weeks ago

It seems to me that you are rushing to insert kludges for issues that may well be solved relatively soon by Ubuntu maintainers (assuming the OP has reported it there).

Such things should work out of the box, whether on X11 or on Wayland, and I suppose they used to work before the upgrade. It's just the upgrade that broke them, and, if I understood the OP correctly, it was a system upgrade, not a Stellarium upgrade. If Qt can't figure out that it's on Wayland, or that it should use EGL, or whatever else, there's something broken, and it should be sorted out in the distro, rather than getting worked around by the apps.

gzotti commented 3 weeks ago

I happily leave the actual 5-minute fix to those affected.

alex-w commented 3 weeks ago

The kludge for choosing XCB is included already in desktop file (it was added a long time ago) ;)

yrogge commented 3 weeks ago

Bug has been reported to Ubuntu/Debian Qt6 developpers https://bugs.launchpad.net/ubuntu/+source/qt6-base/+bug/2086676