kicad2ems.gui.meters¶
Live memory for the GUI's status bar (no Qt here: testable without a display).
All cheap enough to read every couple of seconds; the GPU through its vendor's
tool, run by the caller as a separate process, so the GUI never holds a GPU
context or imports CuPy.
ram() (used, total) GB of the system (Linux: /proc/meminfo; Windows:
GlobalMemoryStatusEx; elsewhere what sysconf gives)
tree_rss(pid) GB resident in a process and its children (Linux), or None
gpu_command() [program, args...] that prints the GPU's memory (nvidia-smi /
rocm-smi), or None
parse_gpu(name, text) [(used, total) GB per GPU] from that program's output
estimate(est, values, usable) what the next run should take: the solvers it
runs, their time and memory
- kicad2ems.gui.meters.estimate(est, values, usable=None, ram_avail=None)[source]¶
What the next run should take, from a preview's estimates (summary['estimates']: {solvers: {name: dict( seconds, gb, gpu_gb)}}) and the form's settings (values: solvers as runner.solvers_from_form makes them). The full-wave solvers it runs, as the pipeline picks them: those named, or for auto (the default) when none is named the one auto would pick, the fastest of those that can run here (usable: names, None for all) and fit in 80 % of ram_avail GB. Returns dict(rows=[(name, seconds, gb, gpu_gb, auto)], seconds (summed: they run one after the other), gb (the largest), gpu_gb, fits, missing (named solvers without an estimate)), or None when no full-wave solver would run or none has an estimate.
- kicad2ems.gui.meters.gpu_command()[source]¶
The command that prints the GPU's memory use: nvidia-smi (NVIDIA) or rocm-smi (AMD); None without either.
- kicad2ems.gui.meters.parse_gpu(prog, text)[source]¶
[(used GB, total GB)] per GPU from gpu_command's output (prog: its program name); [] when it can't be read.