Skip to main content

rampgate-nvml

NVIDIA GPU probe for rampgate (NVML), with process-to-container mapping.

Part of the rampgate monorepo.

from rampgate_nvml import NvmlProbe, pid_to_container_id

with NvmlProbe({0: "gpu0"}, unit="MiB") as probe:
    for device in probe.devices():            # capacity: total GPU memory
        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
  • DeviceObserved.used_total is NVML's used, which includes the driver's own share and every process, managed or not. rampgate treats what it cannot attribute to a managed job as foreign usage.
  • pid_to_container_id understands cgroup v1 and v2 paths of docker (systemd and cgroupfs drivers), containerd, CRI-O and podman. Paths relative to a private cgroup namespace (0::/../docker-<id>.scope) work too.
  • 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).

Metadata

Release files for rampgate-nvml 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rampgate-nvml 0.1.0
File Size Uploaded Provenance Actions
rampgate_nvml-0.1.0.tar.gz 11.5 kB With provenance Details for rampgate_nvml-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rampgate-nvml 0.1.0
File Interpreter ABI Platform Actions
rampgate_nvml-0.1.0-py3-none-any.whl Python 3 none any Details for rampgate_nvml-0.1.0-py3-none-any.whl

Total release size: 20.9 kB

Release files / rampgate_nvml-0.1.0.tar.gz

Download URL rampgate_nvml-0.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
49038877ea9ed5deeae591bcfff10ecaef77cc562993a9db3cafdbae14a92f82
BLAKE2b-256 checksum
How to use checksums
b5075407810d4ca480caa575829badd132c2cd8d0d2ebbf9cbb58b635701afd0
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 Oct 30, 2026.

Transparency log

Release files / rampgate_nvml-0.1.0-py3-none-any.whl

Download URL rampgate_nvml-0.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
175501231a43a70a5ca412d2a7400765c246e41470f539652fc27ada9af59d7b
BLAKE2b-256 checksum
How to use checksums
a569c003497d0823b8f9501cf874513d4f40e2d0fc56524201d23f9b2e8ce209
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 Oct 30, 2026.

Transparency log

Security for rampgate-nvml 0.1.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.

Select from 2 files

Attestation for rampgate_nvml-0.1.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 Oct 30, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page