Lightweight, no-reboot power control for a compute-only NVIDIA Optimus dGPU on Linux laptops. Keep the discrete card asleep at ~0W (D3cold) while you work in the terminal, and let it wake on demand for CUDA / OpenCL / parallel jobs / bruteforce.
It's a thin wrapper around the kernel's PCI runtime power management — no
daemon, no optirun, no logout, no unloading modules.
This is not a full GPU mode-switcher. If you need to switch the display between integrated / hybrid / dedicated, use envycontrol, supergfxctl or optimus-manager instead.
gpumodetargets the case where the display already runs on the iGPU and the NVIDIA card is used purely for compute.
On many Optimus laptops the discrete GPU stays powered even when unused, quietly drawing a few watts (commonly 3–5W). If you live in the terminal on battery, that can be a meaningful chunk of your idle draw. With runtime PM the card drops to D3cold (~0W) whenever it is idle and wakes automatically when compute needs it.
| Command | What it does |
|---|---|
gpumode off |
Power-saving: the card sleeps to ~0W (D3cold) when idle and wakes automatically for compute. (auto is an alias.) |
gpumode on |
Keeps the card powered on — no wake latency for a long, heavy session. |
gpumode status |
Shows power state and how long it has been asleep. Does not wake the card. |
There is intentionally no "unload the driver" mode: on a Wayland session the compositor typically holds the GPU open (via EGL), so it can't be unloaded — and it doesn't need to be. Runtime PM reaches ~0W with the driver loaded.
- NVIDIA Turing (GTX 16xx / RTX 20xx) or newer — D3cold runtime PM support.
- Intel Coffee Lake or newer CPU, kernel >= 4.18.
- The proprietary nvidia driver installed.
- Display running on the Intel iGPU (the dGPU must not be driving the screen).
sudo(setup and switching modes touch udev / sysfs power controls).
Check your card supports the deep power-down:
cat /sys/bus/pci/devices/<dGPU>/d3cold_allowed # want: 1git clone https://github.com/anycodef/gpumode.git
cd gpumode
make install # copies gpumode to ~/.local/bin
gpumode setup # one time, asks for sudo
sudo reboot # so the driver picks up fine-grained power managementsetup also makes the card power-saving by default at every boot (a udev rule
sets power/control=auto), so after the reboot you usually don't need to run
anything — it just idles at ~0W.
gpumode status # does not wake the cardWant to see runtime_status=suspended with a growing "asleep" time while nothing
uses the GPU. Then run your CUDA / OpenCL / hashcat job directly — the card wakes
on its own — and it goes back to sleep when the job ends.
Tip: don't leave a GPU monitor polling
nvidia-smiin a loop — each query wakes the card and keeps it out of D3cold.
setupwritesoptions nvidia NVreg_DynamicPowerManagement=0x02(/etc/modprobe.d/gpumode.conf) and a udev rule (/etc/udev/rules.d/80-gpumode.rules) that setspower/control=autoon the dGPU and its HD-audio function.offsetspower/control=auto, so the kernel runtime-suspends the card to D3cold when idle.onsetspower/control=onto pin it powered.statusonly reads sysfs, so it never wakes the card.
On a multi-GPU laptop, wlroots opens every GPU at startup (even the unused
dGPU), which keeps it powered. Restrict the compositor to the iGPU by pointing
WLR_DRM_DEVICES at the Intel card's /dev/dri/cardN. Note that
WLR_DRM_DEVICES splits on :, so a /dev/dri/by-path/pci-… value won't work
(the PCI address contains colons) — resolve the cardN path instead.
make uninstall
sudo rm -f /etc/modprobe.d/gpumode.conf /etc/udev/rules.d/80-gpumode.rules
sudo udevadm control --reload
sudo reboot- Hardware support for D3cold varies by laptop/BIOS. If the card never reaches
suspended, your firmware may not expose the_PR3power resource for the PCIe port.
MIT — see LICENSE.