GPU Usage Monitoring for Shared Clusters: Matching Running Workloads to Approved Tenants and Projects
Shared clusters need GPU usage monitoring that ties each running process to an approved tenant, the team or customer that pays for its share of the cluster.
The audit matches what each GPU ran against the scheduler's record of who owns each job, using node, the GPU's permanent ID (UUID) and time window as the key.
The join produces two lists:
- Match list: each process with its tenant, project and user.
- Leftover list: each process or scheduler charge without a counterpart, sorted into one of three classes.
Accounting to Switch On Before the GPU Monitoring Window
GPU accounting records begin when an administrator switches accounting on, so an audit can't look back past that date. Switch on scheduler and GPU accounting before the audit window opens, so the join doesn't report gaps caused by missing settings.
Slurm, an open-source job scheduler, needs two settings in its slurm.conf file:
- Accounting storage:
AccountingStorageTypesends job records to slurmdbd, Slurm's accounting database, andJobAcctGatherTyperecords usage inside each job. - GPU fields: Slurm tracks GPUs as a generic resource (GRES). Adding
gres/gputoAccountingStorageTRESalso turns on per-job GPU memory (gres/gpumem) and GPU utilization (gres/gpuutil) figures. Those two figures needAutoDetect=nvmlin gres.conf on NVIDIA GPUs.
GPU-side setup depends on which tool captures the processes:
- nvidia-smi: switch on accounting mode (
nvidia-smi -am 1) on each GPU ahead of the audit window. - DCGM: run
dcgmi stats --enablefor the GPU group before the workload starts, because NVIDIA Data Center GPU Manager (DCGM) can't rebuild statistics for a period before the switch-on. - DCGM Exporter: this tool publishes DCGM metrics on Kubernetes, the container orchestration platform. Run it on each GPU node with pod mapping (
--kubernetes) switched on from the first day of the window.
A cluster without these settings has to start with live capture and audit forward from the switch-on date.

Step 1: Write the Approved-Tenant List for GPU Usage in Scheduler Terms
The approved-tenant list names each tenant the cluster has approved, using the same account and namespace names the scheduler uses. It turns the tenant rules of an AI governance framework into names the audit can check against scheduler records.
Build one entry per tenant with four fields:
- Account or namespace: the Slurm account or Kubernetes namespace that holds the tenant's jobs. Kubernetes lacks a built-in tenant object, so on a cluster shared by teams, each team's namespace usually serves as the tenant key.
- Charge target: the project, allocation code or cost center that carries the tenant's usage.
- User names: each user's scheduler login name.
- Approval record: the ticket, contract or governance decision that approved the tenant and its projects.
Keep entries without an approval record on a separate pending list, so the audit doesn't count an unapproved tenant as a match. Step 1 is done when each tenant on the cluster appears once, spelled exactly as in the scheduler's records.
Step 2: Export the Scheduler's GPU Ownership Record
The scheduler logs who held which GPU, under which account or namespace, at what time.
On Slurm, export the associations, Slurm's records that link each user to an account, cluster and partition, with sacctmgr.
Then export the window's job records with sacct. Save the cluster's AccountingStorageEnforce value with them, since it sets how strictly Slurm checks each job against its association.
On Kubernetes, export the window's pod list with each pod's namespace and node, plus each namespace's quota objects. A namespace resource quota caps GPU requests through items with the requests. prefix, such as requests.nvidia.com/gpu, because Kubernetes doesn't allow overcommit for extended resources such as GPUs.
Check that each job or pod in the window carries its account or namespace and its user, and that the export timestamps cover the audit window.
Step 3: Capture GPU Processes With a Stable Device Key
GPU tools report processes, so the owner has to come from the scheduler record.
The HCC cluster guide at the University of Nebraska–Lincoln notes that nvidia-smi, NVIDIA's command-line GPU tool, reports a process ID (PID) for each GPU job. For a node running several jobs, the guide uses top to match each PID to a job, because top shows the user behind each process.
Export the nvidia-smi accounted-process list on each node before its accounting buffer fills. The nvidia-smi documentation says newer processes overwrite the oldest entries once the buffer reaches its size, shown per GPU as Accounting Mode Buffer Size.
Identify each GPU by UUID or PCI bus ID, its address on the server's PCIe bus, because NVIDIA's documentation says device order can change between reboots.
Use DCGM job statistics when a PID can't be traced to a job. Call dcgmi stats --jstart with the job ID and GPU group from Slurm's Prolog, the script that runs before each job.
Call dcgmi stats --jstop from the Epilog, which runs after the job. DCGM's job statistics documentation says dcgmi stats --job then reports activity summed across the PIDs and GPUs seen between the two calls.
On Kubernetes, read DCGM Exporter metrics per pod in each namespace, with --kubernetes set so the exporter maps metrics to pods. Multi-Instance GPU (MIG) splits one GPU into isolated instances, so join records for those GPUs per instance.
Before moving on, confirm each node's export lists a UUID per GPU, a PID per accounted process and a timestamp inside the window.
Step 4: Join Both Records for GPU Usage Attribution
Join the records on node, GPU UUID and time window, using the UUID because it stays fixed when a reboot renumbers the GPUs.

| Stack | Ownership record | GPU record | Join key |
|---|---|---|---|
| Slurm | sacct job records with account, user and allocation | nvidia-smi accounted processes or DCGM job statistics | Node, GPU UUID and time window |
| Kubernetes | Pods by namespace and node, with namespace quotas | DCGM Exporter metrics with pod mapping on | Namespace, node, GPU UUID and time window |
The join runs three checks, the first two in opposite directions:
- GPU to scheduler: each accounted process needs a scheduler record that names an approved tenant and project.
- Scheduler to GPU: each allocation needs GPU activity in the same window.
- Ownership quality: a scheduler record whose account or namespace sits off the approved-tenant list counts as a leftover until it has an approval record.
For example, suppose the capture shows a training process running for eleven hours on node-a, on the GPU whose UUID ends in 4f2a. If the sacct export for that window lacks a job on that GPU, the process fails the first check.
In the other direction, suppose sacct shows a tenant's job holding one GPU for twenty-four hours. If the capture for that UUID lacks an accounted process in the window, the allocation fails the second check.

Slurm sharding and NVIDIA's Multi-Process Service (MPS) let several jobs share one GPU at the same time. On such a GPU, node, UUID and window can point at several jobs, so attribution works per window, splitting the GPU's usage across those jobs.
Each accounted process and each allocation should end up on one of the two lists: the match list with its tenant, project and user, or the leftover list.
GPU Monitoring Blind Spots to Rule Out Before Trusting a Match
Work through these gaps before classifying leftovers, because each can produce a false match or a false leftover:
- MIG and Slurm GPU fields: Slurm's GRES documentation says Slurm doesn't record
gres/gpumemorgres/gpuutilfor MIG devices. Check MIG jobs against the GPU-side capture before putting a MIG job on either list. - MIG utilization queries: the nvidia-smi documentation lists utilization queries as unsupported on MIG-enabled GPUs. Treat an empty utilization field there as a missing measurement before adding the GPU to the idle count.
- Prolog and job device indexes: Slurm runs Prolog and Epilog outside the job's cgroup, the Linux control group that limits the job to its devices. They can see a different
CUDA_VISIBLE_DEVICESvalue from the job, so key each Prolog-stage DCGM call to the GPU UUID. - GPU accounting switch: check that
JobAcctGatherParamsleaves outDisableGPUAcct, which turns off GPU usage accounting, before trusting a job record that lacks GPU figures. - vGPU hosts: the
--query-accounted-appsquery doesn't work on a vGPU host, a server that splits GPUs across virtual machines, so the nvidia-smi route misses those hosts. List the vGPU hosts, record which capture route covers each one, and keep their empty process lists out of the idle count. - nvidia-smi buffer size: count the processes a busy GPU starts between exports, and shorten the export interval where that count nears the Accounting Mode Buffer Size.
- DCGM retention: DCGM's
--max-keep-agesetting has to exceed the job's length plus Prolog, Epilog and reporting delay. The command-line default of 3,600 seconds falls short for a training job longer than an hour. - Index order after reboots: record each node's UUID-to-index mapping after each boot and compare it with the previous boot. Key both capture runs by UUID or PCI bus ID before comparing their process lists.
Step 5: Classify Unmatched GPU Usage and Keep the Record
Each leftover belongs to one of three classes:
- GPU activity without a scheduler record: a process used a GPU that the scheduler records show as free at that time.
- Scheduler allocation without GPU activity: the tenant held an allocation, and the capture lacks an accounted process on that GPU. The blind-spot list decides whether the GPU sat unused or the capture missed the process.
- Owner off the approved list: both records exist and match, and the account or namespace lacks an approval record or sits on the pending list.
Under allocation-time billing, a tenant pays for an assigned GPU whether or not a job runs, so the second class shows hours paid for without GPU use. Check those hours before the period's cost allocation.

Keep four files from each run:
- Match list: process ID, GPU UUID, node, timestamps, tenant, project and user for each match.
- Leftover list: the class and both keys for each leftover.
- Raw exports: the unchanged scheduler export and GPU-side capture.
- Approved-tenant list: the version in force during the window.
Another administrator needs those fields to rerun the attribution.
Plan retention when setting up accounting. Under slurmdbd.conf, the Purge*After settings delete records by age, and the matching Archive settings save them to files before the purge.
The sacctmgr documentation says Slurm marks a deleted account or user with job history as deleted and keeps the record. A deleted association's usage also moves to its parent account in Slurm 22.05 and later (SchedMD ticket 13828), which can shift a tenant's fair-share figures.
Because Slurm's own figures can change later, the retained audit files become the lasting record of what ran in the window. Step 5 ends with one class on each leftover and the four files saved for the run.
End-to-End Checks for the GPU Usage Audit
Close the audit with six checks against the cluster:
- Coverage: each GPU on each node appears in the capture by UUID. Compare the nodes in the capture with the nodes in the scheduler export, and rerun the capture on a missing node.
- Idle GPUs: idle GPUs appear in the capture too, so an absent GPU points to a capture failure. Trace it to the node's accounting mode or exporter setting before classifying its allocations.
- Leftover classes: each leftover carries one class. A leftover that fits two classes goes back through the blind-spot list.
- Match ownership: each match takes its tenant and project from one approved-tenant entry with an approval record. Its account or namespace, charge target and user name agree with that entry.
- Capture window: the GPU export's first and last timestamps bracket the same span as the scheduler export.
- Reproduction: another administrator reruns the attribution from the retained files with the same join key and window, and gets the same match and leftover lists.
zPLATFORM turns GPU capacity into a service with built-in metering, billing and tenant controls. Its Integrated Observability feature combines identity management, usage tracking and system monitoring.
