Fedora 35: NVIDIA on Wayland

Hi,
I have just installed Fedora 35 on a PC with a NVIDIA Quadro M5000 using:

  1. sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
  2. Wait for the kernel module to build
  3. Reboot

Start sway (1.6.1, xwayland disabled) with:

export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __GL_VRR_ALLOWED=0
export __GL_GSYNC_ALLOWED=0
export WLR_NO_HARDWARE_CURSORS=1

sway --my-next-gpu-wont-be-nvidia

I have installed Chromium via flatpak:

flatpak install -y flathub org.chromium.Chromium

and org.freedesktop.Platform.GL.nvidia-495-44 is installed.

On starting it:

$ flatpak run org.chromium.Chromium \
    --ozone-platform=wayland \
    --enable-features=UseOzonePlatform \
    --enable-features=WebUIDarkMode \
    --force-dark-mode \
    --enable-features=WebRTCPipeWireCapturer 
MESA-LOADER: failed to open nvidia-drm: /usr/lib/x86_64-linux-gnu/GL/default/lib/gbm/nvidia-drm_gbm.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/GL/default/lib/gbm, suffix _gbm)
[2:22:1124/110550.066961:ERROR:simple_backend_impl.cc(79)] Failed to create directory: /dev/null/Default/Code Cache/js
[2:33:1124/110550.066997:ERROR:simple_backend_impl.cc(79)] Failed to create directory: /dev/null/Default/Code Cache/wasm
[2:22:1124/110550.067125:ERROR:simple_backend_impl.cc(79)] Failed to create directory: /dev/null/Default/Code Cache/js
[2:22:1124/110550.067188:ERROR:simple_backend_impl.cc(734)] Simple Cache Backend: wrong file structure on disk: 1 path: /dev/null/Default/Code Cache/js
[2:33:1124/110550.067220:ERROR:simple_backend_impl.cc(79)] Failed to create directory: /dev/null/Default/Code Cache/wasm
[2:33:1124/110550.067246:ERROR:simple_backend_impl.cc(734)] Simple Cache Backend: wrong file structure on disk: 1 path: /dev/null/Default/Code Cache/wasm

But nvidia-drm_gbm.so is at /usr/lib64/gbm/nvidia-drm_gbm.so.

How do I allow Chromium pick the right path?

Thanks

1 Like

Commenting:

Seems to make chromium be much more stable.
But I am not sure if it is using the GPU.

I’m not sure, but maybe you could try to make symbolic links.

Can you reproduce using “non-flatpak” chromium ?
The flatpak version might use a nvidia overlay that doesn’t search the nvidia-gbm in the appropriate path.

1 Like

Fedora ships an older chromium version (94), it does not show failed to open nvidia-drm but a bunch of other errors:

$ chromium-browser --ozone-platform=wayland --enable-features=UseOzonePlatform
[55742:55742:1126/113043.153230:ERROR:cursor_loader.cc(115)] Failed to load a platform cursor of type kNull
[55783:55783:1126/113043.193806:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is egl, ANGLE is 
[55783:55783:1126/113043.672341:ERROR:gl_surface_egl.cc(780)] EGL Driver message (Error) eglCreateImageKHR: EGL_BAD_ALLOC error: In eglCreateImageKHR: could not bind to DMA buffer

[55783:55783:1126/113043.672635:ERROR:gl_image_egl.cc(42)] Error creating EGLImage: EGL_BAD_ALLOC
[55783:55783:1126/113043.672850:ERROR:gpu_memory_buffer_factory_native_pixmap.cc(267)] Failed to create GLImage 2304x2816, RGBA_8888, usage SCANOUT
[55783:55783:1126/113043.673220:ERROR:gl_surface_egl.cc(780)] EGL Driver message (Error) eglCreateImageKHR: EGL_BAD_ALLOC error: In eglCreateImageKHR: could not bind to DMA buffer

[55783:55783:1126/113043.673348:ERROR:gl_image_egl.cc(42)] Error creating EGLImage: EGL_BAD_ALLOC
[55783:55783:1126/113043.673465:ERROR:gpu_memory_buffer_factory_native_pixmap.cc(267)] Failed to create GLImage 2304x2816, RGBA_8888, usage GPU_READ
[55783:55783:1126/113043.673584:ERROR:shared_image_backing_factory_gl_image.cc(348)] CreateSharedImage: Failed to create bindable image
[55783:55783:1126/113043.673708:ERROR:shared_image_factory.cc(557)] CreateSharedImage: could not create backing.
[55783:55783:1126/113043.674115:ERROR:skia_output_surface_impl_on_gpu.cc(1554)] Failed to make current.
[55783:55783:1126/113043.674285:ERROR:shared_image_stub.cc(506)] SharedImageStub: context already lost
[55783:55783:1126/113043.675631:ERROR:shared_image_stub.cc(506)] SharedImageStub: context already lost
[55742:55742:1126/113043.676715:ERROR:command_buffer_proxy_impl.cc(328)] GPU state invalid after WaitForGetOffsetInRange.
[55783:55783:1126/113043.679134:ERROR:skia_output_surface_impl_on_gpu.cc(1554)] Failed to make current.
[55783:55783:1126/113043.686792:ERROR:skia_output_surface_impl_on_gpu.cc(1554)] Failed to make current.
[55783:55783:1126/113043.687011:ERROR:skia_output_surface_impl_on_gpu.cc(1554)] Failed to make current.

And --enable-features=WebRTCPipeWireCapturer makes it not even start.

Using export GBM_BACKENDS_PATH=/usr/lib64/gbm/ I am able to change where chromium looks for gbm but I have not idea where the nvidia overlay has put gbm.

I have an nvidia quadro on a laptop (and no onboard graphics) and I found it worked better to use nvidia’s drivers. It is annoying in that you have to build the kernel moduls every time you upgrade to a new kernel, but that particularly laptop is fast so it doesn’t take more than a minute.

You could consider removing all the generic drivers, wayland etc. and just use the nvidia driver. You will get the best performance that way, but at the cost of some time playing home sysadmin.

There is a reason a LOT of people (probably the great majority) use the nvidia drivers from rpmfusion instead of directly from nvidia.

The drivers from nvidia have to be rebuilt with each kernel update.

The nvidia drivers installed from the rpmfusion repo and using the akmod-nvidia package are automatically built for you with each kernel update so to the user it is totally transparent and they do not have to manually do the update. Additionally, there are some fedora specific tweaks done to update the xorg packages to properly utilize the nvidia drivers as well.

Rpmfusion does us all a great service by providing the repo with these driver packages and the automatic updates.

These 2 links assist in it all.
https://rpmfusion.org/Howto/NVIDIA
https://rpmfusion.org/Configuration

2 Likes

I think this is a good suggestion in general but at the time I tried using the rpmfusion version several years ago, it did not work well. So when I get a new kernel I get the latest driver from nvidia and build it. Once in a while it breaks until gcc catches up so I boot the previous kernel. But most of the time it is just a couple of minutes to spend and the results were better.

1 Like

Your experience has been different than mine.

I continuously use nvidia GPU & drivers and have consistently used rpmfusion as the source since I found it. In the years I have done so I have never had an issue with the update/upgrade of fedora and having matching kernel modules for the nvidia cards I use.

That is in contrast to the need you have for downloading the driver and doing a manual update for each new kernel and frequently the fedora kernel may be updated weekly! To each his own.

At which point you are equally free to rebuild your own kernel as desired and any updates.
But that defeats the point of using a distribution at all. (aka: to ease things).

2 Likes

I posted my experience issues and solutions to wayland Nvidia in this thread

1 Like