#1831·btop

NVML is initialised at startup whenever `shown_gpus` contains `nvidia`, even with no GPU box shown — wakes a runtime-suspended dGPU on hybrid laptops

Author: HazakinsCreated Sep 11, 2026Updated Sep 11, 2026

Summary. Shared::init() in src/linux/btop_collect.cpp calls Gpu::Nvml::init() whenever shown_gpus contains nvidia (the default is "nvidia amd intel"), regardless of whether any GPU box is in shown_boxes. NVML initialisation resumes a runtime-suspended NVIDIA GPU, so on a hybrid laptop where the discrete card is meant to sleep, opening btop wakes it even when btop shows no GPU information at all.

Environment. btop 1.4.7 (Arch, current release; the same lines are in main today). Framework Laptop 16, Ryzen AI 9 HX 370 / Radeon 890M (amdgpu, drives all outputs) + RTX 5070 graphics module (nvidia 610.57.04), no connector in use. Kernel 7.2.3-arch1-3.

Measured, watching /sys/bus/pci/devices/<dGPU>/power/runtime_status with the card suspended, btop launched in a pty with a scratch XDG_CONFIG_HOME:

config dGPU
shown_gpus = "nvidia amd intel" (default), no GPU box in shown_boxes resuming ~2 s after launch, active while btop is open, re-suspended ~15 s after exit
shown_gpus = "amd", with a gpu0 box shown suspended throughout

The first run displayed no GPU box, so it is the NVML init itself, not the display, that wakes the card. (btop's own /proc/<pid>/fd is unreadable to its owner because of the file capabilities, so I measured the card's state rather than btop's descriptors.)

Cost. On battery the discrete GPU leaves D3cold for as long as btop is open. Distros that ship btop as the default task manager with the default shown_gpus (Omarchy does, omacom/omarchy#11184) hit this on every hybrid laptop.

Suggestion. Initialise NVML lazily, on the first collection for a GPU box that is actually shown, instead of in Shared::init(). If a startup check is wanted, /sys/bus/pci/devices/*/vendor and class say whether an NVIDIA display device exists without waking it, and power/runtime_status says whether it is asleep; a device that reports suspended could be left alone until the user opens its box. Reads of vendor, class, device, revision and power/runtime_status were measured not to wake the card; a read of config does.


Disclosure: this diagnosis and write-up were produced by Claude (Fable 5.1, via Claude Code) working on my laptop; the measurements are from my machine and I reviewed the text before posting.