Intel i915 nvidia gpu # Configuring VA-API - set LIBVA_DRIVER_NAME

the pc has an intel i915 and nvidia gpu

setup like

 - system: `"x86_64-linux"` 
 - host os: `Linux 6.1.39, NixOS, 23.05 (Stoat), 23.05.2162.6da4bc6cb07` 
 - multi-user?: `yes` 
 - sandbox: `yes` 
 - version: `nix-env (Nix) 2.13.3` 
 - channels(root): `"nixgl, nixos-23.05, nixos-hardware"` 
 - channels(usera): `""` 
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

xserver-wrapper: (II) Loading /nix/store/n3hwfg7pb17vqj0b36vhqx2sfh38blf1-xorg-server-21.1.8/lib/xorg/modules/
xserver-wrapper: (II) Module wfb: vendor="X.Org Foundation"
xserver-wrapper:         compiled for, module version = 1.0.0
xserver-wrapper:         ABI class: X.Org ANSI C Emulation, version 0.4
xserver-wrapper: (II) modeset(G0): using drv /dev/dri/card0
xserver-wrapper: (EE) Screen 0 deleted because of no matching config section.
xserver-wrapper: (II) UnloadModule: "modesetting"
xserver-wrapper: (EE)
xserver-wrapper: Fatal server error:
xserver-wrapper: (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.18.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
vaInitialize failed with error code -1 (unknown libva error),exit

Hardware video acceleration - ArchWiki says you have to

  • Configuring VA-API -

As I understood this should be done via

do you have to force it in

sessionVariables = {


What is the nixos way to do this?

That config only sets vdpau to basically redirect to libva. You also need to set LIBVA_DRIVER_NAME to either i965 or iHD