rampgate-nvml
NVIDIA GPU probe for rampgate, an admission scheduler for jobs that ramp up their memory. It reports each GPU's capacity, used memory and per-process usage through NVML, so the scheduler can act on what jobs really use. It also maps a process to its container.
Install
pip install rampgate-nvml
Requires an NVIDIA driver on the machine. Depends on rampgate and nvidia-ml-py.
Usage
from rampgate_nvml import NvmlProbe, pid_to_container_id
with NvmlProbe({0: "gpu0"}, unit="MiB") as probe:
for device in probe.devices(): # capacity: total memory; stable_min_usage: 256 MiB
engine.add_device(device)
observed, processes = probe.sample(t) # DeviceObserved per GPU, ProcessUsage per process
for p in processes:
container = pid_to_container_id(p.pid) # via /proc/<pid>/cgroup; None outside a container
What to expect
used_totalincludes everything.DeviceObserved.used_totalis NVML'sused: the driver's own share and every process, managed or not. rampgate treats what it cannot attribute to a managed job as foreign usage. On the one GPU measured (RTX 4050), the driver's reservation was 371 MiB.- A process's usage includes its CUDA context, measured there at about 82 MiB.
- Usage floor.
devices()sets a 256 MiB Rule S floor (stable_min_usage_mib), so a job without a step counter that is still loading data is not marked stable at near-zero memory. Pass0to turn it off. - Containers.
pid_to_container_idunderstands cgroup v1 and v2 paths of docker (systemd and cgroupfs drivers), containerd, CRI-O and podman, including paths relative to a private cgroup namespace (0::/../docker-<id>.scope). - Host PID namespace required. NVML lists processes by host pid, so a probe running in a container needs
docker run --pid=host(and--gpus all).
Tested on one laptop GPU; multiple GPUs are not yet tested.
Links
Documentation · rampgate core · Source · Changelog
Apache-2.0.
Metadata
Release files for rampgate-nvml 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 | Provenance | Actions |
|---|---|---|---|---|
| rampgate_nvml-0.2.0.tar.gz | 13.0 kB | With provenance | Details for rampgate_nvml-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rampgate_nvml-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for rampgate_nvml-0.2.0-py3-none-any.whl |
Total release size: 23.6 kB
Release files / rampgate_nvml-0.2.0.tar.gz
| Download URL | rampgate_nvml-0.2.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ae282d3f59363cb12b6e61222f785fcfd25e8591e3a78facc25bc0e6a5306ea
|
|
BLAKE2b-256 checksum How to use checksums |
399db1154d13347b8bc05da3cf7f13885c646655afe4a897a3385f4cffa97a1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / rampgate_nvml-0.2.0-py3-none-any.whl
| Download URL | rampgate_nvml-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
844ee15ce14ec182b80e652e05fcee90e5f8be2efc798ab51267f36b632209f0
|
|
BLAKE2b-256 checksum How to use checksums |
6538a54b9caf2cc75f740fa9e9f94538af7a3d4eb9ec8eec0198a08b47ec54a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logSecurity for rampgate-nvml 0.2.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for rampgate_nvml-0.2.0.tar.gz
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 Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.