Unverified Commit 73b7d3bf authored by Michele Guerini Rocco's avatar Michele Guerini Rocco Committed by GitHub
Browse files

nixos/doc: update the status of Intel Graphics (#365448)

parents a98c720f 63f2d160
Loading
Loading
Loading
Loading
+18 −32
Original line number Diff line number Diff line
@@ -116,48 +116,34 @@ using lightdm for a user `alice`:

## Intel Graphics drivers {#sec-x11--graphics-cards-intel}

There are two choices for Intel Graphics drivers in X.org: `modesetting`
(included in the xorg-server itself) and `intel` (provided by the
package xf86-video-intel).

The default and recommended is `modesetting`. It is a generic driver
which uses the kernel [mode
setting](https://en.wikipedia.org/wiki/Mode_setting) (KMS) mechanism. It
The default and recommended driver for Intel Graphics in X.org is `modesetting`
(included in the xorg-server package itself).
This is a generic driver which uses the kernel [mode
setting](https://en.wikipedia.org/wiki/Mode_setting) (KMS) mechanism, it
supports Glamor (2D graphics acceleration via OpenGL) and is actively
maintained but may perform worse in some cases (like in old chipsets).

The second driver, `intel`, is specific to Intel GPUs, but not
recommended by most distributions: it lacks several modern features (for
example, it doesn't support Glamor) and the package hasn't been
officially updated since 2015.

The results vary depending on the hardware, so you may have to try both
drivers. Use the option
[](#opt-services.xserver.videoDrivers)
to set one. The recommended configuration for modern systems is:
maintained, it may perform worse in some cases (like in old chipsets).

```nix
{
  services.xserver.videoDrivers = [ "modesetting" ];
}
```
::: {.note}
The `modesetting` driver doesn't currently provide a `TearFree` option (this
will become available in an upcoming X.org release), So, without using a
compositor (for example, see [](#opt-services.picom.enable)) you will
experience screen tearing.
:::

If you experience screen tearing no matter what, this configuration was
reported to resolve the issue:
There also used to be a second driver, `intel` (provided by the
xf86-video-intel package), specific to older Intel iGPUs from generation 2 to
9.
This driver hasn't been maintained in years and was removed in NixOS 24.11
after it stopped working. If you chipset is too old to be supported by
`modesetting` and have no other choice you may try an unsupported NixOS version
(reportedly working up to NixOS 24.05) and set

```nix
{
  services.xserver.videoDrivers = [ "intel" ];
  services.xserver.deviceSection = ''
    Option "DRI" "2"
    Option "TearFree" "true"
  '';
}
```

Note that this will likely downgrade the performance compared to
`modesetting` or `intel` with DRI 3 (default).

## Proprietary NVIDIA drivers {#sec-x11-graphics-cards-nvidia}

NVIDIA provides a proprietary driver for its graphics cards that has
+3 −0
Original line number Diff line number Diff line
@@ -229,6 +229,9 @@

- The NVIDIA driver no longer defaults to the proprietary kernel module with versions >= 560. You will need to manually set `hardware.nvidia.open` to select the proprietary or open modules.

- The `intel` driver for the X server (`services.xserver.videoDrives = [ "intel" ]`) is no longer functional due to incompatibilities with the latest Mesa version.
  All users are strongly encouraged to switch to the generic `modesetting` driver (the default one) whenever possible, for more information see the manual chapter on [Intel Graphics](#sec-x11--graphics-cards-intel) and issue [#342763](https://github.com/NixOS/nixpkgs/issues/342763).

- The `(buildPythonPackage { ... }).override` and `(buildPythonPackage { ... }).overrideDerivation` attributes is now deprecated and removed in favour of `overridePythonAttrs` and `lib.overrideDerivation`.
  This change does not affect the override interface of most Python packages, as [`<pkg>.override`](https://nixos.org/manual/nixpkgs/unstable/#sec-pkg-override) provided by `callPackage` shadows such a locally-defined `override` attribute.
  The `<pkg>.overrideDerivation` attribute of Python packages called with `callPackage` will also remain available after this change.
+4 −20
Original line number Diff line number Diff line
@@ -1020,26 +1020,10 @@ self: super:
    meta = attrs.meta // { mainProgram = "xinit"; };
  });

  xf86videointel = super.xf86videointel.overrideAttrs (attrs: {
    # the update script only works with released tarballs :-/
    name = "xf86-video-intel-2021-01-15";
    src = fetchFromGitLab {
      domain = "gitlab.freedesktop.org";
      group = "xorg";
      owner = "driver";
      repo = "xf86-video-intel";
      rev = "31486f40f8e8f8923ca0799aea84b58799754564";
      sha256 = "sha256-nqT9VZDb2kAC72ot9UCdwEkM1uuP9NriJePulzrdZlM=";
    };
    buildInputs = attrs.buildInputs ++ [ xorg.libXScrnSaver xorg.libXv xorg.pixman xorg.utilmacros ];
    nativeBuildInputs = attrs.nativeBuildInputs ++ [autoreconfHook ];
    configureFlags = [ "--with-default-dri=3" "--enable-tools" ];
    patches = [ ./use_crocus_and_iris.patch ];

    meta = attrs.meta // {
      platforms = ["i686-linux" "x86_64-linux"];
    };
  });
  xf86videointel = throw ''
    xf86videointel has been removed as the package is unmaintained and the driver is no longer functional.
    Please remove "intel" from `services.xserver.videoDrivers` and switch to the "modesetting" driver.
  ''; # Added 2024-12-16;

  xf86videoopenchrome = super.xf86videoopenchrome.overrideAttrs (attrs: {
    buildInputs = attrs.buildInputs ++ [ xorg.libXv ];
+0 −28
Original line number Diff line number Diff line
--- a/src/uxa/intel_dri.c
+++ b/src/uxa/intel_dri.c
@@ -1540,8 +1540,10 @@
 			return has_i830_dri() ? "i830" : "i915";
 		else if (INTEL_INFO(intel)->gen < 040)
 			return "i915";
+		else if (INTEL_INFO(intel)->gen < 0100)
+			return "crocus";
 		else
-			return "i965";
+			return "iris";
 	}
 
 	return s;
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -3707,8 +3707,10 @@
 			return has_i830_dri() ? "i830" : "i915";
 		else if (sna->kgem.gen < 040)
 			return "i915";
+		else if (sna->kgem.gen < 0100)
+			return "crocus";
 		else
-			return "i965";
+			return "iris";
 	}
 
 	return s;