Repository navigation
enh: show the NVIDIA GPU usage in the status bar - #28
Merged
paulmueller merged 2 commits intoNov 27, 2026
Merged
Conversation
The status bar label now also shows the utilization and memory usage of each NVIDIA GPU, e.g. "GPU 87% 3.2 / 4.0 GiB" (several GPUs as "GPU0 ... GPU1 ..."). The values are read with NVIDIA's management library (NVML) via `nvidia-ml-py` (module `pynvml`), which is added to the `gui` extra. The memory info version 2 is used if available, so that the memory does not include memory reserved by the driver (like `nvidia-smi`). Without the package, an NVIDIA driver, or a GPU, and if reading the values fails, the GPU usage is not shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 80.80% 81.07% +0.27%
==========================================
Files 23 23
Lines 1688 1723 +35
==========================================
+ Hits 1364 1397 +33
- Misses 324 326 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
On macOS CI, a child process of the test process was a zombie (it had exited, but was not reaped yet, e.g. a worker of an earlier test), so the check that all child processes are stopped failed. Zombie processes are not running and are ignored now; at least one stopped worker process is still required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
paulmueller
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
The status bar label from #24 now also shows the utilization and memory usage of NVIDIA GPUs, next to CPU and RAM:
nvidia-smiuses, via NVIDIA's Python bindingnvidia-ml-py(modulepynvml, pure Python, BSD license). The package is added to theguiextra, so the Windows/macOS builds include it.nvidia-smievery 2 s, because that would start a new process each time (and can briefly show a console window on Windows).GPU0 ... GPU1 ....nvidia-smi, it does not count memory reserved by the driver as used; version 1 showed 3.3 GiB wherenvidia-smishowed 3244 MiB.nvidia-ml-py, an NVIDIA driver, or an NVIDIA GPU (e.g. macOS, or CI), and if reading the values fails at some point, the GPU part is simply not shown.nvidia-smishows the same.Tests
test_gui_sys_usage_gpu(fakepynvmlmodule):test_gui_sys_usage_gpu_error: reading the GPU usage fails, so it is not shown.test_gui_sys_usage_no_nvml:nvidia-ml-pyis not installed.test_gui_sys_usagenow also accepts an optional GPU part, so that it passes on machines with an NVIDIA GPU.The new GPU tests fail on
mainand pass with the change.Manual check on the lab PC (Windows, RTX 2050) during a "torchsto" analysis:
GPU 100% 3.2 / 4.0 GiB,GPU 96% ...,GPU 0% ...in consecutive updates, consistent withnvidia-smi(3244 MiB used).Follow-up: flaky pause test on macOS (second commit)
The first CI run failed on macOS in
test_manager_pause_resume(from #27):assert 'zombie' == 'stopped'. One child process of the test process was a zombie, i.e. it had already exited but was not reaped yet (e.g. a worker process of an earlier test). Such a process is not running, so it does not contradict the pause. The test now ignores zombie processes (and processes that disappear while checking) and still requires at least one stopped worker process. This is unrelated to the GPU usage, but it is in this PR because it blocked its CI.Lint
lint-compareagainstmain: ruff 0 → 0, pyright 1.1.408 0 → 0, flake8 clean.🤖 Generated with Claude Code