VA-API / radeonsi / amdgpu debugging

hi everyone,
I have a few applications that need GPU acceleration like davinci-resolve.

I this is my current graphics config:

  boot.initrd.kernelModules = [ "amdgpu" ];
  services.xserver.videoDrivers = [ "amdgpu" ];
  hardware.graphics = {
    enable = true;
    enable32Bit = true;
    extraPackages = with pkgs; [ rocmPackages.clr.icd amdvlk ];
  };
  hardware.amdgpu = {
    amdvlk.enable = true;
    amdvlk.supportExperimental.enable = true;
    amdvlk.support32Bit.enable = true;
    initrd.enable = true;
    opencl.enable = true;
  };

if I run nix-shell -p libva-utils --run vainfo, I get

Trying display: wayland
libva info: VA-API version 1.21.0
libva info: User environment variable requested driver 'radeonsi'
libva info: Trying to open /run/opengl-driver/lib/dri/radeonsi_drv_video.so
libva error: /run/opengl-driver/lib/dri/radeonsi_drv_video.so has no function __vaDriverInit_1_0
libva info: Trying to open /usr/lib/dri/radeonsi_drv_video.so
libva info: Trying to open /usr/lib32/dri/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/i386-linux-gnu/dri/radeonsi_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

any ideas what I should try?

Specifically for the vainfo part, try adding it to your system configuration instead of going through nix-shell. There are enough paths through which the nixpkgs version can be misaligned between system configuration and nix-shell that things related to video-drivers should generally be done within a single-source-of-truth so that there is less risk of ABI mismatch.

For the same reason, rebooting is generally an important part of debugging video driver related things on NixOS.

For GPU acceleration - you didn’t say anything about how you are confirming that a given program (i.e. davinci-resolve) is or is not using acceleration, or how you are installing it. Can you provide this information?