browsh-org/browsh

Browsh doesn't detect GPU on Rpi400

Emphrath opened this issue · 8 comments

OS: Raspbian Buster
Pi 400 (same hardware as Pi 4)
Firefox version: 104 (last)
Browsh installed through arm64 deb file.

Hello folks ! When I connect to my pi via SSH and start browsh, it displays the snail in ASCII art but hangs on "waiting for connection with Firefox"

Now, I wouldn't make a bug report if I hadn't been through similar issues on this git. This is different from the usual connection issues.
Here is the log:

Looking in /home/user/.config/browsh/config.toml for config.
Starting Firefox in headless mode
Attempting to connect to Firefox Marionette
Using Firefox at: /usr/bin/firefox-esr
Using default profile at: /home/user/.config/browsh/firefox_profile
FF-CONSOLE: Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: Unable to open a connection to the X server (t=0.323698) [GFX1-]: glxtest: Unable to open a connection to the X server
FF-CONSOLE: Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: Unable to open a connection to the X server (t=0.323698) |[1][GFX1-]: glxtest: libEGL initialize failed (t=0.324109) [GFX1-]: glxtest: libEGL initialize failed
FF-CONSOLE: Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: Unable to open a connection to the X server (t=0.323698) |[1][GFX1-]: glxtest: libEGL initialize failed (t=0.324109) |[2][GFX1-]: No GPUs detected via PCI (t=0.324304) [GFX1-]: No GPUs detected via PCI
FF-CONSOLE: Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: Unable to open a connection to the X server (t=0.323698) |[1][GFX1-]: glxtest: libEGL initialize failed (t=0.324109) |[2][GFX1-]: No GPUs detected via PCI (t=0.324304) |[3][GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt (t=1.30584) [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt

So it would seem it doesn't manage to open a X session, which I find extremely weird: browsh is a terminal based thing, and it uses headless firefox - why would it need an X session, or why would it search for a PCI GPU (which btw is indeed there and detectable through pciutils) beats me. Am I missing sth ? Has anyone managed to run browsh on a raspberry so far ?

I just spent two days trying different versions of firefox, and three different terminals to access the Pi, to no avail.

tombh commented

Oh it looks like it needs DRI? https://dri.freedesktop.org/wiki/

@tombh thx for the answer. I just spent a whole day compiling the huge thing that is mesa (admittedly because it contains dri) and while I have less errors, it still won't launch. Here's the log:

Looking in /home/emphrath/.config/browsh/config.toml for config.
Starting Firefox in headless mode
Attempting to connect to Firefox Marionette
Using Firefox at: /usr/bin/firefox
Using default profile at: /home/user/.config/browsh/firefox_profile
FF-CONSOLE: [GFX1-]: glxtest: Unable to open a connection to the X server
FF-CONSOLE: [GFX1-]: glxtest: libEGL initialize failed
FF-CONSOLE: [GFX1-]: No GPUs detected via PCI
FF-CONSOLE: [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt

tombh commented

I mean the thing is, Browsh isn't really designed to be used like this. It's better to run Browsh on a normal computer and just use your Pis SSH client to connect to Browsh, do you see what I mean?

ok ! that's what I meant when I asked if I missed sth: the usecase it seems. I understand. But still it might / should work for rpi otherwise why would there be an arm build ? If you just use rpi for the ssh remote, you don't need browsh installed on it
... And also, am I right to believe that the server can run browsh without a screen ? Seems obvious since firefox runs headless but the errors suggest it might be it. I might try and compile browsh from source using flags during build so it recognizes gpu. Will report.

tombh commented

yes you have good points. i suppose all the ways to run browsh are just to be accommodating

if you just want a quick solution. browsh in docker has all its dependencies, including a virtual Xorg server

i'll try that out. thank you.

It works ! And it had nothing to do with GPU, firefox versions, or Xorg forwarding shennannigans. It had to do with an entry in my ufw before.rules which spawned a warning when I enabled ufw. In 3 days of madness trying to get browsh to work, I had skillfully ignored that warning. It was some port routing thing I wrote for a VPN and i guess it messed with the discussion between browsh and firefox. It runs on a phone terminal and I guess tactile input won't do it, but it works. Thanks all for the hard work on this beautiful piece of software.

tombh commented

I do that kind of thing all the time! hahah No worries at all, it's all part of the process.

Thank you so, so much for your kind words. I do love open source, and I've been so lucky to have had success with Browsh, but it can get a bit tiring sometimes with all the issues. Your supportive words really go a long way to giving me the energy to keep working on it. So thank you very much 😊❤️