NVIDIA / NVIDIA/DCGM

Cannot Retrieve GPU PIDs from DCGM Metrics

Open
#175 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
792
Forks
109
PR merge metrics
No merged PRs in 30d

Description

Ask your question

Hi, I'm using NVIDIA GPU Operator to expose GPUs on my OpenShift cluster, and trying to create a PromQL aggregation to correlate GPU PIDs (Process ID) to K8s Pods.

From the exported DCGM metrics, I saw no metric with a label representing GPU PID.
In the DCGM release notes, the following is mentioned:

The following features have been dropped or deprecated starting with DCGM 3.0:
The following field identifiers have been removed:
DCGM_FI_DEV_GRAPHICS_PIDS
DCGM_FI_DEV_COMPUTE_PIDS
...

My question - is there a way to retrieve this info in the current version?
I originally submitted this issue to the DCGM Exporter GitHub repo.

The workaround I've implemented for the time being is running a custom DaemonSet on all GPU nodes, running the following command to correlate GPU PID and Pod UID, and using this as a custom metric:

$ nvidia-smi --query-compute-apps=pid --format=csv,noheader | xargs -I{} sh -c "echo -n '{}'; echo -n ','; grep -oPm1 '[0-9a-f]{8}(_[0-9a-f]{4}){3}_[0-9a-f]{12}' /proc/{}/cgroup | sed 's/_/-/g'" 
114855,c8b8d8a2-5e73-4c1a-b8e3-735e8a4e56d3
115044,1f7d9c8e-4a4b-455b-9b0d-9a2d1f4e6c2f

NOTE: It requires setting hostPid: true in the Pod spec.

Versions:
OpenShift: v4.12.35
Kubernetes: v1.25.12+ba5cc25
NVIDIA GPU Operator: v23.3.2
DCGM Exporter: v3.1.7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DCGM 3.0 release notes and the removed DCGM_FI_DEV_GRAPHICS_PIDS and DCGM_FI_DEV_COMPUTE_PIDS fields, then compare the related DCGM Exporter issue. Determine whether the current DCGM version exposes an alternative path for correlating GPU PIDs to pods; done means documenting or identifying a supported retrieval method.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.