Brave/Chromium/Chrome Hardware Acceleration with Wayland and Nvidia?

Currently facing the following while using Brave with NixOS on Wayland and Nvidia:

I only have the Preferred Ozone Platform tweak to fix the common window resizing glitches:

That being said, I get the same issues with both Wayland and Auto, and even setting it to X11 inside of Wayland with bridging.

On the .nix config side, here are my graphical settings:

{ config, lib, pkgs, ...}:
{

# Enable OpenGL
hardware.graphics = {
        enable = true;
        enable32Bit = true;
        # Enable Support for VAAPI
        extraPackages = with pkgs; [
                nvidia-vaapi-driver
        ];
};

hardware.opengl = {
        enable = true;
        # driSupport = true;
        driSupport32Bit = true;
};

# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];

environment.systemPackages = with pkgs; [
        libva-utils
        vdpauinfo
        vulkan-tools
        vulkan-validation-layers
        libvdpau-va-gl
        egl-wayland
        wgpu-utils
        mesa
        libglvnd
        #nvtop
        #nvitop
        libGL
        vulkan-loader
        vulkan-validation-layers
];

# Enable Container support
hardware.nvidia-container-toolkit.enable = true;


hardware.nvidia = {

        # Modesetting is required
        modesetting.enable = true;

        # Uses closed source driver
        open = true;

        # Enable nvidia settings menu
        nvidiaSettings = true;

        # Select driver version
        package = config.boot.kernelPackages.nvidiaPackages.latest;

};

# Fix Hardware acceleration routing for browsers
environment.variables = {
  NVD_BACKEND = "direct";
  LIBVA_DRIVER_NAME = "nvidia";
};

# Docker GPU Support
virtualisation.docker = {
        enableNvidia = true;
};



}

Has anyone else been able to find a fix for this? Browser performance seems poor even with a powerful PC

1 Like

I forgot to mention that it does the same in X11

Why do you need these 2? hardware.opengl has been moved to hardware.graphics as of 24.11 if correct.
There should have been either errors or warnings during your build.

@JimJ92120 I did that as part of testing to see why hardware acceleration does not work for Brave/Chromium/Chrome

It seems to have made no impact on the hardware acceleration, so I removed the redundant entry and still face the hardware acceleration issue screenshotted above

I did get warnings when I had the redundant entry in for testing

1 Like

Have you checked these?

1 Like

Hm, that should only affect video acceleration, this seems more broken. Besides, yeah, those settings are present.

Use glxinfo (from mesa-demos) to figure out what you’re rendering with, and try glxgears.

Oddly enough this was able to get Chromium to have hardware acceleration but not brave.

Both seemed to show my GPU.

Enabling the fixes above got Chrome and Chromium to work but not Brave