Metric Exporter 설치
AI Insight를 사용하려면 대상 환경에 Metric Exporter 또는 모니터링 에이전트를 설치해야 합니다. 설치하지 않으면 해당 리소스가 Agent Missing 상태로 표시될 수 있으며, GPU 사용률, 메모리 사용률, 온도, 유휴율, ECC Error 등 주요 메트릭이 수집되지 않습니다.
AI Insight는 GPU 지표를 수집하기 위해 DCGM Exporter를 사용합니다. 메트릭 수집 구성과 사전 작업은 Kubernetes Engine, Virtual Machine 등 대상 환경에 따라 다르므로, 환경에 맞는 항목을 확인한 후 설치를 진행합니다.
설치 후 AI Insight 화면에 실제 데이터가 표시되기까지 시간이 소요될 수 있습니다.
사전 작업
설치 전 대상 환경에 따라 다음 항목을 준비합니다. 사전 작업은 설치 명령을 실행하기 위한 접근 권한, 실행 도구, 파일, 대상 리소스 준비 상태를 의미합니다.
| 환경 | 사전 작업 |
|---|---|
| Kubernetes Engine | - kubectl로 대상 클러스터에 접근 가능- Helm 설치 - GPU 노드 준비 - dcgm-exporter-metrics.csv 파일 준비 |
| Virtual Machine | - NVIDIA GPU가 장착된 VM 준비 - Ubuntu 22.04 x86_64 환경 - 관리자 권한 - 외부 패키지를 다운로드할 수 있는 네트워크 환경 |
Kubernetes Engine에서 사용하는 dcgm-exporter-metrics.csv 파일은 GPU Operator 설치 명령을 실행하는 현재 디렉터리에 있어야 합니다.
설치 방법
대상 환경에 맞는 탭을 선택하여 메트릭 수집 구성 요소를 설치합니다.
- Kubernetes Engine
- Virtual Machine
Kubernetes Engine
Kubernetes Engine 환경에서는 NVIDIA GPU Operator를 설치하여 DCGM Exporter를 구성합니다. 이 가이드에서는 이를 Metric Exporter 설치로 설명합니다.
1. Helm Repository 추가
다음 명령어를 실행하여 NVIDIA Helm Repository를 추가하고 업데이트합니다.
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update
2. GPU Operator 설치 옵션 확인
GPU Operator 설치 명령에 입력할 driver.enabled와 mig.strategy 값을 확인합니다. 이 항목은 설치 전 준비물이 아니라, helm install 명령을 실행할 때 선택하는 설치 옵션입니다.
| 옵션 | 값 | 설명 |
|---|---|---|
driver.enabled | true | GPU Operator가 드라이버를 설치 및 관리합니다. 기본값입니다. |
driver.enabled | false | 드라이버가 노드에 사전 설치된 경우 사용합니다. |
mig.strategy | none | MIG를 비활성화하고 GPU를 통째로 사용합니다. 기본값입니다. |
mig.strategy | single | 모든 GPU에 동일한 MIG 프로파일을 적용합니다. |
mig.strategy | mixed | GPU마다 다른 MIG 프로파일을 적용할 수 있습니다. |
MIG를 사용하지 않는 경우 --set mig.strategy=none으로 설정합니다. MIG를 사용하는 환경에서는 운영 정책에 따라 single 또는 mixed를 선택합니다.
3. GPU Operator 설치
다음 명령어의 driver.enabled와 mig.strategy 값을 대상 환경에 맞게 변경한 후 GPU Operator를 설치합니다.
helm install gpu-operator nvidia/gpu-operator \
--namespace gpu-operator \
--create-namespace \
--version v25.10.0 \
--set driver.enabled=<true|false> \
--set mig.strategy=<none|single|mixed> \
--set dcgmExporter.config.name=custom-dcgm-exporter-metrics \
--set dcgmExporter.config.create=true \
--set-file dcgmExporter.config.data=./dcgm-exporter-metrics.csv \
--wait
<true|false>와 <none|single|mixed>는 예시 표기입니다. 실제 명령을 실행할 때는 괄호를 포함한 예시 표기를 제거하고 하나의 값만 입력합니다.
4. DCGM Exporter hostNetwork 설정
GPU Operator 설치 후, DCGM Exporter에 hostNetwork와 dnsPolicy를 적용하기 위해 다음 패치 명령어를 순서대로 실행합니다.
4-1. ClusterPolicy 패치
kubectl patch clusterpolicy cluster-policy \
-n gpu-operator \
--type=merge \
-p '{
"spec": {
"dcgmExporter": {
"hostNetwork": true,
"dnsPolicy": "ClusterFirstWithHostNet"
}
}
}'
4-2. DaemonSet 패치
kubectl patch daemonset nvidia-dcgm-exporter \
-n gpu-operator \
--type=merge \
-p '{
"spec": {
"template": {
"spec": {
"hostNetwork": true,
"dnsPolicy": "ClusterFirstWithHostNet"
}
}
}
}'
5. 설치 확인
다음 명령어를 실행하여 GPU Operator와 DCGM Exporter가 정상적으로 설치되었는지 확인합니다.
kubectl get pods -n gpu-operator
kubectl get pod -n gpu-operator -l app=nvidia-dcgm-exporter -o yaml | grep -E "hostNetwork|dnsPolicy"
kubectl describe node GPU_NODE_NAME | grep nvidia.com/gpu
| 확인 항목 | 정상 기준 |
|---|---|
| Pod 상태 | gpu-operator 네임스페이스의 Pod가 Running 상태 |
| hostNetwork | hostNetwork: true 표시 |
| dnsPolicy | dnsPolicy: ClusterFirstWithHostNet 표시 |
| GPU 리소스 | 노드 설명에서 nvidia.com/gpu 리소스 확인 |
Virtual Machine
Virtual Machine 환경에서는 DCGM, DCGM Exporter, 모니터링 에이전트를 설치하고, 모니터링 에이전트가 DCGM Exporter에서 노출하는 Prometheus 형식의 GPU 메트릭을 수집하도록 설정합니다.
아래 명령어는 Ubuntu 22.04 x86_64 환경 기준입니다. 운영체제 또는 이미지에 따라 패키지 경로나 설치 명령이 다를 수 있습니다.
1. DCGM 설치
NVIDIA CUDA 저장소 Keyring을 등록한 후 DCGM 패키지를 설치합니다.
# NVIDIA CUDA Keyring(GPG 인증키 및 저장소 주소) 다운로드
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
# Keyring 설치
sudo dpkg -i cuda-keyring_1.1-1_all.deb
# DCGM 설치 진행
sudo apt-get update
sudo apt-get install -y datacenter-gpu-manager-4-cuda12=1:4.4.1-1 \
datacenter-gpu-manager-4-core=1:4.4.1-1 \
datacenter-gpu-manager-4-proprietary=1:4.4.1-1
sudo apt-mark hold datacenter-gpu-manager-4-cuda12 \
datacenter-gpu-manager-4-core \
datacenter-gpu-manager-4-proprietary
2. DCGM 서비스 활성화
DCGM 서비스를 활성화하고, VM에서 GPU가 인식되는지 확인합니다.
sudo systemctl daemon-reload
sudo systemctl enable --now nvidia-dcgm
# 확인
sudo systemctl status nvidia-dcgm
sudo dcgmi discovery -l
3. DCGM Exporter 설치
DCGM Exporter를 빌드하기 위해 필요한 패키지를 설치합니다.
sudo snap install go --classic
sudo apt-get install -y git make
DCGM Exporter 소스 코드를 내려받고, DCGM Exporter가 노출할 메트릭 정의 파일을 생성합니다.
git clone https://github.com/NVIDIA/dcgm-exporter.git
cd dcgm-exporter
git checkout 4.4.1-4.6.0
cat <<'EOF' > etc/default-counters.csv
# Format
# If line starts with a '#' it is considered a comment
# DCGM FIELD, Prometheus metric type, help message
# Clocks
DCGM_FI_DEV_SM_CLOCK, gauge, SM clock frequency (in MHz).
DCGM_FI_DEV_MEM_CLOCK, gauge, Memory clock frequency (in MHz).
# Temperature
DCGM_FI_DEV_MEMORY_TEMP, gauge, Memory temperature (in C).
DCGM_FI_DEV_GPU_TEMP, gauge, GPU temperature (in C).
# Power
DCGM_FI_DEV_POWER_USAGE, gauge, Power draw (in W).
DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION, counter, Total energy consumption since boot (in mJ).
# PCIE
# DCGM_FI_PROF_PCIE_TX_BYTES, counter, Total number of bytes transmitted through PCIe TX via NVML.
# DCGM_FI_PROF_PCIE_RX_BYTES, counter, Total number of bytes received through PCIe RX via NVML.
DCGM_FI_DEV_PCIE_REPLAY_COUNTER, counter, Total number of PCIe retries.
# Utilization (the sample period varies depending on the product)
DCGM_FI_DEV_GPU_UTIL, gauge, GPU utilization (in %).
DCGM_FI_DEV_MEM_COPY_UTIL, gauge, Memory utilization (in %).
# DCGM_FI_DEV_ENC_UTIL, gauge, Encoder utilization (in %).
# DCGM_FI_DEV_DEC_UTIL , gauge, Decoder utilization (in %).
# Errors and violations
DCGM_FI_DEV_XID_ERRORS, gauge, Value of the last XID error encountered.
DCGM_FI_DEV_POWER_VIOLATION, counter, Throttling duration due to power constraints (in us).
DCGM_FI_DEV_THERMAL_VIOLATION, counter, Throttling duration due to thermal constraints (in us).
DCGM_FI_DEV_SYNC_BOOST_VIOLATION, counter, Throttling duration due to sync-boost constraints (in us).
DCGM_FI_DEV_BOARD_LIMIT_VIOLATION, counter, Throttling duration due to board limit constraints (in us).
DCGM_FI_DEV_LOW_UTIL_VIOLATION, counter, Throttling duration due to low utilization (in us).
DCGM_FI_DEV_RELIABILITY_VIOLATION, counter, Throttling duration due to reliability constraints (in us).
# DCGM Exporter fields
# DCGM_EXP_CLOCK_EVENTS_COUNT, counter, reported clock events
# DCGM_EXP_XID_ERRORS_COUNT, counter, reported XIDs during last window
# DCGM_EXP_GPU_HEALTH_STATUS, counter, DCGM reported health status
# DCGM_EXP_P2P_STATUS, counter, P2P NvLink status
# Memory usage
DCGM_FI_DEV_FB_FREE, gauge, Framebuffer memory free (in MiB).
DCGM_FI_DEV_FB_USED, gauge, Framebuffer memory used (in MiB).
# DCGM_FI_DEV_FB_RESERVED, gauge, Framebuffer memory reserved (in MiB).
# ECC
DCGM_FI_DEV_ECC_SBE_VOL_TOTAL, counter, Total number of single-bit volatile ECC errors.
DCGM_FI_DEV_ECC_DBE_VOL_TOTAL, counter, Total number of double-bit volatile ECC errors.
DCGM_FI_DEV_ECC_SBE_AGG_TOTAL, counter, Total number of single-bit persistent ECC errors.
DCGM_FI_DEV_ECC_DBE_AGG_TOTAL, counter, Total number of double-bit persistent ECC errors.
# Retired pages
# DCGM_FI_DEV_RETIRED_SBE, counter, Total number of retired pages due to single-bit errors.
# DCGM_FI_DEV_RETIRED_DBE, counter, Total number of retired pages due to double-bit errors.
# DCGM_FI_DEV_RETIRED_PENDING, counter, Total number of pages pending retirement.
# NVLink
# DCGM_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_TOTAL, counter, Total number of NVLink flow-control CRC errors.
# DCGM_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_TOTAL, counter, Total number of NVLink data CRC errors.
# DCGM_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_TOTAL, counter, Total number of NVLink retries.
# DCGM_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_TOTAL, counter, Total number of NVLink recovery errors.
DCGM_FI_DEV_NVLINK_BANDWIDTH_TOTAL, counter, Total number of NVLink bandwidth counters for all lanes.
# DCGM_FI_DEV_NVLINK_BANDWIDTH_L0, counter, The number of bytes of active NVLink rx or tx data including both header and payload.
# VGPU License status
# DCGM_FI_DEV_VGPU_LICENSE_STATUS, gauge, vGPU License status
# Remapped rows
# DCGM_FI_DEV_UNCORRECTABLE_REMAPPED_ROWS, counter, Number of remapped rows for uncorrectable errors
# DCGM_FI_DEV_CORRECTABLE_REMAPPED_ROWS, counter, Number of remapped rows for correctable errors
# DCGM_FI_DEV_ROW_REMAP_FAILURE, gauge, Whether remapping of rows has failed
# Static configuration information. These appear as labels on the other metrics
# DCGM_FI_DRIVER_VERSION, label, Driver Version
# DCGM_FI_NVML_VERSION, label, NVML Version
DCGM_FI_DEV_BRAND, label, Device Brand
DCGM_FI_DEV_SERIAL, label, Device Serial Number
# DCGM_FI_DEV_OEM_INFOROM_VER, label, OEM inforom version
# DCGM_FI_DEV_ECC_INFOROM_VER, label, ECC inforom version
# DCGM_FI_DEV_POWER_INFOROM_VER, label, Power management object inforom version
# DCGM_FI_DEV_INFOROM_IMAGE_VER, label, Inforom image version
DCGM_FI_DEV_VBIOS_VERSION, label, VBIOS version of the device
# Datacenter Profiling (DCP) metrics
# NOTE: supported on Nvidia datacenter Volta GPUs and newer
DCGM_FI_PROF_GR_ENGINE_ACTIVE, gauge, Ratio of time the graphics engine is active.
DCGM_FI_PROF_SM_ACTIVE, gauge, The ratio of cycles an SM has at least 1 warp assigned.
DCGM_FI_PROF_SM_OCCUPANCY, gauge, The ratio of number of warps resident on an SM.
DCGM_FI_PROF_PIPE_TENSOR_ACTIVE, gauge, Ratio of cycles the tensor (HMMA) pipe is active.
DCGM_FI_PROF_DRAM_ACTIVE, gauge, Ratio of cycles the device memory interface is active sending or receiving data.
# DCGM_FI_PROF_PIPE_FP64_ACTIVE, gauge, Ratio of cycles the fp64 pipes are active.
# DCGM_FI_PROF_PIPE_FP32_ACTIVE, gauge, Ratio of cycles the fp32 pipes are active.
# DCGM_FI_PROF_PIPE_FP16_ACTIVE, gauge, Ratio of cycles the fp16 pipes are active.
# DCGM_FI_PROF_PCIE_TX_BYTES, gauge, The rate of data transmitted over the PCIe bus - including both protocol headers and data payloads - in bytes per second.
# DCGM_FI_PROF_PCIE_RX_BYTES, gauge, The rate of data received over the PCIe bus - including both protocol headers and data payloads - in bytes per second.
EOF
DCGM Exporter를 빌드하고 설치합니다.
make binary
sudo make install
DCGM Exporter를 systemd 서비스로 등록합니다.
sudo tee /etc/systemd/system/dcgm-exporter.service <<'EOF'
[Unit]
Description=NVIDIA DCGM Exporter
After=nvidia-dcgm.service
Requires=nvidia-dcgm.service
[Service]
Type=simple
ExecStart=/usr/bin/dcgm-exporter
Restart=always
[Install]
WantedBy=multi-user.target
EOF
DCGM Exporter 서비스를 활성화하고 메트릭 노출 여부를 확인합니다.
sudo systemctl daemon-reload
sudo systemctl enable --now dcgm-exporter
# 확인
sudo systemctl status dcgm-exporter
curl -s http://localhost:9400/metrics | grep -i "DCGM_FI_DEV_GPU_TEMP"
4. 모니터링 에이전트 설치 및 메트릭 수집 설정
모니터링 에이전트를 설치합니다.
wget https://objectstorage.kr-central-2.kakaocloud.com/v1/52867b7dc99d45fb808b5bc874cb5b79/kic-monitoring-agent/package/kic_monitor_agent_1.1.0_amd64.deb
sudo dpkg -i kic_monitor_agent_1.1.0_amd64.deb
sudo systemctl enable kic_monitor_agent
모니터링 에이전트가 DCGM Exporter에서 노출하는 Prometheus 형식의 GPU 메트릭을 수집하도록 설정을 추가합니다.
sudo sed -i '/\[\[inputs\.mem\]\]/i \
[[inputs.prometheus]]\
urls = ["http://localhost:9400/metrics"]\
metric_version = 2\
' /etc/kic_monitor_agent/kic_monitor_agent.conf
모니터링 에이전트를 재시작하고 실행 로그를 확인합니다.
sudo systemctl restart kic_monitor_agent.service
sudo journalctl -u kic_monitor_agent.service -f
5. 설치 확인
다음 항목을 확인하여 DCGM, DCGM Exporter, 모니터링 에이전트가 정상적으로 동작하는지 확인합니다.
| 확인 항목 | 정상 기준 |
|---|---|
| DCGM 서비스 | nvidia-dcgm 서비스가 active 상태 |
| GPU 인식 | sudo dcgmi discovery -l 명령어에서 GPU 정보 표시 |
| DCGM Exporter | dcgm-exporter 서비스가 active 상태 |
| 메트릭 노출 | localhost:9400/metrics에서 DCGM 메트릭 조회 |
| 모니터링 에이전트 | kic_monitor_agent 서비스 로그에서 오류 없이 실행 |
설치 후 데이터가 표시되지 않는 경우
설치 후 AI Insight 화면에 데이터가 표시되지 않거나 Agent Missing 상태가 유지되는 경우 다음 항목을 확인합니다.
| 구분 | 확인 항목 | 설명 |
|---|---|---|
| Kubernetes Engine | Pod 상태 | kubectl get pods -n gpu-operator 명령어로 GPU Operator 관련 Pod 상태 확인 |
| Kubernetes Engine | DCGM Exporter 상태 | nvidia-dcgm-exporter DaemonSet이 정상적으로 실행 중인지 확인 |
| Kubernetes Engine | hostNetwork 설정 | hostNetwork: true, dnsPolicy: ClusterFirstWithHostNet 적용 여부 확인 |
| Kubernetes Engine | GPU 리소스 인식 | GPU 노드 설명에서 nvidia.com/gpu 리소스가 표시되는지 확인 |
| Virtual Machine | DCGM 서비스 상태 | nvidia-dcgm 서비스가 active 상태인지 확인 |
| Virtual Machine | DCGM Exporter 상태 | dcgm-exporter 서비스가 active 상태인지 확인 |
| Virtual Machine | 메트릭 노출 여부 | localhost:9400/metrics에서 DCGM 메트릭이 조회되는지 확인 |
| Virtual Machine | 모니터링 에이전트 상태 | kic_monitor_agent 서비스와 로그 확인 |
| 공통 | 시간 범위 | AI Insight 화면의 시간 범위를 변경하여 조회 |
| 공통 | 새로고침 | 수동 새로고침 또는 자동 새로고침 설정 후 재조회 |
자세한 내용은 문제 해결 문서를 참고하시기 바랍니다.