1. What DCGM Is
DCGM (Data Center GPU Manager) is a toolset NVIDIA provides for managing and monitoring GPUs in the data center. It offers the following capabilities:
- GPU behavior monitoring
- GPU configuration management
- GPU policy supervision
- GPU health and diagnostics
- GPU accounting and process statistics
- NVSwitch configuration and monitoring
2. Installing DCGM
2.1 Installing libnvidia-nscq
GPUs are generally connected over NVLink. You can run nvidia-smi topo -m and check whether the output contains the word NVSwitch to decide whether this needs to be installed.
- If NvSwitch is present, related information may fail to be queried
The error looks like this:
| |
- Check the NVIDIA driver version
| |
- Install the matching version of libnvidia-nscq
| |
2.2 Installing DCGM
- Add the repository
Ubuntu 20.04
| |
Ubuntu 22.04
| |
- Install DCGM
| |
- Start the DCGM service
| |
You can also enable it to start on boot
| |
3. Command-Line Help
| |
4. Device Management
4.1 discovery: Viewing GPUs
| |
| |
4.2 topo: Viewing GPU Topology
| |
| |
You can see that GPU 0 is connected to the other GPUs over NVLink.
4.3 nvlink: Viewing Link Status and Error Counts
| |
| |
Each card has 18 NVLink links, and every link is Up.
5. Organization and Structure Management
5.1 group: Managing Groups
Groups let you group GPUs together, which makes them easier to monitor and manage.
- Create a group
| |
If you restart the DCGM service, the group is lost.
- List groups
| |
| |
- Add GPUs to a group
Here GPU 0 and GPU 1 are added to the production group.
| |
- View group information
| |
| |
5.2 fieldgroup: Managing Field Groups
fieldgroup creates and maintains field groups. A field group is a collection of metrics used for monitoring and statistics; each field is one metric.
- List field groups
| |
| |
- Create a field group
| |
Listing the groups again, you can see the newly created field group.
| |
6. Monitoring and Statistics
When monitoring and collecting statistics, you can specify a GPU card or a group, and the metrics can be selected either by ID or by field group.
6.1 profile: Performance Metrics
profile provides collection and querying of performance metrics, and must be used together with the dmon and stats commands to view the data.
- View performance-related metrics
| |
| |
- View the metrics available for a group or a specific GPU
| |
- Pause and resume collection
This is mainly for nvprof, nsight compute, and nsight systems developers.
6.2 dmon: Real-Time Statistics Monitoring
- View the available metric IDs
| |
- Specify a card group and metric IDs
| |
| |
- Specify a card group and a metric group
| |
| |
- Specify a card directly and view a metric
| |
| |
6.3 stats: Process Statistics
- Start collection
| |
- View statistics for a process
| |
- View statistics for all processes
| |
- Stop collection
| |
7. Health and Diagnostics
7.1 health: Health Monitoring
- View the health monitoring items
| |
| |
- Enable all monitoring
| |
With dcgmi health -g 2 --clear
- Check the DCGM service status
| |
| |
When it is empty, the health status is good.
7.2 diag: Diagnosing Faults
It mainly provides the following diagnostic capabilities:
- Environmental integrity of the NVML library, CUDA library, etc.
- User access permissions to GPU devices
- Driver or process conflicts
- Status of hardware components such as GPU memory and InfoROM
- Configuration such as persistence mode and environment variables
| |
| |
The -r here has four levels, where 1-4 correspond to different test coverage:
| Plugin | Test Name | r1 (short) sec | r2 (medium) < 2 min | r3 (long) < 30 min | r4 (extra long) 1-2 hours |
|---|---|---|---|---|---|
| Software | software | yes | yes | yes | yes |
| PCIe + NVLink | pcie | yes | yes | yes | |
| GPU Memory | memory | yes | yes | yes | |
| Memory Bandwidth | memory_bandwidth | yes | yes | yes | |
| Diagnostic | diagnostic | yes | yes | ||
| Targeted Stress | targeted_stress | yes | yes | ||
| Targeted Power | targeted_power | yes | yes | ||
| NVB Bandwidth | nvbandwidth | yes | yes | ||
| Memory Stress Test | memtest | yes | |||
| Input EDPp | pulse | yes |
During diagnostics, if the cards are under load, some Warning alerts may be printed.
8. System Management
8.1 config: Configuration Management
- View the configuration
| |
| |
- Set the configuration
Limit the power to 499 W
| |
Apply the configuration
| |
- View the configuration
| |
| |
8.2 policy: Policy Management
Policies define the actions triggered when a particular event occurs, which allows automatic handling of anomalies.
- View the policy list
| |
| |
| Field | Meaning |
|---|---|
| Violation conditions | None → no violation trigger conditions are set (for example, temperature, power, and ECC errors are all unset) |
| Isolation mode | Automatic → the isolation mode is automatic; when a GPU has a problem, DCGM decides on its own whether to isolate it (the specific action still depends on whether a policy is set) |
| Action on violation | None → no action is taken on violation (for example, the GPU is not reset and the machine is not shut down) |
| Validation after action | None → no system validation is performed after the violation action (for example, a temperature or performance test) |
| Validation failure action | None → no action is taken when validation fails either |
With the default configuration, DCGM does not perform any action on the GPUs.
- Add a policy
The available action values are 0 - take no action; 1 - reset the GPU;
Validation runs after the action: 0 - no validation; 1 - check the basic health of the GPU core and memory; 2 - comprehensive memory and core check; 3 - comprehensive hardware check.
Actions and validations come in pairs. For example, 0,0 means take no action and no validation; 1,2 means reset the GPU and run a comprehensive memory and core check.
| |
When the GPU temperature exceeds 100 degrees, DCGM executes the 1,2 policy.
The optional trigger conditions are -e ECC double-bit errors, -x xid errors, -p PCIe replay errors, -n NVLink errors, -T temperature, and -P power.
- View the policy
| |
At this point you can see that the policy for GPU 0 in group 2 has been set to: when the temperature exceeds 100 degrees, reset the GPU and run a medium validation.
8.3 modules: Viewing Loaded Modules
| |
| |
| Module Name | Purpose |
|---|---|
| Core | GPU discovery and enumeration, basic API interface, foundation for metric data collection, dependency base for other modules |
| NvSwitch | Monitor NVSwitch status and performance, manage multi-GPU high-speed interconnect, DGX/HGX system support |
| VGPU | Monitor vGPU instance resources, manage virtual GPU configuration, collect performance data for virtualized environments |
| Introspection | DCGM internal state inspection, debugging and troubleshooting, module interaction state monitoring |
| Health | GPU temperature, power, and fan monitoring, hardware anomaly detection, health report alerts, predictive maintenance |
| Policy | GPU usage policy setting and enforcement, power and performance limit management, resource quota and access control |
| Config | GPU configuration parameter management, configuration change application and validation, configuration backup and restore, bulk configuration |
| Diag | GPU hardware test execution, memory and compute unit testing, diagnostic report generation, fault localization |
| Profiling | GPU performance metric collection, application performance analysis, PCIe bandwidth monitoring, NVIDIA event metrics |
| SysMon | CPU, memory, and network monitoring, system-GPU correlation monitoring, full-stack performance analysis, system metric collection |
Some modules can be dynamically loaded and unloaded on demand. For example, running the dcgmi diag command automatically loads the Diag module.
8.4 introspect: Viewing DCGM Process Resource Usage
| |
| |
You can see the memory usage and CPU utilization of the Hostengine process.
