Wallpaper glitching and broken image thumbnails

Hello.

I had issues with wallpaper on gnome, image thumbnails on nautilus, and broken recording on obs.

Screenshot:

Broken wallpapers and thumbnails:



Broken Recording

This happened when after rebuilding, and somehow VAAPI just won’t work even though the driver is correct, I also checked each wallpaper in image viewer and it shows fine. but these problem does not apply in arch linux.

Trying display: wayland
libva info: VA-API version 1.23.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /run/opengl-driver/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_23
libva error: /run/opengl-driver/lib/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

My laptop:
ThinkPad T420
GPU: Intel HD 3000

Mesa Version: Mesa 26.1.0
NixOS Version: NixOS 26.05 (Yarara)
Kernel Version: Linux 7.0.8

Sorry if my english bad.

Seems a bit weird! What is your hardware config?

The nixos-hardware modules for the Thinkpad T420 does this for the GPU:

{
  imports = [ ../. ];

  # Enables RC6, RC6p and RC6pp.
  # Last two are only available on Sandy Bridge CPUs (circa 2011).
  boot.kernelParams = [ "i915.enable_rc6=7" ];

  hardware.intelgpu.vaapiDriver = "intel-vaapi-driver";
}

Here’s my hardware config:

# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/e5789835-06d8-4a33-a7d4-bc036176d778";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/8E38-E6C0";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  swapDevices = [ ];

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

I was wondering if you have set any gpu options, but your hardware config doesn’t show anything like that.

I did notice that your error log shows using the i965 driver but the nixos-hardware modules show setting a kernel param for i915.

Maybe using nixos-hardware would help?

I tried it and it didn’t work, but when I ran it on X11 instead of Wayland, it worked—though the glitch was still there. My Kitty terminal also had the same issue on both X11 and Wayland.

[andy@nixos ~] $ vainfo
Trying display: x11
libva info: VA-API version 1.23.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /run/opengl-driver/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_23
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.23 (libva 2.23.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Sandybridge Mobile - 2.4.0.pre1 (2.4.0.pre1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileH264StereoHigh         :    VAEntrypointVLD
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileNone                   :    VAEntrypointVideoProc
[andy@nixos ~] $

Kitty Terminal

Did you try using the nixos-hardware module or setting the kernel param?

I keep wondering about this line from the output of vainfo:

libva info: User environment variable requested driver 'i965'

Are you setting LIBVA_DRIVER_NAME somewhere? If so what happens if you don’t set it?

Yes, I’ve already tried adding the nixos-hardware module and kernel param to the configuration, but it doesn’t seem to be working.

I added that variable as described in the wiki; if I don’t apply it, Vainfo will try the intel-media-driver (iHD) first, then the intel-vaapi-driver (i965), as far as I know
https://wiki.nixos.org/wiki/Accelerated_Video_Playback

My configuration:

  # Environment Variables
  environment.sessionVariables = {
    NIXOS_OZONE_WL = 1;
    LIBVA_DRIVER_NAME = "i965";
  };
  # Hardware Acceleration
  hardware.graphics = {
    enable = true;
    extraPackages = with pkgs; [
      # intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
      intel-vaapi-driver # For older processors. LIBVA_DRIVER_NAME=i965
      libvdpau-va-gl
    ];
  };

Okay, after a few days I figured out the problem. When I updated my Arch Linux, I realized that my Arch was also affected, so I tried rolling back a package called “mesa” and it worked without any issues. But I haven’t tried it on NixOS yet.

The version of Mesa I’m currently using is: mesa 1:26.0.6-1

EDIT: fixes is: Making sure you're not a bot!

2 Likes