Skip to main content

Module drm

Module drm 

Source
Expand description

The text Linux gives about its GPUs, parsed (SPEC_STATUS_BAR_GPU_PANEL_2026_11_15.md §3, phase 2): a process’s /proc/<pid>/fdinfo/<fd> for a DRM device (kernel 5.14 and later; amdgpu, i915, xe), the uevent of a card, and the PCI id database’s names. Pure text and arithmetic, so every case is a test on any platform; linux.rs reads the files.

drm-driver:     amdgpu
drm-pdev:       0000:03:00.0
drm-client-id:  4083
drm-engine-gfx: 1234567890 ns
drm-memory-vram: 1048576 KiB
drm-memory-gtt:  2048 KiB

Structs§

DrmClient
One open DRM client (a process’s handle on a GPU), as its fdinfo shows it.
Scanned
One DRM file descriptor of one process, read.

Constants§

VENDOR_AMD
VENDOR_INTEL
VENDOR_NVIDIA

Functions§

display_name
What to call a GPU: the marketing name in the database’s brackets where it has one (Navi 21 [Radeon RX 6800]), with the vendor in front unless the name carries it; else the database’s name; else the ids.
held_on
What the clients hold on one GPU (by PCI slot), for an adapter that can’t say itself: Intel’s memory is the machine’s, and only the processes’ own figures add up to how much of it the GPU holds.
kind_of
An adapter’s kind from its name and the memory it has of its own (None: it says none, as Intel’s do).
parse_fdinfo
A DRM fdinfo’s figures; None for a file that is not one (no drm-driver line).
parse_pci_id
0x1002 (a PCI vendor or device file) as a number.
parse_uevent
KEY=value lines (a uevent).
pci_ids_device
A device’s name in the PCI id database (pci.ids: a vendor line at the left edge, its devices one tab in).
process_figures
Each process’s figures from the clients read, and the busy times to compare with at the next read.
vendor_name
The vendor’s short name, for a name the id database gives without one.

Type Aliases§

ClientKey
A client’s identity across two reads.