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.
"acpi_backlight=native"
# AMD CPU scaling
# https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html
# https://wiki.archlinux.org/title/CPU_frequency_scaling#amd_pstate
# On recent AMD CPUs this can be more energy efficient.
"amd_pstate=guided"
# Load amdgpu at stage 1
"amdgpu"
];
# AMD GPU
hardware.opengl.extraPackages = with pkgs; [
# VA-API and VDPAU
vaapiVdpau
# AMD ROCm OpenCL runtime
rocmPackages.clr
rocmPackages.clr.icd
# AMDVLK drivers can be used in addition to the Mesa RADV drivers.
#amdvlk
];
hardware.opengl.extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
environment.variables = {
# VAAPI and VDPAU config for accelerated video.
# See https://wiki.archlinux.org/index.php/Hardware_video_acceleration
"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?
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?
I am getting 301 frames in 5.0 seconds = 60.056 FPS i tested with this command [nix-shell:~]$ glxgears. Also i use the hyprland and i stayed on there if i go to another workspace then i get different results.
Do you get better performance on other distro? have you tested?
Oh, didn’t test with other distros. I just assumed this was an issue with my configs. glxgears is an ancient benchmarking tool, i assumed any modern machine would just get excellent performance from it.
I’m using Sway, with an external monitor. I get a bit better performance when the gears are on the laptop’s screen.
You should try, NO?
Also what kernel you use?
Do you use NixOS stable with unstable? And what you did with your mesa drivers?
For you information i had really bad performance on NixOS with my old global config, And because of unstable & stable branch's mix I was used to use unstable with stable which caused the issue, To fix that i recreated the global config and removed unstable branch