Graphics: Difference between revisions
m Add VDPAU failing to detect correct driver on Wayland |
m 'glxinfo' has been renamed to/replaced by 'mesa-demos' |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 22: | Line 22: | ||
== OpenGL == | == OpenGL == | ||
{{Note|<code>hardware.opengl</code> | {{Note|<code>hardware.opengl</code> was renamed to <code>hardware.graphics</code> in NixOS 24.11.}} | ||
Userspace-level graphics support is provided through OpenGL. The kernel module is used just for interfacing with the hardware, the OpenGL driver is what Wayland (or the X server) actually uses for rendering. | Userspace-level graphics support is provided through OpenGL. The kernel module is used just for interfacing with the hardware, the OpenGL driver is what Wayland (or the X server) actually uses for rendering. | ||
| 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. | 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# | To verify which Mesa driver is used: <code>nix shell nixpkgs#mesa-demos -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. | 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> | ||