Home Explore Blog Models CI



nixpkgs

doc/packages/opengl.section.md
b2cf614134ca0dc59876e99ab7846a55f237c0ee7f5ef408000000030000048b
# OpenGL {#sec-opengl}

OpenGL support varies depending on which hardware is used and which drivers are available and loaded.

Broadly, we support both GL vendors: Mesa and NVIDIA.

## NixOS Desktop {#nixos-desktop}

The NixOS desktop or other non-headless configurations are the primary target for OpenGL libraries and applications. The current solution for discovering which drivers are available is based on [libglvnd](https://gitlab.freedesktop.org/glvnd/libglvnd). `libglvnd` performs "vendor-neutral dispatch", trying a variety of techniques to find the system's GL implementation. In practice, this will be either via standard GLX for X11 users or EGL for Wayland users, and supporting either NVIDIA or Mesa extensions.

## Nix on GNU/Linux {#nix-on-gnulinux}

If you are using a non-NixOS GNU/Linux/X11 desktop with free software video drivers, consider launching OpenGL-dependent programs from Nixpkgs with Nixpkgs versions of `libglvnd` and `mesa` in `LD_LIBRARY_PATH`. For Mesa drivers, the Linux kernel version doesn't have to match nixpkgs.

For proprietary video drivers, you might have luck with also adding the corresponding video driver package.

Chunks
d5efd1e2 (1st chunk of `doc/packages/opengl.section.md`)
Title: OpenGL Support and Configuration
Summary
This section discusses OpenGL support, which varies based on hardware and drivers, specifically mentioning Mesa and NVIDIA. For NixOS desktop environments, `libglvnd` is used for vendor-neutral dispatch, accommodating both X11 (GLX) and Wayland (EGL) with either NVIDIA or Mesa extensions. For non-NixOS GNU/Linux/X11 systems using free software video drivers, it's recommended to launch OpenGL programs with Nixpkgs versions of `libglvnd` and `mesa` in `LD_LIBRARY_PATH`. If proprietary video drivers are used, adding the corresponding driver package might be necessary.