Bad performance on AMD Laptop


I got NixOs on my laptop recently. But the performance when browsing the web sucks. I can feel the latency when typing and moving the mouse in Chrome (firefox feels right though).

I’m not sre I got hardware acceleration right, or it is something else. Or it is just chrome being chrome.

The laptop is a Thinkpad L14 AMD:

  • AMD Ryzen 7 PRO 5875U with Radeon Graphic
  • 16 G RAM
  • 500 G nvme
  • NixOs

Where should I start debugging this?

I have these in my configuration.nix:

  boot.initrd.kernelModules = [ "amdgpu" ];
  boot.kernelParams = [
    # Force use of the thinkpad_acpi driver for backlight control.
    # This allows the backlight save/load systemd service to work.

    # AMD CPU scaling
    # On recent AMD CPUs this can be more energy efficient.

    # Load amdgpu at stage 1

  hardware.opengl.extraPackages = with pkgs; [
    # VA-API and VDPAU

    # AMD ROCm OpenCL runtime

    # AMDVLK drivers can be used in addition to the Mesa RADV drivers.
  hardware.opengl.extraPackages32 = with pkgs; [

  environment.variables = {
    # VAAPI and VDPAU config for accelerated video.
    # See
    "VDPAU_DRIVER" = "radeonsi";
    "LIBVA_DRIVER_NAME" = "radeonsi";
  # Most software has the HIP libraries hard-coded. Workaround:
  systemd.tmpfiles.rules = [
    "L+    /opt/rocm/hip   -    -    -     -    ${pkgs.rocmPackages.clr}"

glxgears gives me ~36 FPS on my external monitor and ~45 on the laptop screen.

I can dump here the output of {glx,vdpau,vaapi,vulkan,opencl-}info, is that useful or just spam right now?

1 Like

You could consult chrome://gpu

Just found out vkcube, I get around ~33 FPS in there as well. Similar number to glxgears.

Chrome seems to be a symptom of the problem? (surprised that Firefox has a much better performance in my case).

I think my integrated GPU is somehow not being used.

Edit: Here’s the top part of chrome://gpu:

Graphics Feature Status
*   Canvas: Hardware accelerated
*   Canvas out-of-process rasterization: Enabled
*   Direct Rendering Display Compositor: *Disabled*
*   Compositing: Hardware accelerated
*   Multiple Raster Threads: Enabled
*   OpenGL: Enabled
*   Rasterization: Hardware accelerated
*   Raw Draw: *Disabled*
*   Skia Graphite: **Disabled**
*   Video Decode: Hardware accelerated
*   Video Encode: *Software only. Hardware acceleration disabled*
*   Vulkan: **Disabled**
*   WebGL: Hardware accelerated
*   WebGL2: Hardware accelerated
*   WebGPU: **Disabled**

I think I got it.

From the Arch Wiki:

On AMD GPU devices, VA-API does not work according to Chromium bug 1445074. A patch is available, but it only works under X11/XWayland.

I think that’s part of it. glxgears and vkcubes performance is very low, there’s something missing in there. Chrome being slow maybe because uses one of those APIs to render?

1 Like

I actually have decent performance on both Vivaldi and Brave on my AMD Vega 8 laptop :man_shrugging: