Bug 228268 - [GTK4] [REGRESSION] Rendering on Nvidia is terribly broken, almost a blank screen
Summary: [GTK4] [REGRESSION] Rendering on Nvidia is terribly broken, almost a blank sc...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: PC Linux
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: GTK4
  Show dependency treegraph
 
Reported: 2021-07-24 15:00 PDT by Emil Sayahi
Modified: 2021-11-23 20:09 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emil Sayahi 2021-07-24 15:00:53 PDT
Hello! This is my first time submitting a bug report, so apologies if I'm not as helpful as I should be.

I'm currently successfully building `libwebkitgtk-5.0`, and I've embedded it as part of developing a new browser project.
I was originally using the stable release of WebKitGTK from the Arch Linux package repositories, but as part of porting my browser to GTK4 I've had to recompile the library myself for GTK4 support (here's the script I wrote to do this: https://raw.githubusercontent.com/Dirout/oku/50c1bd443ac50943b359b16e9d3a140faa604c89/build-dependencies.sh)

Presently, this build of WebKitGTK is completely blank—no content or developer tools menu elements visible—unless I select and drag something offscreen, at which point it becomes visible until I let go of the mouse again.
Perhaps this rendering bug is connected to the fact that I have an Nvidia GPU? I'll need to do further testing on an old laptop I have somewhere.

Additionally, almost all page loads fail while emitting any of the following warnings:
```
(process:70483): GLib-Net-WARNING **: 17:44:39.051: ../glib-networking/tls/gnutls/gtlscertificate-gnutls.c:161: invalid property id 3 for "private-key" of type 'GParamBoxed' in 'GTlsCertificateGnutls'

(process:67609): GLib-GIO-WARNING **: 17:13:47.931: ../subprojects/glib/gio/gtlsconnection.c:397: invalid property id 12 for "protocol-version" of type 'GParamEnum' in 'GTlsClientConnectionGnutls'

(process:67609): GLib-GIO-WARNING **: 17:13:47.931: ../subprojects/glib/gio/gtlsconnection.c:397: invalid property id 13 for "ciphersuite-name" of type 'GParamString' in 'GTlsClientConnectionGnutls'
```

In the browser, the page contents simply are 'Error reading data from TLS socket: The specified session has been invalidated for some reason.' or, sometimes, 'Could not parse HTTP response'.
This is not always reproducible, sometimes, rarely, page loads just randomly work, but 99% of the time they don't.
I've tried Google, YouTube, Reddit, 'https://example.com', and 'https://www.iana.org/domains/reserved'.
My best guess is that this is some bug introduced in `libsoup-3.0`, maybe in its `glib` dependency? I had to recompile `libsoup` as well, for the same reasons I had to recompile WebKitGTK.

My biggest concern, by far, is the visibility issue. It does appear that things are being rendered, it's just pure white unless I drag things away with my mouse.
To be clear, every other GUI element of my GTK app is visible and working properly, it's just the WebView which is experiencing this.

I'm running Arch Linux with GNOME DE, X11 (because Nvidia GPU), using proprietary Nvidia drivers, with all installed packages up-to-date.
Comment 1 Emil Sayahi 2021-07-24 17:18:40 PDT
Ah, interesting. I've discovered the rendering isn't actually pure white, but slightly darker. I ramped up my Night Shift intensity in the GNOME settings app, and I can slightly make out some text from the WebView in a very light grey.
The developer tools, accessed from the 'Inspect Element' context menu option, are completely invisible, however.
Context menus, like the rest of the GTK elements, appear to be working just fine.
Comment 2 Emil Sayahi 2021-07-24 20:45:58 PDT
I've made a discovery regarding the page loading failure.
Based on the errors, I guessed it was an issue with HTTPS.
I've been able to connect to 'http://neverssl.com/' and 'http://example.com' (as opposed to the https version) consistently.
I'm now updating the bug report title to mention this issue
Comment 3 Michael Catanzaro 2021-07-25 11:02:26 PDT
(In reply to Emil Sayahi from comment #0)
> Additionally, almost all page loads fail while emitting any of the following
> warnings:
> ```
> (process:70483): GLib-Net-WARNING **: 17:44:39.051:
> ../glib-networking/tls/gnutls/gtlscertificate-gnutls.c:161: invalid property
> id 3 for "private-key" of type 'GParamBoxed' in 'GTlsCertificateGnutls'
> 
> (process:67609): GLib-GIO-WARNING **: 17:13:47.931:
> ../subprojects/glib/gio/gtlsconnection.c:397: invalid property id 12 for
> "protocol-version" of type 'GParamEnum' in 'GTlsClientConnectionGnutls'
> 
> (process:67609): GLib-GIO-WARNING **: 17:13:47.931:
> ../subprojects/glib/gio/gtlsconnection.c:397: invalid property id 13 for
> "ciphersuite-name" of type 'GParamString' in 'GTlsClientConnectionGnutls'
> ```

This means your glib is too old: somehow, you built glib-networking against a newer glib than you're using at runtime. You need to make sure that the software in your runtime environment is never older than the software in your build environment.
Comment 4 Emil Sayahi 2021-07-25 13:56:02 PDT
(In reply to Michael Catanzaro from comment #3)
> (In reply to Emil Sayahi from comment #0)
> > Additionally, almost all page loads fail while emitting any of the following
> > warnings:
> > ```
> > (process:70483): GLib-Net-WARNING **: 17:44:39.051:
> > ../glib-networking/tls/gnutls/gtlscertificate-gnutls.c:161: invalid property
> > id 3 for "private-key" of type 'GParamBoxed' in 'GTlsCertificateGnutls'
> > 
> > (process:67609): GLib-GIO-WARNING **: 17:13:47.931:
> > ../subprojects/glib/gio/gtlsconnection.c:397: invalid property id 12 for
> > "protocol-version" of type 'GParamEnum' in 'GTlsClientConnectionGnutls'
> > 
> > (process:67609): GLib-GIO-WARNING **: 17:13:47.931:
> > ../subprojects/glib/gio/gtlsconnection.c:397: invalid property id 13 for
> > "ciphersuite-name" of type 'GParamString' in 'GTlsClientConnectionGnutls'
> > ```
> 
> This means your glib is too old: somehow, you built glib-networking against
> a newer glib than you're using at runtime. You need to make sure that the
> software in your runtime environment is never older than the software in
> your build environment.

I built and installed GLib from the GNOME GitLab. I then used that very same version when compiling `libsoup-3.0`. You can see this in the script I'm using to build WebKit (https://raw.githubusercontent.com/Dirout/oku/90034f7d55649026a61ead2e934226870a1cb607/build-dependencies.sh).
Just to ensure this is the case, I've rebuilt and reinstalled, in order of mentioning, GLib, Libsoup, and WebKitGTK. Afterwards, I rebuilt my browser.
Neither issue has been resolved, and I continue to receive the very same GLib-GIO warnings regarding HTTPS.
Comment 5 Michael Catanzaro 2021-07-25 15:39:58 PDT
Try building glib-networking as well?
Comment 6 Emil Sayahi 2021-07-25 16:48:55 PDT
(In reply to Michael Catanzaro from comment #5)
> Try building glib-networking as well?

Thanks, that fixed it. Building & installing GLib, glib-networking, libsoup, and then WebKit, in that order, now allows for successful HTTPS connections. Now removing mention of this from the bug report title.

Now all that remains is the original issue, the blanked out WebView. It is being properly rendered somehow, as dragging page elements like images or highlighted text makes them visible while dragged, but the actual WebView GTK widget itself is almost pure white.
Comment 7 Emil Sayahi 2021-08-02 20:41:19 PDT
I've compiled the MiniBrowser, and this rendering issue also affects that.
Now I know for certain it's not something related to my code or browser.
Comment 8 Emil Sayahi 2021-08-14 08:07:10 PDT
Someone has tested and informed me via Reddit that this bug is present on Nvidia GPUs, but not Intel graphics.
Source: https://reddit.com/r/GTK/comments/owvlen/how_does_gtk4_webkit_render_for_you/h89w498/

This would be a regression, as the stable, GTK3 releases of WebKitGTK do not have this terrible rendering bug on Nvidia.
Comment 9 Lauro Moura 2021-11-23 20:08:39 PST
Adding bug192879 as it might be related (changed the isInAcceleratedCompositingMode implementation)
Comment 10 Lauro Moura 2021-11-23 20:09:25 PST
Sorry. Wrong bugzilla page... #facepalm