diff --git a/nixos/doc/manual/configuration/gpu-accel.chapter.md b/nixos/doc/manual/configuration/gpu-accel.chapter.md index 0046337320a5..2298494bcc90 100644 --- a/nixos/doc/manual/configuration/gpu-accel.chapter.md +++ b/nixos/doc/manual/configuration/gpu-accel.chapter.md @@ -146,6 +146,20 @@ Modern Intel GPUs use the iHD driver, which can be installed with: { hardware.graphics.extraPackages = [ intel-media-driver ]; } ``` +Note that this package includes nonfree render kernels by default. If you +prefer, and you're willing to forgo any extra functionality provided by these +render kernels for your hardware, you can install the version with only free +software render kernels. Consult [the upstream +README](https://github.com/intel/media-driver#components-and-features) for +more information on which feature/hardware combinations require unfree render +kernels. + +The free version of the iHD driver can be installed with: + +```nix +{ hardware.graphics.extraPackages = [ intel-media-driver-free ]; } +``` + Older Intel GPUs use the i965 driver, which can be installed with: ```nix diff --git a/nixos/modules/hardware/graphics.nix b/nixos/modules/hardware/graphics.nix index 627cf19333bf..29437db0aff1 100644 --- a/nixos/modules/hardware/graphics.nix +++ b/nixos/modules/hardware/graphics.nix @@ -97,6 +97,15 @@ in ::: {.note} intel-media-driver supports hardware Broadwell (2014) or newer. Older hardware should use the mostly unmaintained intel-vaapi-driver driver. ::: + ::: {.note} + intel-media-driver includes nonfree render kernels by default. If you + prefer, and you're willing to forgo any extra functionality provided by these + render kernels for your hardware, you can install the version with only free + software render kernels, intel-media-driver-free. Consult [the upstream + README](https://github.com/intel/media-driver#components-and-features) for + more information on which feature/hardware combinations require unfree render + kernels. + ::: ''; type = lib.types.listOf lib.types.package; default = [ ]; @@ -111,6 +120,15 @@ in ::: {.note} intel-media-driver supports hardware Broadwell (2014) or newer. Older hardware should use the mostly unmaintained intel-vaapi-driver driver. ::: + ::: {.note} + intel-media-driver includes nonfree render kernels by default. If you + prefer, and you're willing to forgo any extra functionality provided by these + render kernels for your hardware, you can install the version with only free + software render kernels, intel-media-driver-free. Consult [the upstream + README](https://github.com/intel/media-driver#components-and-features) for + more information on which feature/hardware combinations require unfree render + kernels. + ::: ''; type = lib.types.listOf lib.types.package; default = [ ]; diff --git a/pkgs/by-name/in/intel-media-driver/package.nix b/pkgs/by-name/in/intel-media-driver/package.nix index 9af214ca6476..3b43f51b34c2 100644 --- a/pkgs/by-name/in/intel-media-driver/package.nix +++ b/pkgs/by-name/in/intel-media-driver/package.nix @@ -9,6 +9,7 @@ libpciaccess, intel-gmmlib, libdrm, + enableUnfree ? true, enableX11 ? stdenv.hostPlatform.isLinux, libx11, nix-update-script, @@ -20,6 +21,9 @@ stdenv.mkDerivation (finalAttrs: { pname = "intel-media-driver"; version = "26.3.5"; + __structuredAttrs = true; + strictDeps = true; + outputs = [ "out" "dev" @@ -46,6 +50,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DINSTALL_DRIVER_SYSCONF=OFF" "-DLIBVA_DRIVERS_PATH=${placeholder "out"}/lib/dri" + (lib.cmakeBool "ENABLE_NONFREE_KERNELS" enableUnfree) # Works only on hosts with suitable CPUs. "-DMEDIA_RUN_TEST_SUITE=OFF" "-DMEDIA_BUILD_FATAL_WARNINGS=OFF" @@ -93,10 +98,14 @@ stdenv.mkDerivation (finalAttrs: { ''; homepage = "https://github.com/intel/media-driver"; changelog = "https://github.com/intel/media-driver/releases/tag/intel-media-${finalAttrs.version}"; - license = with lib.licenses; [ - bsd3 - mit - ]; + license = + with lib.licenses; + [ + bsd3 + mit + ] + # See upstream README on unfree components; we use this license to keep things working + ++ lib.optionals enableUnfree [ unfreeRedistributableFirmware ]; platforms = lib.platforms.linux; maintainers = with lib.maintainers; [ SuperSandro2000 ]; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 20fb45424cf4..acdbc7fd4333 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5425,6 +5425,10 @@ with pkgs; callPackages ../development/libraries/science/astronomy/indilib/indi-3rdparty.nix { } ); + intel-media-driver-free = intel-media-driver.override { + enableUnfree = false; + }; + ios-cross-compile = callPackage ../development/compilers/ios-cross-compile/9.2.nix { }; iso-flags-png-320x240 = iso-flags.overrideAttrs (oldAttrs: {