Intel Graphics: Difference between revisions
imported from old wiki |
m Reword comment in the example |
||
| (5 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
Example configuration with Hardware Acceleration & Quick Sync Video enabled on a modern Intel Graphics (Including ARC) | |||
<syntaxhighlight lang="nix"> | |||
services.xserver.videoDrivers = [ "modesetting" ]; | |||
hardware.graphics = { | |||
enable = true; | |||
extraPackages = with pkgs; [ | |||
# Required for modern Intel GPUs (Xe iGPU and ARC) | |||
intel-media-driver # VA-API (iHD) userspace | |||
vpl-gpu-rt # oneVPL (QSV) runtime | |||
# Optional (compute / tooling): | |||
intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe | |||
# NOTE: 'intel-ocl' also exists as a legacy package; not recommended for Arc/Xe. | |||
# libvdpau-va-gl # Only if you must run VDPAU-only apps | |||
]; | |||
}; | |||
environment.sessionVariables = { | |||
LIBVA_DRIVER_NAME = "iHD"; # Prefer the modern iHD backend | |||
# VDPAU_DRIVER = "va_gl"; # Only if using libvdpau-va-gl | |||
}; | |||
# May help if FFmpeg/VAAPI/QSV init fails (esp. on Arc with i915): | |||
hardware.enableRedistributableFirmware = true; | |||
boot.kernelParams = [ "i915.enable_guc=3" ]; | |||
# May help services that have trouble accessing /dev/dri (e.g., jellyfin/plex): | |||
# users.users.<service>.extraGroups = [ "video" "render" ]; | |||
</syntaxhighlight> | |||
== Driver == | == Driver == | ||
Refer to the [https://nixos.org/manual/nixos/stable/#sec-x11--graphics-cards-intel Intel Graphics drivers] section of the NixOS manual. | Refer to the [https://nixos.org/manual/nixos/stable/#sec-x11--graphics-cards-intel Intel Graphics drivers] section of the NixOS manual. | ||
| Line 4: | Line 35: | ||
== Video acceleration == | == Video acceleration == | ||
To enable hardware (GPU) accelerated video decoding and encoding you need to add additional entries in <code>hardware. | To enable hardware (GPU) accelerated video decoding and encoding you need to add additional entries in <code>hardware.graphics.extraPackages</code> (see [[Accelerated_Video_Playback|accelerated video playback]]). | ||
== Quick Sync Video == | == Quick Sync Video == | ||
| Line 13: | Line 44: | ||
QSV support can be used through either [https://github.com/Intel-Media-SDK/MediaSDK Intel Media SDK] or [https://github.com/intel/libvpl Intel VPL]. Intel VPL supersedes the now deprecated Media SDK. | QSV support can be used through either [https://github.com/Intel-Media-SDK/MediaSDK Intel Media SDK] or [https://github.com/intel/libvpl Intel VPL]. Intel VPL supersedes the now deprecated Media SDK. | ||
Both libraries dispatch to a backing implementation that is different depending on the GPU generation at runtime. You need to add either <code>intel-media-sdk</code> or <code>vpl-gpu-rt</code> (previously <code>onevpl-intel-gpu</code>) to <code>hardware. | Both libraries dispatch to a backing implementation that is different depending on the GPU generation at runtime. You need to add either <code>intel-media-sdk</code> or <code>vpl-gpu-rt</code> (previously <code>onevpl-intel-gpu</code>) to <code>hardware.graphics.extraPackages</code>. You can check the [https://github.com/intel/libvpl?tab=readme-ov-file#dispatcher-behavior-when-targeting-intel-gpus this] table to decide whether you need the Media SDK or VPL GPU runtime. | ||
Sample configuration: | Sample configuration: | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
hardware. | hardware.graphics = { | ||
enable = true; | enable = true; | ||
extraPackages = with pkgs; [ | extraPackages = with pkgs; [ | ||