SpacingBat3 / WebCord

A Discord and SpaceBar :electron:-based client implemented without Discord API.
MIT License
1.88k stars 93 forks source link

[GPU:XXXX] Process left us unexpectedly! #433

Closed Fxzzi closed 8 months ago

Fxzzi commented 1 year ago

Aknowledgements

Operating System / Platform

🐧️ Linux

Operating system architecture

x86_64

Electron version

v25.2.0

Application version

v4.3.0

Bug description

(GPU Optimizations disabled in webcord)

When running Webcord(-git) with the --ozone-platform-hint=auto flag for native wayland, I recieve these errors in the logs:

[10502:0625/124139.106197:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[10502:0625/124139.106252:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[10502:0625/124139.106324:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[10502:0625/124139.106349:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[10502:0625/124139.106366:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[10502:0625/124139.106382:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[10502:0625/124139.106413:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[GPU:8704] Process left us unexpectedly!
[GPU:TIP] Rest in peace, GPU... :(
[10544:0625/124139.215678:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[10544:0625/124139.215730:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[10544:0625/124139.215804:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[10544:0625/124139.215833:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[10544:0625/124139.215850:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[10544:0625/124139.215864:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[10544:0625/124139.215899:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[GPU:8704] Process left us unexpectedly!
[GPU:TIP] Rest in peace, GPU... :(
[UPDATE] Application is up-to-date!
[10555:0625/124139.323200:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[10555:0625/124139.323253:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[10555:0625/124139.323398:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[10555:0625/124139.323444:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[10555:0625/124139.323483:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[10555:0625/124139.323519:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[10555:0625/124139.323577:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[GPU:8704] Process left us unexpectedly!
[GPU:TIP] Rest in peace, GPU... :(

Subsequently, webcord no longer shows up in nvtop, as it is not using the GPU.

Running without this flag and in Xwayland instead makes Webcord use the GPU, as an electron process is shown inside nvtop: image

However I do receive an abundance of src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: xxxxxxx in the terminal. These specific errors only show on Xwayland and not on Wayland Native.

Running with the GPU opts. enabled in Webcord shows different errors. On Wayland AND Xwayland, I get the errors

[12241:0625/124605.472344:FATAL:gpu_init.cc(495)] Passthrough is not supported, GL is egl, ANGLE is 
[GPU:133] crashed
libEGL warning: egl: failed to create dri2 screen
[12312:0625/124606.083159:FATAL:gpu_init.cc(495)] Passthrough is not supported, GL is egl, ANGLE is 
[GPU:133] crashed
libEGL warning: egl: failed to create dri2 screen
[12356:0625/124606.726590:FATAL:gpu_init.cc(495)] Passthrough is not supported, GL is egl, ANGLE is 
[GPU:133] crashed

Additional context

If testing is needed on Electron 24, let me know and I'll let you know the results.

SpacingBat3 commented 1 year ago
[GPU:8704] Process left us unexpectedly!

Yeah, this error indicates GPU process just constantly crashes. This means two things:

I won't fix this issue, as I'm neither maintaining NVIDIA drivers nor being a Chromium developer. I would also like to remind that Wayland is still considered to be experimental on most browser engines – crashes are somewhat expected and a reason why WebCord isn't utilizing Wayland by default.

If testing is needed on Electron 24, let me know and I'll let you know the results.

It would be helpful to verify if it is a regression caused by a Chromium bump. And I believe Electron 23/24 still runs on recent enough Node.js version that supports new APIs WebCord utilizes from some time.

Fxzzi commented 1 year ago

It would be helpful to verify if it is a regression caused by a Chromium bump. And I believe Electron 23 still runs

Just tried on Electron 23 with Wayland flag.

[59132:0625/143044.403446:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is 
MESA-LOADER: failed to open nvidia-drm: /usr/lib/gbm/nvidia-drm_gbm.so: cannot open shared object file: Permission denied (search paths /usr/lib/gbm, suffix _gbm)
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /usr/lib/dri/nvidia-drm_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open nvidia-drm: /usr/lib/gbm/nvidia-drm_gbm.so: cannot open shared object file: Permission denied (search paths /usr/lib/gbm, suffix _gbm)
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /usr/lib/dri/nvidia-drm_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)

Despite these errors, the electron process does seem to be showing in nvtop, indicating ti is using the GPU.

Fxzzi commented 1 year ago

This is definitely a regression with Electron 25. After testing with Electron 23 and 24 I can say that webcord launches relatively normally although receiving those errors, whereas Electron 25 does not create the webcord window at all.

dryya commented 1 year ago

This actually seems to be happening to me with electron 24 as well, after a recent driver update (I think I'm on 535.54.03-6.4.3). Obviously not webcord's fault, but following this thread in case someone knows a workaround or what version to revert the driver to.

z411 commented 10 months ago

Very weird - I knew this was a Chromium issue back then but testing right now Chromium 118 seems to work with --ozone-platform-hint=auto. But Electron 27 is supposed to be built under Chromium 118, so I'm not sure what's going on.

EDIT: Just wanted to report that Wayland Electron works, but something in Webcord is making it crash.

image

Janrupf commented 8 months ago

Probably duplicate of or at least related to https://github.com/SpacingBat3/WebCord/issues/492, electron 28 fixed this at least on my system (NVIDIA drivers)

SpacingBat3 commented 8 months ago

I think I'll close this for now, since of reports this was fixed at upstream (but I'm pretty sure there will be more GPU crashes in the future with Electron updates and driver updates).

Also, as a side note, I wonder if there will be larger interest at NOUVEAU drivers in case of NVIDIA users, since those seem to work better than ever (I've switched NOUVEAU myself in order to try out new GSP.bin implementation, indeed it might be a reliable alternative to using NVIDIA drivers and their GL implementation) when it comes to the performance with GSP.bin patches and next kernel release (6.7 on my PC) with relatively new hardware thanks to re-clocking support, which could be a great reason to try them out in case of Wayland users (since I saw it is still quite controversial whenever proprietary NVIDIA drivers support Wayland properly, e.g. XFCE4 developers still claim NVIDIA not to support Wayland).