KJH
GPU Exporter (/w windows) 본문
GPU 메트릭을 상세히 수집하고 모니터링하기 위해 사용하는 Exporter이다.
운영 환경에서는 드라이버 오류나 하드웨어 이슈가 종종 발생한다.
하지만 대부분 소프트웨어 레이어부터 점검하는 경우가 많아, 문제의 본질에 도달하기까지 시간이 지체되는 일이 생긴다.
레이어를 간소화 할 수 있도록 Exporter를 구성해보자.
아래는 nvidia에서 알려주는 상태 enum이다. Exporter를 구성하면 nvidia_smi_command_exit_code로 쿼리 가능하다.
https://developer.download.nvidia.com/compute/DCGM/docs/nvidia-smi-367.38.pdf
0 - 성공 (Success)
2 - 잘못된 인자나 플래그가 전달됨 (Invalid argument or flag)
3 - 요청한 작업이 해당 디바이스에서 지원되지 않음
4 - 현재 사용자가 해당 장치에 접근하거나 작업을 수행할 권한이 없음
6 - 객체를 찾기 위한 쿼리에 실패함
8 - 장치의 외부 전원 케이블이 제대로 연결되지 않음
9 - NVIDIA 드라이버가 로드되지 않음
10 - NVIDIA 커널이 GPU와 관련된 인터럽트 문제를 감지함
12 - NVML 공유 라이브러리를 찾거나 로드할 수 없음
13 - 로컬 NVML 버전이 해당 기능을 구현하지 않음
14 - infoROM이 손상됨
15 - GPU가 버스에서 제거되었거나 접근할 수 없게 됨
255 - 기타 오류 또는 내부 드라이버 오류 발생
# docker compose
version: '3.8'
services:
dcgm-exporter:
image: nvcr.io/nvidia/k8s/dcgm-exporter:3.3.6-3.4.2-ubuntu22.04
container_name: dcgm-exporter
ports:
- 9400:9400
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
추가로 Event Viewer 로그를 수집해서 어디서 crash 났는지 보는 것도 레이어를 간소화 할 수 있다.
- job_name: windows_application_event_log
pipeline_stages:
- json:
expressions:
channel: channel
source: source
computer: computer
event_id: event_id
levelText: levelText
timeCreated: timeCreated
message: message
- labels:
message:
- template:
source: message_template
template: '{{ .timeCreated }} {{ .computer }}/{{ .source }} [{{ .event_id }}] {{ .levelText }} - {{ .message }}'
- output:
source: message_template
encoding: utf-8
windows_events:
use_incoming_timestamp: false
bookmark_path: "./bookmark_application.xml"
eventlog_name: "Application"
xpath_query: '*'
labels:
job: windows_application_event_log
hostname: "$hostname"
아래 링크는 OS단에서 뱉는 event id 목록이다.
https://github.com/PerryvandenHondel/windows-event-id-list-csv/blob/master/windows-event-id.csv
windows-event-id-list-csv/windows-event-id.csv at master · PerryvandenHondel/windows-event-id-list-csv
Windows Event ID list in CSV format. Contribute to PerryvandenHondel/windows-event-id-list-csv development by creating an account on GitHub.
github.com
※ application에서 crash 나는 것은 위 링크의 event 목록에 없으니 모니터링 후 특정 event id의 범위를 수집하는것이 좋다.
'DevOps' 카테고리의 다른 글
ArgoCD App of Apps, Rollout (0) | 2025.05.02 |
---|---|
Jmeter websocket 테스트 (/w nginx) (0) | 2025.04.18 |
Github 특정 Tag를 Fork하기 (0) | 2025.04.16 |
Terraform GitOps(/w Atlantis) (0) | 2025.04.13 |
Nginx Ingress Controller OCSP 설정 (0) | 2025.04.13 |