Generated by GPT-5-mini| cgmanager | |
|---|---|
| Name | cgmanager |
| Developer | Valve Corporation, Red Hat engineers |
| Released | 2013 |
| Latest release | 0.37.0 |
| Operating system | Linux |
| License | LGPLv2.1+ |
| Website | (project pages and distributions) |
cgmanager
cgmanager is a Linux daemon and library designed to manage control groups and GPU access for unprivileged processes in multi-user environments. It mediates device node allocation, session lifecycle, and GPU resource isolation for compositors, display servers, and container runtimes. The project was created to coordinate between device management, graphics stacks, and system services in desktop and cloud contexts.
cgmanager provided a userspace manager that exported access to the Linux kernel's control groups (cgroups) and device nodes through a D-Bus service. It aimed to enable safe, policy-driven allocation of GPU and video device resources to sessions belonging to users and containers, integrating with compositors such as Mutter, X.Org Server, and KWin. The daemon interacted with system services like systemd and session managers such as ConsoleKit to track seat assignments and policy decisions. Its design emphasized minimal privileges, runtime policy, and compatibility with existing graphics drivers including those developed by Intel Corporation, NVIDIA, and the Mesa community.
Development began in the early 2010s amid efforts by companies including Valve Corporation and contributors from Red Hat to solve multi-user GPU access on Linux desktops and gaming platforms. The project responded to challenges introduced by multi-seat setups, virtual machines, and containerized workflows popularized by Docker. Key motivations included enabling game clients and compositors on shared systems without granting root privileges, following work by projects like logind in systemd and concepts from DeviceKit-disks. The codebase evolved through contributions from contributors affiliated with projects such as GNOME, KDE, and driver vendors, with packaging appearing in distributions maintained by Debian and Fedora Project.
cgmanager followed a client–server architecture with a central daemon exposing functionality over D-Bus. It separated policy from enforcement: policy decisions could be driven by seat and session information from ConsoleKit or systemd-logind while the daemon performed filesystem operations on device nodes and cgroup hierarchies. The design relied on the Linux kernel's interfaces, including cgroups v1 primitives, device node permissions, and udev-managed symlinks from udev. The library API allowed display servers and container runtimes to request device access, and the daemon used subprocesses with reduced privileges to manipulate filesystem ownership and ACLs, following security models advocated by Polkit and the Linux Security Modules ecosystem.
cgmanager implemented features for ephemeral device allocation, reclamation on session termination, and integration hooks for graphics stacks. It supported: - Dynamic allocation of GPU and video device nodes to user sessions used by compositors such as Compiz and Wayland compositors. - Coordination with container runtimes influenced by LXC and Docker to grant device access without root. - APIs to manage cgroup membership and resource accounting compatible with tools used by Kubernetes clusters and virtualization systems like QEMU. - Logging and policy hooks interoperable with system logging from rsyslog and auditing via auditd.
cgmanager was packaged for major distributions including Debian, Ubuntu, and Fedora Project, enabling integration with desktop environments like GNOME and KDE Plasma. It was designed to interoperate with graphics drivers from AMD and NVIDIA Corporation as well as open-source stacks in the Mesa project. Compatibility layers allowed interaction with init systems such as SysVinit and systemd, and with session management tools like gdm and sddm. Integration with virtualization and container ecosystems touched projects like libvirt and orchestration frameworks influenced by OpenStack.
cgmanager saw adoption in scenarios requiring controlled device sharing: multi-seat workstations in academic environments, game streaming platforms run by companies like Valve Corporation, and hosting environments where GPU passthrough to containers or VMs was desirable. Desktop compositors used the service to avoid running as root while obtaining access to GPU device nodes. Research institutions employing GPU clusters for visualization leveraged the project’s mechanisms alongside orchestration tools from SLURM and cloud providers influenced by Amazon Web Services virtualization offerings.
cgmanager reduced the need for privileged display servers but relied on kernel interfaces and complementary services to enforce isolation; its security model depended on correct configuration of udev rules, Polkit policies, and cgroup hierarchies. Limitations included dependency on the original cgroups v1 semantics and potential incompatibilities with newer cgroups v2 unified hierarchy adopted by systemd-centric distributions. The project’s reliance on D-Bus and external session managers required careful hardening against privilege escalation vectors documented by projects like Hardening Project and Openwall. Over time, alternative approaches in systemd and direct kernel features reduced the necessity for the daemon in many deployments.
Category:Linux software