macpm 3.1.0__tar.gz → 3.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {macpm-3.1.0 → macpm-3.2.0}/CHANGELOG.md +65 -0
- {macpm-3.1.0/macpm.egg-info → macpm-3.2.0}/PKG-INFO +96 -20
- {macpm-3.1.0 → macpm-3.2.0}/README.md +95 -19
- {macpm-3.1.0 → macpm-3.2.0}/RELEASE.md +44 -13
- {macpm-3.1.0 → macpm-3.2.0}/macpm/__init__.py +1 -1
- {macpm-3.1.0 → macpm-3.2.0}/macpm/backend.py +33 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/blessed_engine.py +24 -10
- macpm-3.2.0/macpm/footprint.py +232 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/gpuview.py +211 -20
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/__init__.py +13 -1
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/gpu.py +149 -37
- macpm-3.2.0/macpm/linux_backend/proc.py +419 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/macos_gpu.py +122 -1
- {macpm-3.1.0 → macpm-3.2.0}/macpm/macpm.py +85 -61
- {macpm-3.1.0 → macpm-3.2.0}/macpm/metrics.py +24 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/processes.py +16 -1
- {macpm-3.1.0 → macpm-3.2.0}/macpm/sampler.py +49 -5
- {macpm-3.1.0 → macpm-3.2.0}/macpm/widgets.py +15 -6
- {macpm-3.1.0 → macpm-3.2.0/macpm.egg-info}/PKG-INFO +96 -20
- {macpm-3.1.0 → macpm-3.2.0}/macpm.egg-info/SOURCES.txt +7 -0
- macpm-3.2.0/packaging/README-linux.txt +67 -0
- macpm-3.2.0/packaging/build-linux.sh +227 -0
- macpm-3.2.0/packaging/macpm-linux.spec +56 -0
- {macpm-3.1.0 → macpm-3.2.0}/setup.py +1 -1
- {macpm-3.1.0 → macpm-3.2.0}/tests/linux_fixtures.py +8 -0
- macpm-3.2.0/tests/test_ane.py +81 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_cli.py +3 -1
- macpm-3.2.0/tests/test_footprint.py +327 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_gpuview.py +138 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_layout.py +93 -25
- macpm-3.2.0/tests/test_linux_gpu.py +652 -0
- macpm-3.2.0/tests/test_macos_gpu.py +66 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_sampler_macos.py +31 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_widgets.py +13 -0
- macpm-3.1.0/macpm/linux_backend/proc.py +0 -145
- macpm-3.1.0/tests/test_linux_gpu.py +0 -307
- {macpm-3.1.0 → macpm-3.2.0}/LICENSE +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/MANIFEST.in +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/docs/linux-port.md +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/__main__.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/capabilities.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/dump.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/ioreport.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/cpu.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/modelname.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/net.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/power.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/sampler.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/soc.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/sysfs.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/linux_backend/thermal.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/netinfo.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/netmodel.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/network.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/probe.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/sensors.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/smc.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/soc.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm/tui.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm.egg-info/dependency_links.txt +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm.egg-info/entry_points.txt +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm.egg-info/not-zip-safe +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm.egg-info/requires.txt +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/macpm.egg-info/top_level.txt +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/packaging/README.txt +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/packaging/build.sh +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/packaging/entry_tui.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/packaging/install.sh +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/packaging/linux/Dockerfile +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/packaging/linux/README.txt +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/packaging/macpm.command +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/pyproject.toml +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/setup.cfg +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/__init__.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_blessed_engine.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_calc_freq.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_cpu.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_ixsmi.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_modelname.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_net.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_nvidia.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_power.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_sampler.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_thermal.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_view.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_linux_wiring.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_netinfo.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_network.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_probe.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_process_linux.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_processes.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_sampler.py +0 -0
- {macpm-3.1.0 → macpm-3.2.0}/tests/test_sensors.py +0 -0
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.2.0 — 2026-11-16
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Linux AMD/Intel cards report per-process GPU memory from DRM `fdinfo`
|
|
8
|
+
(`drm-resident-vram`/`gtt`/`local0`/`system0` plus `drm-shared-*`). Bytes are
|
|
9
|
+
charged only when the client is provably private: one visible holder, opened
|
|
10
|
+
through a render node, every shared counter present and zero, and a complete
|
|
11
|
+
scan. Anything else shows `n/a` with a reason (`shared_client`,
|
|
12
|
+
`shared_buffers`, `primary`, `legacy`, `partial_scan`, `incomplete`), so a
|
|
13
|
+
shared buffer is never presented as private memory.
|
|
14
|
+
- The GPU view's single-GPU table gained `GPU MEM` and (when the card reports
|
|
15
|
+
GTT) `SHARED` columns, and the per-card process line shows the memory of the
|
|
16
|
+
card's own processes.
|
|
17
|
+
- macOS: the GPU view reads the IOAccelerator's `PerformanceStatistics` through
|
|
18
|
+
the existing IOKit bindings, so the VRAM cell shows `Alloc system memory` out
|
|
19
|
+
of unified RAM and the INFO box adds GPU cores plus the Renderer/Tiler split.
|
|
20
|
+
An integrated GPU's `drm-resident-system0` bytes are charged as that
|
|
21
|
+
process's GPU memory rather than as spill.
|
|
22
|
+
- macOS: per-process `GPU MEM` comes from `footprint`'s `(graphics)`
|
|
23
|
+
categories, so the column agrees with the device number instead of showing
|
|
24
|
+
`n/a` (or RSS). A background thread measures only the processes on screen
|
|
25
|
+
(~15 ms each, busy every 2 s, idle every 30 s, minute-long backoff after
|
|
26
|
+
three failures, stops ~10 s after the view is closed); other users' processes
|
|
27
|
+
need root and stay `n/a`.
|
|
28
|
+
- `tools/ane_load.py`: a manual ANE load (Core ML `mlprogram`) that prints the
|
|
29
|
+
same residency figure as the gauge, for checking it without root.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- DRM clients are keyed by `drm-pdev`, so a process is attributed to the card
|
|
34
|
+
it actually holds; on a multi-AMD host every process used to land on card 0.
|
|
35
|
+
- The GPU view never fills its memory column from RSS. System memory in a
|
|
36
|
+
GPU-memory column is a guess, so an unknown figure stays `n/a`; RSS keeps its
|
|
37
|
+
own `MEM` column in the process view.
|
|
38
|
+
- `GpuMonitor.samples()` takes one `fdinfo` walk per refresh and hands it to
|
|
39
|
+
every card; an 8-card host used to walk every process's fd table once per
|
|
40
|
+
card plus once more for the process ranking.
|
|
41
|
+
- Intel `i915`/`xe` report per-card utilisation through `drm-pdev`; only an old
|
|
42
|
+
kernel without `drm-pdev` falls back to `n/a` on multi-GPU hosts.
|
|
43
|
+
- The Linux process ranking no longer drops GPU-active but CPU-idle processes
|
|
44
|
+
(an inference worker between requests) just because they are outside the
|
|
45
|
+
top 60 by CPU time.
|
|
46
|
+
- The default view's network identity (interface/CIDR, gateway, public IP and
|
|
47
|
+
city) sits on the Network IO box's bottom border and keeps the last non-empty
|
|
48
|
+
text; the key-hint footer is a plain line below it. The previous spare-row
|
|
49
|
+
slot only existed at some terminal heights, and a processor-box title was
|
|
50
|
+
repainted over.
|
|
51
|
+
- The Memory box draws a single RAM bar and gives the rows below it to swap and
|
|
52
|
+
the macOS memory zones, instead of repeating the same bar on every spare row.
|
|
53
|
+
The processor box and the Memory/Temps row keep a fixed content height, and
|
|
54
|
+
surplus rows go to the charts; a one-column gutter separates side-by-side
|
|
55
|
+
usage bars.
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- The default view's `ANE Usage` gauge always read 0 %: it was derived from the
|
|
60
|
+
Energy Model's ANE power counter, which reports 0 on recent Apple Silicon
|
|
61
|
+
even while the ANE runs. It now uses the `ANE` IOReport channel's `status`
|
|
62
|
+
residency (the share of the interval spent `Running`), which reads 0 % idle
|
|
63
|
+
and near 100 % under a Core ML loop; the watts suffix appears only when a
|
|
64
|
+
sample actually measured ANE energy.
|
|
65
|
+
- `drm-engine-capacity-*` lines are no longer parsed as engine time, so a
|
|
66
|
+
capacity value cannot pollute the per-process GPU percentage.
|
|
67
|
+
|
|
3
68
|
## 3.1.0 — 2026-11-15
|
|
4
69
|
|
|
5
70
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: macpm
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.2.0
|
|
4
4
|
Summary: Performance monitoring CLI for Apple Silicon and Linux
|
|
5
5
|
Home-page: https://github.com/visualcjy/macpm
|
|
6
6
|
Author: Jinyu Chen
|
|
@@ -61,6 +61,11 @@ Linux backend.
|
|
|
61
61
|
GPU INFO box, 10-cell VRAM bars, pagination and the served model name.
|
|
62
62
|
Verified on 16× Iluvatar BI-V150S, 64× Denglin KS58, 8× Techo
|
|
63
63
|
TECO_AICARD_01 and 8× RTX 4090.
|
|
64
|
+
- **Per-process GPU memory on Linux DRM cards**: AMD/Intel `fdinfo` bytes are
|
|
65
|
+
charged to a process only when the kernel proves they are private, and the
|
|
66
|
+
card each client belongs to is read from `drm-pdev`; an unprovable row shows
|
|
67
|
+
`n/a` with a reason instead of a guess. On macOS the IOAccelerator's
|
|
68
|
+
allocated GPU memory is shown against unified RAM.
|
|
64
69
|
- **Vendor and NVIDIA backends**: `ixsmi`, `dlsmi`, `teco-smi` and
|
|
65
70
|
`nvidia-smi`, including per-card compute processes and model names.
|
|
66
71
|
|
|
@@ -92,7 +97,7 @@ Network view (press `4` while running):
|
|
|
92
97
|
- **No sudo required.** `macpm` runs as a normal user process.
|
|
93
98
|
- CPU E/P core utilisation and frequency, plus an optional per-core view
|
|
94
99
|
- GPU utilisation and frequency
|
|
95
|
-
- CPU / GPU
|
|
100
|
+
- CPU / GPU power, ANE utilisation (residency counters) and ANE power when the rail reports it, rolling average, peaks and throttle state
|
|
96
101
|
- RAM and swap usage
|
|
97
102
|
- CPU/GPU temperature, peak and fan-load panel (SMC, read-only, no root)
|
|
98
103
|
- Disk IOPS/throughput and network throughput
|
|
@@ -100,9 +105,11 @@ Network view (press `4` while running):
|
|
|
100
105
|
- Network view (`4`) with TCP state counts, listening ports, per-process traffic
|
|
101
106
|
and the local/public IP, gateway and city
|
|
102
107
|
- GPU view (`5`) with utilisation, clock, power, VRAM, temperature and the
|
|
103
|
-
processes using the GPU, ranked by GPU time
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
processes using the GPU, ranked by GPU time; AMD/Intel cards also show each
|
|
109
|
+
process's VRAM/GTT and the card it holds
|
|
110
|
+
- Key-hint footer in every view; the default view puts the network identity
|
|
111
|
+
(interface, CIDR, gateway, public IP and city) on the Network IO box's bottom
|
|
112
|
+
border, and the key hints are a plain line below it
|
|
106
113
|
- Familiar terminal layout, colours, charts and key bindings from macpm 0.x
|
|
107
114
|
|
|
108
115
|
## Install
|
|
@@ -180,6 +187,7 @@ requires root and Apple's private entitlements.
|
|
|
180
187
|
| Per-core load | IOReport `CPU Core Performance States` |
|
|
181
188
|
| GPU load and frequency | IOReport `GPU Stats` / `GPU Performance States` |
|
|
182
189
|
| CPU / GPU / ANE power | IOReport `Energy Model` |
|
|
190
|
+
| ANE utilisation | IOReport `ANE` `status` residency (Running share) |
|
|
183
191
|
| RAM / swap | `psutil` |
|
|
184
192
|
| Disk / network throughput | `psutil` counters |
|
|
185
193
|
| Sockets, listeners, per-process traffic | `nettop` |
|
|
@@ -197,7 +205,11 @@ M1–M3 store Hz there, M4+ store kHz.
|
|
|
197
205
|
|
|
198
206
|
## Temperatures and fans
|
|
199
207
|
|
|
200
|
-
The default view has a **Temps & Fans** box next to the
|
|
208
|
+
The default view has a **Temps & Fans** box next to the **Memory** box. The
|
|
209
|
+
Memory box draws one RAM bar and uses the rows below for swap and the macOS
|
|
210
|
+
memory zones (`wired` / `active` / `inactive` / `free`); the processor box and
|
|
211
|
+
this row keep their content height, and any spare rows go to the charts. The
|
|
212
|
+
Temps & Fans box shows
|
|
201
213
|
the hottest CPU and GPU sensor with their peaks since the last reset (CPU on
|
|
202
214
|
one row, GPU on the next), the current RPM of every fan, and a fan-load bar
|
|
203
215
|
for each fan (current speed as a
|
|
@@ -312,9 +324,17 @@ recovered from the launcher's command line (`--served-model-name`, `--model`,
|
|
|
312
324
|
`--model-path`, `--model-id`) by walking up the parent chain; a single-GPU view
|
|
313
325
|
shows it as a `MODEL` column.
|
|
314
326
|
|
|
327
|
+
The single-GPU process table has a `GPU MEM` column (dedicated memory, or the
|
|
328
|
+
GTT bytes of an integrated GPU) and, when a card reports them, a `SHARED`
|
|
329
|
+
column for GPU-accessible system memory. Neither is ever filled from RSS:
|
|
330
|
+
system memory in a GPU-memory column would be a guess, so an unprovable row
|
|
331
|
+
shows `n/a` and the reason stays in the data
|
|
332
|
+
(`shared_client`, `shared_buffers`, `primary`, `legacy`, `partial_scan`,
|
|
333
|
+
`incomplete`).
|
|
334
|
+
|
|
315
335
|
A single-GPU machine keeps the older layout: card summary on top, process table
|
|
316
336
|
below. Every view's footer starts with the app name and version
|
|
317
|
-
(`macpm v3.
|
|
337
|
+
(`macpm v3.2.0 · q quit …`).
|
|
318
338
|
|
|
319
339
|
```text
|
|
320
340
|
┌ GPU INFO ────────────────────────────────────────────────────────────────────────────────┐
|
|
@@ -328,12 +348,12 @@ below. Every view's footer starts with the app name and version
|
|
|
328
348
|
│ └ 222 Xorg 2.0G │
|
|
329
349
|
│ 2 AMD GPU (amdgpu) ▉▉▉▉▏▏ 60% 1100/1750 12.0W ▉▉▉▉▏▏▏▏▏▏ 3.0G/8.0G 46°C │
|
|
330
350
|
│ 3 AMD GPU (amdgpu) ▉▉▉▉▉▏ 85% 1200/1750 12.0W ▉▉▉▉▉▏▏▏▏▏ 4.0G/8.0G 49°C │
|
|
331
|
-
└ macpm v3.
|
|
351
|
+
└ macpm v3.2.0 · q quit 1-5 view s sort ↑/↓ page Space pause ←/→ colour ────────────────┘
|
|
332
352
|
```
|
|
333
353
|
|
|
334
354
|
| Platform | What fills each row |
|
|
335
355
|
|---|---|
|
|
336
|
-
| macOS | One row: IOReport GPU idle ratio and the Energy Model power; the SMC supplies the temperature. Memory is unified, so the VRAM cell says `unified`. |
|
|
356
|
+
| macOS | One row: IOReport GPU idle ratio and the Energy Model power; the SMC supplies the temperature. Memory is unified, so the VRAM cell shows the IOAccelerator's `Alloc system memory` (every process's Metal allocations) out of physical RAM, and the card title says so; the INFO box adds GPU cores and the Renderer/Tiler split. Each process's `GPU MEM` comes from `footprint`'s `(graphics)` categories. Without registry data the VRAM cell says `unified`. |
|
|
337
357
|
| Linux (amdgpu) | One row per `cardN`: `gpu_busy_percent`, `pp_dpm_sclk`, hwmon power/temperature, `mem_info_vram_*` |
|
|
338
358
|
| Linux (i915/xe) | One row per card: `gt_cur_freq_mhz` / `tile0/gt0/freq0`, DRM `fdinfo` engine time, hwmon temperature; VRAM only when the driver exposes `lmem_total_bytes` |
|
|
339
359
|
| Linux (NVIDIA) | One row per GPU from a single `nvidia-smi --query-gpu` call: utilisation, SM clock, power, memory, temperature. Compute processes come from `nvidia-smi --query-compute-apps` (SM% joined from `pmon`). `nvidia-smi` is found on `PATH`, at `/usr/lib/wsl/lib/nvidia-smi` on WSL, or via `MACPM_NVIDIA_SMI` |
|
|
@@ -361,6 +381,12 @@ Notes:
|
|
|
361
381
|
worker is two hops below `vllm serve`/`sglang.launch_server`, and reading
|
|
362
382
|
`config.json` through `/proc/<pid>/root` can block on a stalled network mount.
|
|
363
383
|
Unknown servers show no name rather than a guess.
|
|
384
|
+
- On macOS, per-process `GPU MEM` is `footprint`'s `(graphics)` dirty bytes
|
|
385
|
+
(Metal buffers and textures), not RSS. One call costs ~15 ms, so a
|
|
386
|
+
background thread measures only the processes on screen: busy ones every 2 s,
|
|
387
|
+
idle ones every 30 s, with a minute of backoff after three failures, and it
|
|
388
|
+
stops ~10 s after the view is closed. Without root `footprint` can only read
|
|
389
|
+
your own processes; the rest keep `n/a`.
|
|
364
390
|
- The nested process line comes from the vendor's own compute-process list
|
|
365
391
|
(`ixsmi pmon`/`--query-compute-apps`, `dlsmi --query-compute-apps`,
|
|
366
392
|
`teco-smi pmon`) or, on macOS and DRM GPUs, from `fdinfo`/IOAccelerator. A
|
|
@@ -375,9 +401,17 @@ Notes:
|
|
|
375
401
|
idle card does not read as generation 1. Consumer cards report `[N/A]` for
|
|
376
402
|
the serial, so their card/die counts are left out instead of guessed; PCIe
|
|
377
403
|
and VBIOS are hidden when the tool reports `N/A`.
|
|
378
|
-
- Intel `fdinfo` counters are
|
|
379
|
-
|
|
380
|
-
|
|
404
|
+
- Intel `fdinfo` counters are split per card through `drm-pdev`, so several
|
|
405
|
+
Intel GPUs each report their own work. An old kernel whose `fdinfo` has no
|
|
406
|
+
`drm-pdev` cannot tell the cards apart, and the per-card BUSY cell then shows
|
|
407
|
+
`n/a` instead of duplicating the aggregate on every row.
|
|
408
|
+
- On AMD/Intel DRM cards, per-process memory is charged only when every
|
|
409
|
+
`drm-shared-*` counter is present and zero, the client was opened through a
|
|
410
|
+
render node, exactly one visible process holds it, and the fdinfo scan
|
|
411
|
+
reached the end. `drm-shared-*` and `drm-resident-*` count by different
|
|
412
|
+
placements, so their difference is never used as "private" memory; anything
|
|
413
|
+
unprovable stays `n/a` rather than being guessed. Other users' processes
|
|
414
|
+
need root to be inspected, and their bytes show as unattributed.
|
|
381
415
|
- The default view's GPU gauge shows the busiest card and appends `(max of N)`
|
|
382
416
|
when the machine has more than one.
|
|
383
417
|
|
|
@@ -436,17 +470,29 @@ python3 -m macpm.probe
|
|
|
436
470
|
| Disk I/O, network rate | `/proc/diskstats`, `/proc/net/dev` | ✅ | ✅ |
|
|
437
471
|
| Processes CPU/MEM | `/proc/<pid>` via `psutil` | ✅ all users | ✅ |
|
|
438
472
|
| Per-process GPU% | DRM `fdinfo` `drm-engine-*` | own processes only | ✅ all |
|
|
473
|
+
| Per-process GPU memory | DRM `fdinfo` `drm-resident-*` / `drm-shared-*` | own processes only | ✅ all |
|
|
474
|
+
| GPU memory (device) | amdgpu `mem_info_vram_*`, i915/xe `lmem_total_bytes` | ✅ | ✅ |
|
|
439
475
|
| TCP/UDP counts, listeners | `/proc/net/{tcp,tcp6,udp,udp6}` | ✅ counts, own PIDs | ✅ all PIDs |
|
|
440
476
|
| Per-process traffic | `ss -tanie` `tcp_info` | own processes, TCP only | ✅ all |
|
|
441
477
|
|
|
442
478
|
**GPU notes.** `amdgpu` exposes everything. Intel `i915`/`xe` have no global
|
|
443
479
|
busy counter, so macpm sums every DRM client's engine time from `fdinfo` —
|
|
444
480
|
which needs root to see other processes, otherwise it only shows macpm's own
|
|
445
|
-
GPU work.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
481
|
+
GPU work. The same `fdinfo` file carries the client's memory, so AMD and Intel
|
|
482
|
+
cards also get per-process VRAM/GTT; NVIDIA uses `nvidia-smi`, which reports
|
|
483
|
+
memory itself. Vendor ARM GPUs and Apple GPU under Asahi have no exported
|
|
484
|
+
counters yet and show `n/a`.
|
|
485
|
+
|
|
486
|
+
**No ANE on Linux.** There is no Linux equivalent of the Apple Neural Engine
|
|
487
|
+
counter, so that gauge is removed there.
|
|
488
|
+
|
|
489
|
+
**ANE usage is residency, not power.** On recent Apple Silicon the Energy
|
|
490
|
+
Model's ANE power tile stopped updating (it reads 0 W even while the ANE
|
|
491
|
+
runs), so `ANE Usage` comes from the `ANE` group's `status` channel: the share
|
|
492
|
+
of the interval spent in the `Running` state. Idle is 0 %, a Core ML
|
|
493
|
+
`mlprogram` loop holds it near 100 %. Watts are only appended when that sample
|
|
494
|
+
actually measured nonzero ANE energy. `tools/ane_load.py` builds such a loop
|
|
495
|
+
for a manual check (it needs `coremltools`; macpm itself does not).
|
|
450
496
|
|
|
451
497
|
**Vendor accelerators need a vendor tool.** Ampere/Intel/AMD GPUs expose
|
|
452
498
|
kernel counters, but many accelerator cards only ship a management CLI and no
|
|
@@ -502,9 +548,13 @@ headless UI against it.
|
|
|
502
548
|
|
|
503
549
|
## Standalone binaries
|
|
504
550
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
551
|
+
`macpm` can be shipped as a self-contained binary, so the target machine needs
|
|
552
|
+
no Python installation. There are two build paths.
|
|
553
|
+
|
|
554
|
+
### macOS (arm64)
|
|
555
|
+
|
|
556
|
+
`packaging/build.sh`, run on an Apple Silicon Mac, produces an unsigned/ad-hoc
|
|
557
|
+
arm64 `macpm` and `macpm-<version>-macos-arm64.tar.gz`.
|
|
508
558
|
|
|
509
559
|
On first launch from a browser download, macOS Gatekeeper may ask you to
|
|
510
560
|
right-click → Open, or you can remove the quarantine flag:
|
|
@@ -515,6 +565,32 @@ xattr -d com.apple.quarantine ./macpm ./macpm.command
|
|
|
515
565
|
|
|
516
566
|
See [packaging/README.txt](https://github.com/visualcjy/macpm/blob/main/packaging/README.txt) for details.
|
|
517
567
|
|
|
568
|
+
### Linux (x86_64 / aarch64)
|
|
569
|
+
|
|
570
|
+
`packaging/build-linux.sh` builds one-file binaries and, with `--deb`, Debian
|
|
571
|
+
packages:
|
|
572
|
+
|
|
573
|
+
```sh
|
|
574
|
+
packaging/build-linux.sh both --deb
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
Each target gets its own python-build-standalone interpreter, so the result
|
|
578
|
+
does not depend on the build host's Python. The binaries keep a glibc 2.17
|
|
579
|
+
floor (CentOS 7 / Ubuntu 16.04 / Debian 9 and newer) and use the system's
|
|
580
|
+
`libgcc_s`, which every glibc distribution ships. Output:
|
|
581
|
+
|
|
582
|
+
```text
|
|
583
|
+
dist/macpm-<version>-linux-x86_64.tar.gz
|
|
584
|
+
dist/macpm-<version>-linux-aarch64.tar.gz
|
|
585
|
+
dist/macpm_<version>_amd64.deb
|
|
586
|
+
dist/macpm_<version>_arm64.deb
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
Build on a native machine, or build x86_64 on an arm64 host through Rosetta
|
|
590
|
+
(an OrbStack Ubuntu VM works; install `binutils-x86-64-linux-gnu` there).
|
|
591
|
+
[packaging/README-linux.txt](https://github.com/visualcjy/macpm/blob/main/packaging/README-linux.txt)
|
|
592
|
+
is the README that ships inside the tarball.
|
|
593
|
+
|
|
518
594
|
## Development
|
|
519
595
|
|
|
520
596
|
```sh
|
|
@@ -19,6 +19,11 @@ Linux backend.
|
|
|
19
19
|
GPU INFO box, 10-cell VRAM bars, pagination and the served model name.
|
|
20
20
|
Verified on 16× Iluvatar BI-V150S, 64× Denglin KS58, 8× Techo
|
|
21
21
|
TECO_AICARD_01 and 8× RTX 4090.
|
|
22
|
+
- **Per-process GPU memory on Linux DRM cards**: AMD/Intel `fdinfo` bytes are
|
|
23
|
+
charged to a process only when the kernel proves they are private, and the
|
|
24
|
+
card each client belongs to is read from `drm-pdev`; an unprovable row shows
|
|
25
|
+
`n/a` with a reason instead of a guess. On macOS the IOAccelerator's
|
|
26
|
+
allocated GPU memory is shown against unified RAM.
|
|
22
27
|
- **Vendor and NVIDIA backends**: `ixsmi`, `dlsmi`, `teco-smi` and
|
|
23
28
|
`nvidia-smi`, including per-card compute processes and model names.
|
|
24
29
|
|
|
@@ -50,7 +55,7 @@ Network view (press `4` while running):
|
|
|
50
55
|
- **No sudo required.** `macpm` runs as a normal user process.
|
|
51
56
|
- CPU E/P core utilisation and frequency, plus an optional per-core view
|
|
52
57
|
- GPU utilisation and frequency
|
|
53
|
-
- CPU / GPU
|
|
58
|
+
- CPU / GPU power, ANE utilisation (residency counters) and ANE power when the rail reports it, rolling average, peaks and throttle state
|
|
54
59
|
- RAM and swap usage
|
|
55
60
|
- CPU/GPU temperature, peak and fan-load panel (SMC, read-only, no root)
|
|
56
61
|
- Disk IOPS/throughput and network throughput
|
|
@@ -58,9 +63,11 @@ Network view (press `4` while running):
|
|
|
58
63
|
- Network view (`4`) with TCP state counts, listening ports, per-process traffic
|
|
59
64
|
and the local/public IP, gateway and city
|
|
60
65
|
- GPU view (`5`) with utilisation, clock, power, VRAM, temperature and the
|
|
61
|
-
processes using the GPU, ranked by GPU time
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
processes using the GPU, ranked by GPU time; AMD/Intel cards also show each
|
|
67
|
+
process's VRAM/GTT and the card it holds
|
|
68
|
+
- Key-hint footer in every view; the default view puts the network identity
|
|
69
|
+
(interface, CIDR, gateway, public IP and city) on the Network IO box's bottom
|
|
70
|
+
border, and the key hints are a plain line below it
|
|
64
71
|
- Familiar terminal layout, colours, charts and key bindings from macpm 0.x
|
|
65
72
|
|
|
66
73
|
## Install
|
|
@@ -138,6 +145,7 @@ requires root and Apple's private entitlements.
|
|
|
138
145
|
| Per-core load | IOReport `CPU Core Performance States` |
|
|
139
146
|
| GPU load and frequency | IOReport `GPU Stats` / `GPU Performance States` |
|
|
140
147
|
| CPU / GPU / ANE power | IOReport `Energy Model` |
|
|
148
|
+
| ANE utilisation | IOReport `ANE` `status` residency (Running share) |
|
|
141
149
|
| RAM / swap | `psutil` |
|
|
142
150
|
| Disk / network throughput | `psutil` counters |
|
|
143
151
|
| Sockets, listeners, per-process traffic | `nettop` |
|
|
@@ -155,7 +163,11 @@ M1–M3 store Hz there, M4+ store kHz.
|
|
|
155
163
|
|
|
156
164
|
## Temperatures and fans
|
|
157
165
|
|
|
158
|
-
The default view has a **Temps & Fans** box next to the
|
|
166
|
+
The default view has a **Temps & Fans** box next to the **Memory** box. The
|
|
167
|
+
Memory box draws one RAM bar and uses the rows below for swap and the macOS
|
|
168
|
+
memory zones (`wired` / `active` / `inactive` / `free`); the processor box and
|
|
169
|
+
this row keep their content height, and any spare rows go to the charts. The
|
|
170
|
+
Temps & Fans box shows
|
|
159
171
|
the hottest CPU and GPU sensor with their peaks since the last reset (CPU on
|
|
160
172
|
one row, GPU on the next), the current RPM of every fan, and a fan-load bar
|
|
161
173
|
for each fan (current speed as a
|
|
@@ -270,9 +282,17 @@ recovered from the launcher's command line (`--served-model-name`, `--model`,
|
|
|
270
282
|
`--model-path`, `--model-id`) by walking up the parent chain; a single-GPU view
|
|
271
283
|
shows it as a `MODEL` column.
|
|
272
284
|
|
|
285
|
+
The single-GPU process table has a `GPU MEM` column (dedicated memory, or the
|
|
286
|
+
GTT bytes of an integrated GPU) and, when a card reports them, a `SHARED`
|
|
287
|
+
column for GPU-accessible system memory. Neither is ever filled from RSS:
|
|
288
|
+
system memory in a GPU-memory column would be a guess, so an unprovable row
|
|
289
|
+
shows `n/a` and the reason stays in the data
|
|
290
|
+
(`shared_client`, `shared_buffers`, `primary`, `legacy`, `partial_scan`,
|
|
291
|
+
`incomplete`).
|
|
292
|
+
|
|
273
293
|
A single-GPU machine keeps the older layout: card summary on top, process table
|
|
274
294
|
below. Every view's footer starts with the app name and version
|
|
275
|
-
(`macpm v3.
|
|
295
|
+
(`macpm v3.2.0 · q quit …`).
|
|
276
296
|
|
|
277
297
|
```text
|
|
278
298
|
┌ GPU INFO ────────────────────────────────────────────────────────────────────────────────┐
|
|
@@ -286,12 +306,12 @@ below. Every view's footer starts with the app name and version
|
|
|
286
306
|
│ └ 222 Xorg 2.0G │
|
|
287
307
|
│ 2 AMD GPU (amdgpu) ▉▉▉▉▏▏ 60% 1100/1750 12.0W ▉▉▉▉▏▏▏▏▏▏ 3.0G/8.0G 46°C │
|
|
288
308
|
│ 3 AMD GPU (amdgpu) ▉▉▉▉▉▏ 85% 1200/1750 12.0W ▉▉▉▉▉▏▏▏▏▏ 4.0G/8.0G 49°C │
|
|
289
|
-
└ macpm v3.
|
|
309
|
+
└ macpm v3.2.0 · q quit 1-5 view s sort ↑/↓ page Space pause ←/→ colour ────────────────┘
|
|
290
310
|
```
|
|
291
311
|
|
|
292
312
|
| Platform | What fills each row |
|
|
293
313
|
|---|---|
|
|
294
|
-
| macOS | One row: IOReport GPU idle ratio and the Energy Model power; the SMC supplies the temperature. Memory is unified, so the VRAM cell says `unified`. |
|
|
314
|
+
| macOS | One row: IOReport GPU idle ratio and the Energy Model power; the SMC supplies the temperature. Memory is unified, so the VRAM cell shows the IOAccelerator's `Alloc system memory` (every process's Metal allocations) out of physical RAM, and the card title says so; the INFO box adds GPU cores and the Renderer/Tiler split. Each process's `GPU MEM` comes from `footprint`'s `(graphics)` categories. Without registry data the VRAM cell says `unified`. |
|
|
295
315
|
| Linux (amdgpu) | One row per `cardN`: `gpu_busy_percent`, `pp_dpm_sclk`, hwmon power/temperature, `mem_info_vram_*` |
|
|
296
316
|
| Linux (i915/xe) | One row per card: `gt_cur_freq_mhz` / `tile0/gt0/freq0`, DRM `fdinfo` engine time, hwmon temperature; VRAM only when the driver exposes `lmem_total_bytes` |
|
|
297
317
|
| Linux (NVIDIA) | One row per GPU from a single `nvidia-smi --query-gpu` call: utilisation, SM clock, power, memory, temperature. Compute processes come from `nvidia-smi --query-compute-apps` (SM% joined from `pmon`). `nvidia-smi` is found on `PATH`, at `/usr/lib/wsl/lib/nvidia-smi` on WSL, or via `MACPM_NVIDIA_SMI` |
|
|
@@ -319,6 +339,12 @@ Notes:
|
|
|
319
339
|
worker is two hops below `vllm serve`/`sglang.launch_server`, and reading
|
|
320
340
|
`config.json` through `/proc/<pid>/root` can block on a stalled network mount.
|
|
321
341
|
Unknown servers show no name rather than a guess.
|
|
342
|
+
- On macOS, per-process `GPU MEM` is `footprint`'s `(graphics)` dirty bytes
|
|
343
|
+
(Metal buffers and textures), not RSS. One call costs ~15 ms, so a
|
|
344
|
+
background thread measures only the processes on screen: busy ones every 2 s,
|
|
345
|
+
idle ones every 30 s, with a minute of backoff after three failures, and it
|
|
346
|
+
stops ~10 s after the view is closed. Without root `footprint` can only read
|
|
347
|
+
your own processes; the rest keep `n/a`.
|
|
322
348
|
- The nested process line comes from the vendor's own compute-process list
|
|
323
349
|
(`ixsmi pmon`/`--query-compute-apps`, `dlsmi --query-compute-apps`,
|
|
324
350
|
`teco-smi pmon`) or, on macOS and DRM GPUs, from `fdinfo`/IOAccelerator. A
|
|
@@ -333,9 +359,17 @@ Notes:
|
|
|
333
359
|
idle card does not read as generation 1. Consumer cards report `[N/A]` for
|
|
334
360
|
the serial, so their card/die counts are left out instead of guessed; PCIe
|
|
335
361
|
and VBIOS are hidden when the tool reports `N/A`.
|
|
336
|
-
- Intel `fdinfo` counters are
|
|
337
|
-
|
|
338
|
-
|
|
362
|
+
- Intel `fdinfo` counters are split per card through `drm-pdev`, so several
|
|
363
|
+
Intel GPUs each report their own work. An old kernel whose `fdinfo` has no
|
|
364
|
+
`drm-pdev` cannot tell the cards apart, and the per-card BUSY cell then shows
|
|
365
|
+
`n/a` instead of duplicating the aggregate on every row.
|
|
366
|
+
- On AMD/Intel DRM cards, per-process memory is charged only when every
|
|
367
|
+
`drm-shared-*` counter is present and zero, the client was opened through a
|
|
368
|
+
render node, exactly one visible process holds it, and the fdinfo scan
|
|
369
|
+
reached the end. `drm-shared-*` and `drm-resident-*` count by different
|
|
370
|
+
placements, so their difference is never used as "private" memory; anything
|
|
371
|
+
unprovable stays `n/a` rather than being guessed. Other users' processes
|
|
372
|
+
need root to be inspected, and their bytes show as unattributed.
|
|
339
373
|
- The default view's GPU gauge shows the busiest card and appends `(max of N)`
|
|
340
374
|
when the machine has more than one.
|
|
341
375
|
|
|
@@ -394,17 +428,29 @@ python3 -m macpm.probe
|
|
|
394
428
|
| Disk I/O, network rate | `/proc/diskstats`, `/proc/net/dev` | ✅ | ✅ |
|
|
395
429
|
| Processes CPU/MEM | `/proc/<pid>` via `psutil` | ✅ all users | ✅ |
|
|
396
430
|
| Per-process GPU% | DRM `fdinfo` `drm-engine-*` | own processes only | ✅ all |
|
|
431
|
+
| Per-process GPU memory | DRM `fdinfo` `drm-resident-*` / `drm-shared-*` | own processes only | ✅ all |
|
|
432
|
+
| GPU memory (device) | amdgpu `mem_info_vram_*`, i915/xe `lmem_total_bytes` | ✅ | ✅ |
|
|
397
433
|
| TCP/UDP counts, listeners | `/proc/net/{tcp,tcp6,udp,udp6}` | ✅ counts, own PIDs | ✅ all PIDs |
|
|
398
434
|
| Per-process traffic | `ss -tanie` `tcp_info` | own processes, TCP only | ✅ all |
|
|
399
435
|
|
|
400
436
|
**GPU notes.** `amdgpu` exposes everything. Intel `i915`/`xe` have no global
|
|
401
437
|
busy counter, so macpm sums every DRM client's engine time from `fdinfo` —
|
|
402
438
|
which needs root to see other processes, otherwise it only shows macpm's own
|
|
403
|
-
GPU work.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
439
|
+
GPU work. The same `fdinfo` file carries the client's memory, so AMD and Intel
|
|
440
|
+
cards also get per-process VRAM/GTT; NVIDIA uses `nvidia-smi`, which reports
|
|
441
|
+
memory itself. Vendor ARM GPUs and Apple GPU under Asahi have no exported
|
|
442
|
+
counters yet and show `n/a`.
|
|
443
|
+
|
|
444
|
+
**No ANE on Linux.** There is no Linux equivalent of the Apple Neural Engine
|
|
445
|
+
counter, so that gauge is removed there.
|
|
446
|
+
|
|
447
|
+
**ANE usage is residency, not power.** On recent Apple Silicon the Energy
|
|
448
|
+
Model's ANE power tile stopped updating (it reads 0 W even while the ANE
|
|
449
|
+
runs), so `ANE Usage` comes from the `ANE` group's `status` channel: the share
|
|
450
|
+
of the interval spent in the `Running` state. Idle is 0 %, a Core ML
|
|
451
|
+
`mlprogram` loop holds it near 100 %. Watts are only appended when that sample
|
|
452
|
+
actually measured nonzero ANE energy. `tools/ane_load.py` builds such a loop
|
|
453
|
+
for a manual check (it needs `coremltools`; macpm itself does not).
|
|
408
454
|
|
|
409
455
|
**Vendor accelerators need a vendor tool.** Ampere/Intel/AMD GPUs expose
|
|
410
456
|
kernel counters, but many accelerator cards only ship a management CLI and no
|
|
@@ -460,9 +506,13 @@ headless UI against it.
|
|
|
460
506
|
|
|
461
507
|
## Standalone binaries
|
|
462
508
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
509
|
+
`macpm` can be shipped as a self-contained binary, so the target machine needs
|
|
510
|
+
no Python installation. There are two build paths.
|
|
511
|
+
|
|
512
|
+
### macOS (arm64)
|
|
513
|
+
|
|
514
|
+
`packaging/build.sh`, run on an Apple Silicon Mac, produces an unsigned/ad-hoc
|
|
515
|
+
arm64 `macpm` and `macpm-<version>-macos-arm64.tar.gz`.
|
|
466
516
|
|
|
467
517
|
On first launch from a browser download, macOS Gatekeeper may ask you to
|
|
468
518
|
right-click → Open, or you can remove the quarantine flag:
|
|
@@ -473,6 +523,32 @@ xattr -d com.apple.quarantine ./macpm ./macpm.command
|
|
|
473
523
|
|
|
474
524
|
See [packaging/README.txt](https://github.com/visualcjy/macpm/blob/main/packaging/README.txt) for details.
|
|
475
525
|
|
|
526
|
+
### Linux (x86_64 / aarch64)
|
|
527
|
+
|
|
528
|
+
`packaging/build-linux.sh` builds one-file binaries and, with `--deb`, Debian
|
|
529
|
+
packages:
|
|
530
|
+
|
|
531
|
+
```sh
|
|
532
|
+
packaging/build-linux.sh both --deb
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
Each target gets its own python-build-standalone interpreter, so the result
|
|
536
|
+
does not depend on the build host's Python. The binaries keep a glibc 2.17
|
|
537
|
+
floor (CentOS 7 / Ubuntu 16.04 / Debian 9 and newer) and use the system's
|
|
538
|
+
`libgcc_s`, which every glibc distribution ships. Output:
|
|
539
|
+
|
|
540
|
+
```text
|
|
541
|
+
dist/macpm-<version>-linux-x86_64.tar.gz
|
|
542
|
+
dist/macpm-<version>-linux-aarch64.tar.gz
|
|
543
|
+
dist/macpm_<version>_amd64.deb
|
|
544
|
+
dist/macpm_<version>_arm64.deb
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
Build on a native machine, or build x86_64 on an arm64 host through Rosetta
|
|
548
|
+
(an OrbStack Ubuntu VM works; install `binutils-x86-64-linux-gnu` there).
|
|
549
|
+
[packaging/README-linux.txt](https://github.com/visualcjy/macpm/blob/main/packaging/README-linux.txt)
|
|
550
|
+
is the README that ships inside the tarball.
|
|
551
|
+
|
|
476
552
|
## Development
|
|
477
553
|
|
|
478
554
|
```sh
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Releasing macpm 3.0
|
|
1
|
+
# Releasing macpm 3.2.0
|
|
2
2
|
|
|
3
3
|
This checklist prepares a GitHub tag and a PyPI upload. It does not push or
|
|
4
4
|
publish anything by itself.
|
|
@@ -7,11 +7,11 @@ publish anything by itself.
|
|
|
7
7
|
|
|
8
8
|
- macOS Apple Silicon, Python 3.9+.
|
|
9
9
|
- Clean working tree (`git status`), all tests passing.
|
|
10
|
-
- Version is `3.
|
|
10
|
+
- Version is `3.2.0` in:
|
|
11
11
|
- `setup.py`
|
|
12
|
-
- `macpm/__init__.py`
|
|
13
|
-
- `macpm/macpm.py`
|
|
14
|
-
- `CHANGELOG.md` has the 3.0
|
|
12
|
+
- `macpm/__init__.py` (`__version__`)
|
|
13
|
+
- the banner and `--version` derive from it (`macpm/macpm.py`)
|
|
14
|
+
- `CHANGELOG.md` has the `3.2.0` entry.
|
|
15
15
|
|
|
16
16
|
## 2. Test from source
|
|
17
17
|
|
|
@@ -38,7 +38,7 @@ Test the wheel in a **clean** venv (this is the real "no source tree" test):
|
|
|
38
38
|
|
|
39
39
|
```sh
|
|
40
40
|
python3 -m venv /tmp/macpm-wheel-test
|
|
41
|
-
/tmp/macpm-wheel-test/bin/pip install dist/macpm-3.
|
|
41
|
+
/tmp/macpm-wheel-test/bin/pip install dist/macpm-3.2.0-py3-none-any.whl
|
|
42
42
|
/tmp/macpm-wheel-test/bin/macpm --help
|
|
43
43
|
/tmp/macpm-wheel-test/bin/macpm-dump # Ctrl+C
|
|
44
44
|
```
|
|
@@ -78,13 +78,13 @@ Manual alternative (fallback, e.g. when OIDC is unavailable):
|
|
|
78
78
|
```sh
|
|
79
79
|
# requires a PyPI API token in ~/.pypirc or TWINE_PASSWORD
|
|
80
80
|
python3 -m twine upload --non-interactive \
|
|
81
|
-
dist/macpm-3.
|
|
81
|
+
dist/macpm-3.2.0.tar.gz dist/macpm-3.2.0-py3-none-any.whl
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
Then verify:
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
|
-
python3 -m pip install --upgrade macpm==3.
|
|
87
|
+
python3 -m pip install --upgrade macpm==3.2.0
|
|
88
88
|
macpm --version
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -93,10 +93,10 @@ macpm --version
|
|
|
93
93
|
```sh
|
|
94
94
|
git add setup.py pyproject.toml MANIFEST.in README.md CHANGELOG.md RELEASE.md \
|
|
95
95
|
macpm packaging tests .github bin
|
|
96
|
-
git commit -m "Release macpm 3.
|
|
97
|
-
git tag -a v3.
|
|
96
|
+
git commit -m "Release macpm 3.2.0: per-process GPU memory, ANE utilisation"
|
|
97
|
+
git tag -a v3.2.0 -m "macpm 3.2.0"
|
|
98
98
|
git push origin main
|
|
99
|
-
git push origin v3.
|
|
99
|
+
git push origin v3.2.0
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
The `Release` workflow builds the sdist/wheel, checks metadata and attaches
|
|
@@ -109,7 +109,9 @@ tag pushes to a GitHub release only.
|
|
|
109
109
|
If you prefer a manual release, create one from the tag and upload
|
|
110
110
|
`dist/*.whl`, `dist/*.tar.gz` and the standalone tarball.
|
|
111
111
|
|
|
112
|
-
## 6. Standalone
|
|
112
|
+
## 6. Standalone binaries (optional)
|
|
113
|
+
|
|
114
|
+
### macOS (arm64)
|
|
113
115
|
|
|
114
116
|
On an Apple Silicon build machine:
|
|
115
117
|
|
|
@@ -120,7 +122,7 @@ PYTHON=python3 packaging/build.sh
|
|
|
120
122
|
This produces:
|
|
121
123
|
|
|
122
124
|
```text
|
|
123
|
-
dist/macpm-3.
|
|
125
|
+
dist/macpm-3.2.0-macos-arm64.tar.gz
|
|
124
126
|
```
|
|
125
127
|
|
|
126
128
|
Attach it to the GitHub release. The binaries are ad-hoc signed, not
|
|
@@ -128,6 +130,35 @@ notarized; see `packaging/README.txt` for the Gatekeeper note. To notarize,
|
|
|
128
130
|
pass `CODESIGN_ID` to the build script and submit/staple the archive with
|
|
129
131
|
`notarytool`.
|
|
130
132
|
|
|
133
|
+
### Linux (x86_64 / aarch64)
|
|
134
|
+
|
|
135
|
+
The `Release` workflow builds these four files on native Ubuntu runners
|
|
136
|
+
(`ubuntu-22.04` and `ubuntu-22.04-arm`) on every `v*` tag push and attaches
|
|
137
|
+
them to the release. The manual steps below are only needed for a local
|
|
138
|
+
build.
|
|
139
|
+
|
|
140
|
+
On a Linux build host (an arm64 Ubuntu VM in OrbStack is enough: the script
|
|
141
|
+
runs the x86_64 interpreter through Rosetta):
|
|
142
|
+
|
|
143
|
+
```sh
|
|
144
|
+
packaging/build-linux.sh both --deb
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The first run downloads python-build-standalone (cached in
|
|
148
|
+
`~/.cache/macpm-build/pbs`) and produces:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
dist/macpm-3.2.0-linux-x86_64.tar.gz
|
|
152
|
+
dist/macpm-3.2.0-linux-aarch64.tar.gz
|
|
153
|
+
dist/macpm_3.2.0_amd64.deb
|
|
154
|
+
dist/macpm_3.2.0_arm64.deb
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Both architectures keep a glibc 2.17 floor. Building x86_64 on an arm64 host
|
|
158
|
+
needs `binutils-x86-64-linux-gnu` (for `objcopy`) and the amd64 glibc
|
|
159
|
+
(`dpkg --add-architecture amd64`, `libc6:amd64`). Attach the four files to
|
|
160
|
+
the release next to the macOS tarball.
|
|
161
|
+
|
|
131
162
|
## 7. Update the Homebrew tap
|
|
132
163
|
|
|
133
164
|
`brew install visualcjy/macpm/macpm` installs the standalone tarball from the
|
|
@@ -103,6 +103,39 @@ def gpu_process_source():
|
|
|
103
103
|
return None
|
|
104
104
|
|
|
105
105
|
|
|
106
|
+
def gpu_process_detail_source():
|
|
107
|
+
"""Callable returning per-process DRM memory for the GPU view, or None.
|
|
108
|
+
|
|
109
|
+
Only cards whose driver exposes ``fdinfo`` memory counters (amdgpu, i915,
|
|
110
|
+
xe) have an answer; vendor *smi tools already report memory themselves.
|
|
111
|
+
"""
|
|
112
|
+
if is_linux():
|
|
113
|
+
from .linux_backend.gpu import shared_backend
|
|
114
|
+
|
|
115
|
+
monitor = shared_backend()
|
|
116
|
+
if any(
|
|
117
|
+
backend.driver in ("amdgpu", "i915", "xe")
|
|
118
|
+
for backend in monitor.backends
|
|
119
|
+
):
|
|
120
|
+
return monitor.process_details
|
|
121
|
+
return None
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def gpu_process_memory_source():
|
|
125
|
+
"""Background per-process GPU memory for the GPU view on macOS, or None.
|
|
126
|
+
|
|
127
|
+
Returns a :class:`macpm.footprint.FootprintPoller` (``set_targets`` /
|
|
128
|
+
``get`` / ``close``). Linux DRM cards answer through
|
|
129
|
+
``gpu_process_detail_source`` and vendor tools report memory themselves.
|
|
130
|
+
"""
|
|
131
|
+
if platform_name() == "macos":
|
|
132
|
+
from .footprint import FootprintPoller, available
|
|
133
|
+
|
|
134
|
+
if available():
|
|
135
|
+
return FootprintPoller()
|
|
136
|
+
return None
|
|
137
|
+
|
|
138
|
+
|
|
106
139
|
def sensor_source():
|
|
107
140
|
"""``"smc"`` on macOS, ``"hwmon"`` on Linux."""
|
|
108
141
|
return "hwmon" if is_linux() else "smc"
|