====== Ubuntu - GPU - DRM and DRI ====== **DRM** (Direct Rendering Manager) is a subsystem of the Linux kernel responsible for interfacing with GPUs of modern video cards. * DRM exposes an API (libdrm) that user-space programs can use to send commands and data to the GPU and perform operations such as configuring the mode setting of the display. * **libdrm** makes it easy to access the DRM (Direct Rendering Manager) on the operating system. DRM uses a set of generic system ioctls to allocate memory for the graphical objects and stuffs the commands and texture it needs. * The [[https://man7.org/linux/man-pages/man2/ioctl.2.html|ioctl]] system is a special type of system call that deals with device-specific input and output operations. * In this case, it deals with the input and output operations of a video card. So, when we a graphical application is run, it loads the OpenGL driver, such as Mesa; which in turn, loads libdrm, which enables talking directly to the kernel through ioctl. The window system, such as X Server or Wayland, needs to know what is happening, so it can synchronize and update itself. * This synchronization process is known as **DRI** (Direct Rendering Infrastructure). ---- {{:ubuntu:gpu:gpu_-_drm_dri.png?400|}} ---- [[Ubuntu:GPU:DRM:Get DRM Info|Get DRM Info]]