jobgpumonitor
Your GPU job tells you what it is doing. You stop ssh-ing in to check.
One import · zero dependencies · Slurm, OAR, PBS, LSF or none
Your job waited four hours in the queue, ran for two, and died at 3 a.m.
You found out at 9, from a .err file.
jobgpumonitor makes the job report on itself while it runs: where it is, how fast it goes,
whether the GPU is actually busy, how close it is to the memory limit, what the traceback was,
and how it ended. Everything is streamed as plain JSONL events to your shared filesystem,
so a notifier, a dashboard or a one-line grep can read it. No network from the compute node.
30-second start
pip install jobgpumonitor
import jobgpumonitor.auto
That is the whole integration. No code at all? Wrap the command instead:
jgm run -- python train.py
Events land in ~/.jobgpumonitor/runs/<cluster>/<job>/<restart>/. Run jgm doctor on a node
to see what gets detected.
What the job tells you
| Event | The question it answers |
|---|---|
run.start |
Which commit, which GPUs, which node, and when the scheduler will kill it |
progress.update |
tqdm ETA compared to the job deadline, hours before a time-out |
resource.sample |
Is the GPU idle? How close to the cgroup memory limit, before the OOM kill |
run.exception |
The full traceback, secrets masked, OOM flagged |
run.end |
Status, exit code, GPU utilisation and peak memory summary |
run.heartbeat |
Still alive, latest metrics, latest progress |
Add your own with jobgpumonitor.log(loss=0.12, step=10) or jgm emit stage name=eval from bash.
Designed for real clusters
- No network needed from the job. Compute nodes rarely have internet; the shared filesystem always works.
jgm forwardon the login node ships the files to a server over HTTPS, through the site proxy, and resumes where it left off. - Never touches your program. Hooks are chained, not replaced. Nothing raises. Forked workers and DDP ranks other than 0 stay quiet. Writes happen on a background thread, so a slow NFS never stalls a training step.
- Works inside containers. Reads environment variables and
/proconly, nosqueuerequired. PointJGM_DIRat a mounted path and you are done. - Honest about what it cannot see. A SIGKILL leaves no trace from inside. Run
jgm scheduleron the login node: it watchessqueue/sacctand writes the scheduler's verdict (OOM, time-out, preemption, cancel), the queue state and the real.outpath into the same run directories.
Slurm in one screen
#!/bin/bash
#SBATCH --gpus-per-node=1 --time=04:00:00
export PYTHONUNBUFFERED=1
srun jgm run -- python train.py
Inside an enroot or Apptainer container, mount the event directory and export JGM_DIR:
mkdir -p "$HOME/.jobgpumonitor" && export JGM_DIR=/jgm
srun --container-mounts="$HOME/.jobgpumonitor:/jgm" jgm run -- python train.py
Command line
jgm ships with the package (short for jobgpumonitor); python -m jobgpumonitor.cli is equivalent.
jgm run [--name N] -- CMD... run a command under monitoring, forward signals, keep the stderr tail
jgm scheduler [--once] login-node probe: squeue/sacct (or oarstat) -> scheduler.state events
jgm forward --url U --token T login-node relay: ship the event files to a jobgpumonitor-server (POST /ingest)
jgm emit TYPE k=v ... emit one event from a shell script
jgm doctor [--json] show what is detected on this node
jgm ls [--dir D] list runs found in the event directory
Keep the probe alive on the login node with tmux or systemd --user, or run
jgm scheduler --once from cron.
Configuration
Every knob is a JGM_* environment variable, all optional.
JGM_DIR, JGM_SINKS, JGM_HEARTBEAT_S, JGM_SAMPLE_S, JGM_RANK_MODE, JGM_LOGGING_LEVEL,
JGM_CAPTURE_LOCALS, JGM_DISABLED. The full list is in docs/CONFIG.md.
pip install "jobgpumonitor[gpu]" adds nvidia-ml-py and psutil for cheaper, richer samples.
Without them the same data comes from nvidia-smi and /proc.
Ecosystem
This package only emits. Storage, API, notifications and dashboards live in a separate
server that consumes the event protocol (JSON Schema in
schema/). Write your own consumer in an afternoon, or wait for ours.
Contributing
pip install -e ".[dev]" && pytest
Design notes in docs/DESIGN.md. Issues and pull requests welcome, especially reports from clusters and schedulers we have not seen.
Release files for jobgpumonitor 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jobgpumonitor-0.2.0.tar.gz | 72.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jobgpumonitor-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 131.2 kB
Release files / jobgpumonitor-0.2.0.tar.gz
| Download URL | jobgpumonitor-0.2.0.tar.gz |
|---|---|
| Size | 72.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51923410851a6996b846a1789daf16f3ff2d03e95a3dd8d4e83c6d20294f8fec
|
|
BLAKE2b-256 checksum How to use checksums |
b4581448096940a677034c9016fa1db715a1a6ab785144b126b65af8e0927ee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / jobgpumonitor-0.2.0-py3-none-any.whl
| Download URL | jobgpumonitor-0.2.0-py3-none-any.whl |
|---|---|
| Size | 58.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f5aed26fa4c20459c802763a426021940d1de44e1d9285c80958e134a91140a
|
|
BLAKE2b-256 checksum How to use checksums |
4b86c2beafe9e329efdb1cdf1bb01538acc3d856a286becb22d976eeea9d19d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log