Graphics: Difference between revisions

m OpenGL: Changed wording, as NixOS 24.11 has been released now.
point to new renamed option
 
(One intermediate revision by the same user not shown)
Line 28: Line 28:
The OpenGL implementation used on Linux is the [[Mesa|Mesa graphics library]]. Mesa contains drivers for various hardware, the exact driver is selected automatically. Note that Mesa also supports software rendering if no compatible hardware driver is available, but this is very slow.
The OpenGL implementation used on Linux is the [[Mesa|Mesa graphics library]]. Mesa contains drivers for various hardware, the exact driver is selected automatically. Note that Mesa also supports software rendering if no compatible hardware driver is available, but this is very slow.


Mesa can installed using the option <code>hardware.opengl.enable</code>, but note that most desktop environment modules set this themselves anyway. This option writes the driver files to <code>/run/opengl-driver</code>. Additional graphics drivers packages can be added using <code>hardware.opengl.extraPackages</code>.
Mesa can installed using the option <code>hardware.graphics.enable</code>, but note that most desktop environment modules set this themselves anyway. This option writes the driver files to <code>/run/opengl-driver</code>. Additional graphics drivers packages can be added using <code>hardware.graphics.extraPackages</code>.


To verify which Mesa driver is used: <code>nix shell nixpkgs#glxinfo -c glxinfo</code>
To verify which Mesa driver is used: <code>nix shell nixpkgs#glxinfo -c glxinfo</code>
Line 42: Line 42:
== OpenCL ==
== OpenCL ==


Computing things on the GPU is supported through the OpenCL API. To enable OpenCL support, add the right packages for your hardware to <code>hardware.opengl.extraPackages</code>. See also [https://wiki.archlinux.org/title/GPGPU the Arch Wiki].
Computing things on the GPU is supported through the OpenCL API. To enable OpenCL support, add the right packages for your hardware to <code>hardware.graphics.extraPackages</code>. See also [https://wiki.archlinux.org/title/GPGPU the Arch Wiki].


To verify OpenCL support: <code>nix shell nixpkgs#clinfo -c clinfo</code>
To verify OpenCL support: <code>nix shell nixpkgs#clinfo -c clinfo</code>