Closed Bug 1678898 Opened 3 years ago Closed 6 months ago

Firefox is not using discrete nvidia card with nvidia drivers

Categories

(Core :: Graphics, defect, P3)

Firefox 83
Desktop
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: yajo.sk8, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 2 obsolete files)

Attached file about:support on intel card.json (obsolete) —

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

I went to https://hubs.mozilla.com/scenes/1xfXiPu/theatre and created a hubs room based on that scene. I was alone in the room.

I'm experimenting with https://hubs.mozilla.org/ and it is very slow. Too low FPS according to my hardware.

I use Fedora 33 Silverblue, and I have installed nvidia proprietary drivers. All games run fast on Steam for example. A simple room based on i.e. https://hubs.mozilla.com/scenes/1xfXiPu/theatre with no people other than me, is awfully slow (8-11 FPS).

My graphic card

Actual results:

It's very slow. 8-11 FPS.

Expected results:

It should work way smoother.

My laptop has: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] / Mesa Intel® UHD Graphics 630 (CFL GT2)

I use Fedora 33 Silverblue and I have properly installed nvidia drivers. For example, all Steam games I have work fast with no problems.

➤ rpm -qa 'firefox|nvidia'
akmod-nvidia-455.45.01-1.fc33.x86_64
kmod-nvidia-455.45.01-1.fc33.x86_64
xorg-x11-drv-nvidia-455.45.01-1.fc33.x86_64
firefox-83.0-3.fc33.x86_64

I noticed that it seems like Firefox won't detect the discrete NVIDIA card. See the attachment.

I tried forcing the discrete GPU on Firefox:

  1. Close it.
  2. Right click on the GNOME launcher.
  3. Click on "start using discrete GPU".

Now, the Mozilla Hub I created doesn't load at all, and I get a bunch of options flagged as FEATURE_FAILURE_GLXTEST_FAILED in about:config.

See the attached output of about:support when running Firefox in this mode.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Graphics
Product: Firefox → Core

https://searchfox.org/mozilla-central/rev/cbcd544b1cd13b2fc0175bc9fae3d7909ca941e7/toolkit/xre/glxtest.cpp#474

glxtest fails because we couldn't get a valid visual. It would be nice if it fellback to egl/pci detection so at least it would detect the card properly, and track these failures better with telemetry in general.

Blocks: wr-nv-linux
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → Linux
Priority: -- → P3
Hardware: Unspecified → Desktop

MOZ_ENABLE_WAYLAND "1"

Both Comment 0 (Intel) and Comment 1 (proprietary Nvidia) set this environment variable and apparently use X11. This env var shouldn't be set on X11. It makes only sense on Wayland/Mesa (Intel / AMD / uninstalled Nvidia driver). Please remove this environment variable.

Firefox and most other applications and desktop environments don't/can't support Wayland on the proprietary Nvidia driver using the experimental Nvidia-only EGLStreams codepath (bug 1646135), Wayland must be used with Mesa. Ubuntu, for example, doesn't ship Wayland+EGLStreams, but I think I've read somewhere that Fedora might test it (?). (If that's the case and if it were relevant, the Fedora Firefox maintainer and Gtk module owner would have worked on it which I haven't seen.)

If removing the MOZ_ENABLE_WAYLAND env var and rebooting your computer did not help, try this:
Click on your user name on your login screen, there should be a button in the bottom-right corner where you select "Gnome on Xorg". Please try that, login, start Firefox, open about:support and check if this failure is gone. (Additionally, if you have verified that GLX works for Firefox, you can open about:config and set gfx.webrender.all to true to force-enable hardware rendering.)

distributionID "fedora"

You are using Fedora's modified downstream flavor of Firefox: https://src.fedoraproject.org/rpms/firefox/tree/master
Please make sure you start Firefox using the "Firefox on X11" menu entry when using the proprietary Nvidia driver.

Thanks for your tips.

Indeed I'm using Firefox from Fedora on nvidia card. I don't know why it sets that env variable... it doesn't make any sense. Actually I can't even choose to log in on X11 mode because it's the only mode available for nvidia users.

I installed the X11 variant:

rpm-ostree install firefox-x11
systemctl reboot

Now I launched Firefox on X11 menu item, but the behavior I'm experiencing is exactly the same. I'm updating now the intel card about:support results attachment.

Attachment #9189405 - Attachment is obsolete: true

Updating the results for nvidia card too (when launching through right-click -> start on discrete card)

Attachment #9189406 - Attachment is obsolete: true

Hello, I'd like to help further diagnose this problem. Is there anything else I can do?

Are you still seeing this? We've made improvements to glxtest since, and it would be good to see what your result is now on the latest nightly. Thanks!

Flags: needinfo?(yajo.sk8)
Attached file nightly1.json

I just downloaded nightly and extracted the tar.

I went inside and ran: env DRI_PRIME=1 ./firefox.

I opened a room in https://hubs.mozilla.org/ and it ran like 2x of FPS as in stable Firefox! 🎉

I attach the output of about:support from nightly.

Flags: needinfo?(yajo.sk8)

Oh BTW, in case it matters, the logs when running firefox from the terminal:

…    ~/Descargas/firefox-89.0a1.es-ES.linux-x86_64/firefox  ✔  07:32:37 
╰─ env DRI_PRIME=1 ./firefox
libGL error: failed to create dri screen
libGL error: failed to load driver: nouveau
libGL error: failed to create dri screen
libGL error: failed to load driver: nouveau
libGL error: failed to create dri screen
libGL error: failed to load driver: nouveau

###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

Closing per Comment 10

Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: