Closed Master811129 closed 1 year ago
BTW Installing
libnvidia-egl-wayland1
with apt usually solves this issue on host OS. maybe you should add this as astage-package
to snap container?
Are you sure that works? I believe NVIDIA driver is in a separate repository for proprietary packages which is not accessible in snapcraft. NVIDIA userspace libraries also require the same kernel driver version so I guess embedding NVIDIA driver will lead to crashes on every system that uses other driver version. I'm not aware of any snap package embedding NVIDIA driver, I'm highly doubt that's how it should be/how it works. I'm not sure snap as ecosystem is compatible with NVIDIA at all though, wouldn't be surprised if not and you should just avoid it.
tdesktop doesn't use opengl for the main window though, it's rendered completely on CPU (cause QtWidgets is CPU-based). The only places with OpenGL shaders are the media viewer and the call window, so high CPU consumption on animations is expected, unfortunately, cause it renders on CPU with 7ms timer...
The only things you can do are disable the animations or migrate to Telegram-A which is based on Electron and so is completely GPU-based.
Are you sure that works? I believe NVIDIA driver is in a separate repository for proprietary packages which is not accessible in snapcraft. NVIDIA userspace libraries also require the same kernel driver version so I guess embedding NVIDIA driver will lead to crashes on every system that uses other driver version. I'm not aware of any snap package embedding NVIDIA driver, I'm highly doubt that's how it should be/how it works. I'm not sure snap as ecosystem is compatible with NVIDIA at all though, wouldn't be surprised if not and you should just avoid it.
I only wanted to tell devs how I fix this warning when it happens on my other Qt apps. I'm not an expert about snaps.
so high CPU consumption on animations is expected,
It is not "expected" to have more than ~50% CPU usage + screaming CPU fan. I have the exact same version of telegram-desktop as a pacman
package on the same machine on Arch Linux (I have two linux distros dual-booted) and this problem simply doesn't exist there CPU usage is "expected". this is a packaging issue IMO. on my arch system that EGL warning doesn't exist.
here is telegram running in terminal on arch linux
telegram-desktop
qt.svg: Error while inflating gzip file: SVG format check failed
qt.svg: Error while inflating gzip file: SVG format check failed
qt.svg: Error while inflating gzip file: SVG format check failed
qt.svg: Error while inflating gzip file: SVG format check failed
qt.svg: Error while inflating gzip file: SVG format check failed
qt.svg: Error while inflating gzip file: SVG format check failed
qt.svg: Error while inflating gzip file: SVG format check failed
and it runs perfectly fine.
It's indeed weird then cause the main window doesn't use OpenGL
If it's really about NVIDIA drivers then I'm highly doubt anything could be done :(. Only snapd folks can fix this perhaps.
Marking as can't reproduce since no tdesktop developer has NVIDIA hardware
Sad, Im just posting additional info; running the app with this flag gives this result showing that libEGL fails to find some files in the snap sandbox:
LIBGL_DEBUG=verbose telegram-desktop
[ALSOFT] (EE) Failed to connect PipeWire event context (errno: 112)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/ubuntu/snap/telegram-desktop/5002/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/ubuntu/snap/telegram-desktop/5002/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/ubuntu/snap/telegram-desktop/5002/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/ubuntu/snap/telegram-desktop/5002/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/ubuntu/snap/telegram-desktop/5002/.drirc: No such file or directory.
libEGL warning: egl: failed to create dri2 screen
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/ubuntu/snap/telegram-desktop/5002/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/ubuntu/snap/telegram-desktop/5002/.drirc: No such file or directory.
QPainter::begin: Paint device returned engine == 0, type: 2
QWidget::render: Cannot render with an inactive painter
You may get a better result by reporting this to snapd. I believe that's the only component that can give access to NVIDIA drivers.
Sad, Im just posting additional info; running the app with this flag gives this result showing that libEGL fails to find some files in the snap sandbox:
Apparently it just logs all possible paths given that you set verbose log level? The thing it searches for is likely $SNAP/usr/share/drirc.d/00-mesa-defaults.conf
. It's just a config with per-app workarounds.
I noticed this thread on snapcraft forum: https://forum.snapcraft.io/t/snaps-dont-detect-nvidia-driver-in-wayland/35065. Looks like your issue.
Same here. 400% cpu usage while the animated GIF picker is open on nvidia + wayland.
I noticed this thread on snapcraft forum: https://forum.snapcraft.io/t/snaps-dont-detect-nvidia-driver-in-wayland/35065. Looks like your issue.
This issue has been just fixed in gnome-42-2204 by adding libnvidia-egl-wayland1
to stage-packages
and exporting __EGL_EXTERNAL_PLATFORM_CONFIG_DIRS "$SNAP_DESKTOP_RUNTIME/usr/share/egl/egl_external_platform.d"
.
Hm, we need a fix without gnome extension...
Hello again. today my client got automatically updated to 4.10.3 by snapd. and my CPU usage issue has been solved! I have expected CPU usage, just like before. here is the output of the new version of the app.
telegram-desktop
[ALSOFT] (EE) Failed to connect PipeWire event context (errno: 112)
libEGL warning: egl: failed to create dri2 screen
QPainter::begin: Paint device returned engine == 0, type: 2
QWidget::render: Cannot render with an inactive painter
[libvpx-vp9 @ 0x7fd546f75900] v1.11.0
[libvpx-vp9 @ 0x7fd546f75900] v1.11.0
** (telegram-desktop:36640): WARNING **: 21:25:51.558: atk-bridge: get_device_events_reply: unknown signature
Note that the new blue libvpx-vpx
stuff plus the absence of qt.svg
errors in the terminal. It seems that the new stuff is being utilized? I'm almost sure the the latest commit on snapcraft.yml
(716cc6e) fixed it.🤷♂️ Thanks @ilya-fedin.
Still, I have the libegl warning issue.🙁
No, it means this was unrelated, just like I assumed initially (there's no OpenGL usage in main window after all). It's likely it was emoji cache update, there was another report about this: #26851. It happens every time emojis are updated to a new Unicode standard. Now apparently the cache has finally done regenerating on your machine so it no longer consumes CPU.
Hm, we need a fix without gnome extension...
Fwiw, the fix in the gnome extension is just two lines of generic code: libnvidia-egl-wayland1
was added to stage-packages, and __EGL_EXTERNAL_PLATFORM_CONFIG_DIRS
exported.
It's likely it was emoji cache update, there was another report about this: #26851. It happens every time emojis are updated to a new Unicode standard. Now apparently the cache has finally done regenerating on your machine so it no longer consumes CPU.
I'm sure 100% It wasn't caching thing. because at that time, disabling animations, more-or-less fixed the problem for me... even without disabling animations if the app had static screen without any moving section (spinning wheel for proxy or spoiler animation on texts, etc.) the CPU usage was normal.
Then the commit you referenced is unlikely to help either, it's not related to animations in any way. It's a workaround of a crash on startup.
Steps to reproduce
Expected behaviour
Telegram with lower cpu usage
Actual behaviour
Telegram with high cpu usage (~50%).
More Info about the issue:
On Wayland/Nvidia, Telegram has high CPU usage when the screen is getting updated so running animations, scrolling, etc give me high CPU usage... So hw acceleration might be disabled. Running telegram from terminal shows this:
note this:
libEGL warning: egl: failed to create dri2 screen
probably you should ship the snap package with proper libs. BTW Installinglibnvidia-egl-wayland1
with apt usually solves this issue on host OS. maybe you should add this as astage-package
to snap container? Im not sure.Operating system
kubuntu 23.04
Version of Telegram Desktop
4.9.5
Installation source
Snap
Crash ID
No response
Logs