Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916957 - net-libs/webkit-gtk: versions 2.42.1 and 2.42.1-r410 don't work with nvidia gpu (x11-drivers/nvidia-drivers)
Summary: net-libs/webkit-gtk: versions 2.42.1 and 2.42.1-r410 don't work with nvidia g...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-06 10:48 UTC by lfpraca
Modified: 2024-02-02 10:39 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Script to test webkit-gtk (test.py,669 bytes, text/x-python)
2023-11-06 10:48 UTC, lfpraca
Details
emerge-info (emerge-info,19.97 KB, text/plain)
2023-11-06 11:33 UTC, lfpraca
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lfpraca 2023-11-06 10:48:46 UTC
Created attachment 874147 [details]
Script to test webkit-gtk

When trying to start webkit-gtk versions 2.42.1 or 2.42.1-r410 on my computer using an nvidia gpu with proprietary drivers, I get the error `EGLDisplay Initialization failed: EGL_NOT_INITIALIZED`. The window starts, but not the browser.

This is the case using the latest stable nvidia drivers. Using the latest ~amd64 nvidia-drivers, I run into webkit bug 259644 instead, reported by other users on their bugzilla.

I used the python script in the attachments to test wether webkit-gtk would start.

After downgrading the packages to 2.40.5 and 2.40.5-r410, both versions work without issue.

This doesn't seem to be an issue with the ebuild itself, but these two versions seem to break on an accept amd64 keyword system with nvidia graphics cards.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-06 10:51:24 UTC
Please also include emerge --info and any other output in full you get from webkit-gtk.
Comment 2 lfpraca 2023-11-06 11:33:17 UTC
All the output I got from webkit-gtk, outside of the usual css warnings unrelated to this issue was:
`
EGLDisplay Initialization failed: EGL_NOT_INITIALIZED
Cannot create EGL context: invalid display (last error: EGL_SUCCESS)
`

emerge --info added to the attachments
Comment 3 lfpraca 2023-11-06 11:33:35 UTC
Created attachment 874151 [details]
emerge-info
Comment 4 Ionen Wolkens gentoo-dev 2023-11-06 13:46:27 UTC
Maybe try updating to ~arch >=gui-libs/egl-wayland-1.1.13 (could try it with both stable and ~arch drivers). It's not much different from the currently stable snapshot beside a few commits, but some of these could "potentially" help (it's due to be stabled in a week or so).

Asking given egl-wayland did need fixes for webkit-gtk in the past, but beside that I have no idea from nvidia's end (beside that nvidia and wayland is still pretty finnicky and hard to recommend "currently", 545 drivers does fix a lot of things but it's not due to be stabled being a non-production branch).
Comment 5 Ionen Wolkens gentoo-dev 2023-11-06 13:53:02 UTC
(In reply to Ionen Wolkens from comment #4)
> wayland
Oh and, I have been assuming(?) that this is wayland because of the error sounded like it. But just seen that your emerge --info probably does not have a global USE=wayland with that profile, so nevermind what I said if this is Xorg.
Comment 6 lfpraca 2023-11-06 23:42:04 UTC
I am indeec on Xorg. For :4 I have the wayland flag enabled because I need it for development, for :4.1 I do not have it enabled. For both versions I got the issue I described.

Also, I checked and I don't have the package egl-wayland installed (:4 <=2.40.5 works without it, even with the wayland useflag)
Comment 7 lfpraca 2023-12-18 11:26:20 UTC
This bug also affects 2.42.3 and 2.42.3-r410
Comment 8 Branko Grubic 2023-12-20 18:04:07 UTC
Hi, 

Sorry for jumping in, I'm not using nvidia as my primary card, but I could test as well since I have one, but not used as primary GPU.

This looks interesting and potentially related
* https://github.com/WebKit/WebKit/pull/18614
* https://bugs.webkit.org/show_bug.cgi?id=262607 (workaround)
* https://bugs.webkit.org/show_bug.cgi?id=261874 (related bug)


Found those patches applied by Archlinux 
https://gitlab.archlinux.org/archlinux/packaging/packages/webkit2gtk-4.1/-/blob/main/PKGBUILD?ref_type=heads#L105
https://gitlab.archlinux.org/archlinux/packaging/packages/webkitgtk-6.0/-/blob/main/PKGBUILD?ref_type=heads#L105
...

Regards,
Branko
Comment 9 lfpraca 2024-02-02 10:25:49 UTC
Thank you for your response, the workaround applied as a patch in Arch Linux didn't fix the problem, at least in my situation, but I found after some trial and error that as a workaround, if I set both WEBKIT_FORCE_DMABUF_RENDERER and __NV_PRIME_RENDER_OFFLOAD to 1, it starts to work seemingly without issue.

I do get the `EGLDisplay Initialization failed: EGL_NOT_INITIALIZED` error previously mentioned and an additional error: `GTK failed to initialize GL: No available configurations for the given RGBA pixel format.`, but despite that, the webkit-gtk app I was trying to run launches and runs.
Comment 10 lfpraca 2024-02-02 10:34:03 UTC
(In reply to lfpraca from comment #9)

Turns out I just needed to read some more of the comments in the workaround pull request, after emerging gui-libs/egl-gbm, webkit-gtk started working just fine without my additional workaround of setting the environment variables I mentioned.
Comment 11 lfpraca 2024-02-02 10:39:53 UTC
(In reply to lfpraca from comment #10)

Oh and by the way, with the gui-libs/egl-gbm package, the errors I mentioned getting even when I got it working disappeared.

The gui-libs/egl-gbm package is only pulled as a dependency by x11-drivers/nvidia-drivers with the wayland flag enabled, maybe it would be an option for webkit-gtk to pull it when use video_cards_nvidia