Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webview crashing on nearly any website (stderr: DRM_IOCTL_NVIDIA_GEM_ALLOC_NVKMS_MEMORY) #748

Closed
machinedgod opened this issue Jul 13, 2023 · 2 comments

Comments

@machinedgod
Copy link

Version: 3.7.0
WebKit compile: 2.40.2
WebKit run: 2.40.3
GTK compile: 3.24.38
GTK run: 3.24.38
libsoup compile: 3.4.2
libsoup run: 3.4.2
Extension dir: /usr/lib/vimb

Steps to reproduce

  • Run Vimb via terminal
  • Go to nearly any website that appears to have a more "active frontend" code than wikipedia or DDG
  • Vimb crashes with error message: Webview Crashed on <url>
  • Terminal outputs src/nv_gbm.c:99: GBM-DRV error (nv_gbm_bo_create): DRM_IOCTL_NVIDIA_GEM_ALLOC_NVKMS_MEMORY failed (ret=-1)

Expected behaviour

Website opens normally.

Actual behaviour

Vimb webview crashes on nearly any website.

Note

This problem has persisted for me, for at least 3-4 months. I thought its a known bug or some weird WebKit thing, so I just let it slide and wait... however, I am coming to a point where I can't use Vimb at all, and am forced to switch more and more to some bigger browser, which I don't like - so I'd like to try and help fix this.

@LukyLurks
Copy link

@machinedgod Do you have gst-plugins-good installed? My distribution (arch linux) listed it as an optional dependency, but without it pages like Youtube's homepage, Reddit's homepage, Discord's homepage, and some Wikipedia pages like The Beatles will crash. After installing it I no longer experience such crashes.

I thought its a known bug or some weird WebKit thing

I tried 5 other webkitgtk-based browsers (luakit, wyeb, nyxt, eolie, epiphany) and they all had the same issue. I definitely came across complaints about this issue for several of them, when I was looking for solutions. Having gst-plugins-good installed fixes it on all of them, so I'm suspecting there's something up on Webkit's side of things, but I don't know how to check if that's true.

@machinedgod
Copy link
Author

machinedgod commented Aug 7, 2024

After a long time of occasionally trying to crack this nut - I finally managed.

As suspected - this issue (like million others) have nothing to do with Vimb itself, but with relatively poor quality of webkit2gtk library that it depends on. To make long story short - I've managed to trace nearly every single error down to miscommunication between proprietary nvidia driver and hardware acceleration.

I've tried to debug this on two different pieces of hardware while keeping the exactly same storage (one is Lenovo Legion laptop with Nvidia RTX 2060, the other one is desktop with Nvidia 4070).

The clue was an error in stderr mentioning invalid permissions related to KMS, followed by the error from nvm_gbm_* about allocating a buffer with the size that seemed to match the display window of Vimb - the extra buffer allocation context seemed to be new logging messaging from webkit update.

The first attempted thing, that worked, was to completely disable hardware acceleration using Vimbs option:
set hardware-acceleration-policy=never
however I wanted to see if I can fix the acceleration itself.

After some hops around the random projects using Webkit, I landed here: elementary/browser#104

To save you time reading, near the end there are two proposed solutions:

  • enabling modesetting on nvidias driver via /sys (or via modprobe.d option)
    this didn't work
  • adding a WEBKIT_DISABLE_DMABUF_RENDERER=1 environmental
    this did

So, whoever may end up with similar issues - as a first step try disabling hw acceleration and see where it gets you.

Closing this, and now I can finally go back to use Vimb as my main browser!

P.S. @LukyLurks I have tried your suggestion but unfortunately, without results :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants