yeonghoon.kim

  • 게시판
  • 갤러리

GPU 모니터링 대시보드 구축

김영훈 2026.02.11 16:17 조회 수 : 150

DGX GPU 사용률이랑 온도 확인용 대시보드 작업.

SSH로 매번 nvidia-smi 치기 귀찮아서 Prometheus / Grafana에 붙임.

구성.

Main 서버
Prometheus 9090
Grafana 3000

DGX
Node Exporter 9100
GPU Metrics Exporter 9400
nvidia-smi

Node Exporter 실행.

docker run -d \
  --name node-exporter \
  --net host \
  --pid host \
  --userns host \
  -v /proc:/host/proc:ro \
  -v /sys:/host/sys:ro \
  -v /:/rootfs:ro \
  prom/node-exporter:latest \
  --path.procfs=/host/proc \
  --path.rootfs=/rootfs \
  --path.sysfs=/host/sys

DCGM Exporter는 ARM64에서 애매해서 nvidia-smi를 직접 긁는 방식으로 처리.

gpu_metrics_simple.sh

#!/bin/bash
# gpu_metrics_simple.sh
while true; do
  {
    echo "HTTP/1.1 200 OK"
    echo "Content-Type: text/plain"
    echo ""
    nvidia-smi --query-gpu=index,name,utilization.gpu,temperature.gpu \
      --format=csv,noheader,nounits 2>/dev/null | awk -F',' '
    {
      gsub(/^[ \t]+|[ \t]+$/, "")
      gpu=$1; name=$2; util=$3; temp=$4
      
      if (gpu != "") {
        gsub(/ /, "_", name)
        print "nvidia_smi_gpu_utilization{gpu=\"" gpu "\",name=\"" name "\"} " (util=="" || util=="N/A" ? "0" : util)
        print "nvidia_smi_gpu_temperature_celsius{gpu=\"" gpu "\"} " (temp=="" || temp=="N/A" ? "0" : temp)
      }
    }'
  } | nc -w1 -l -p 9400
done

백그라운드 실행.

nohup bash gpu_metrics_simple.sh > /dev/null 2>&1 &

Prometheus 설정.

prometheus.yml

scrape_configs:
  - job_name: 'remote-ollama-server'
    scrape_interval: 15s
    scrape_timeout: 10s
    static_configs:
      - targets: ['gpu-server.example.com:59100']
        labels:
          instance: 'ollama-server'
          region: 'remote'

  - job_name: 'gpu-metrics'
    scrape_interval: 15s
    scrape_timeout: 10s
    static_configs:
      - targets: ['gpu-server.example.com:59400']
        labels:
          instance: 'ollama-gpu'
          region: 'remote'

Prometheus 리로드.

curl -X POST http://localhost:9090/-/reload

Grafana 패널.

GPU 사용률.

nvidia_smi_gpu_utilization{job="gpu-metrics"}

GPU 온도.

nvidia_smi_gpu_temperature_celsius{job="gpu-metrics"}

수집 메트릭.

nvidia_smi_gpu_utilization

nvidia_smi_gpu_temperature_celsius

확인용.

watch nvidia-smi

Prometheus target 확인.

Grafana 대시보드 확인.

문제.

DCGM Exporter ARM64 이미지가 안 맞음.

GB10 GPU 메모리 값은 N/A로 나와서 일단 사용률과 온도만 수집.

Grafana 대시보드 UID 중복으로 프로비저닝 충돌도 있었음.

중복 파일 정리 후 Grafana 재시작.

rm gpu-monitoring.json gpu-monitoring-updated.json

docker restart grafana

  • 추천 0

  • 비추천 0
이 게시물을
목록

댓글 0

번호 제목 글쓴이 날짜 조회 수
공지 2025 일본 여행 계획 김영훈 2024.10.10 4119
공지 현금, 저축, 투자, 지출, 예산, 보험 내역(2024-05-30) 김영훈 2024.03.10 3752
297 DGX Spark LLM 벤치마크 김영훈 2026.02.11 132
» GPU 모니터링 대시보드 구축 김영훈 2026.02.11 150
295 Docker Ollama 트러블슈팅 김영훈 2026.02.11 128
294 원격 LLM 챗봇 테스트 김영훈 2026.02.11 140
293 DGX Ollama 구축 김영훈 2026.02.11 183
292 OpenClaw cron regression 대응 김영훈 2026.02.08 186
291 WAF honeypot 설정 김영훈 2026.02.07 104
290 smtp-relay 설정 김영훈 2026.02.06 195
289 openclaw 구축 작업 노트 [2] 김영훈 2026.02.01 341
288 Traefik 설정 김영훈 2026.01.28 353
287 GitLab CI/CD 테스트 김영훈 2026.01.28 216
286 OpenVPN 구축 김영훈 2026.01.28 143
285 ollama-chatbot 테스트 메모 김영훈 2026.01.27 355
284 monitoring 설정 김영훈 2026.01.23 130
283 임시 파킹 페이지 김영훈 2026.01.20 308
282 infra-base 기본 서버 설정 메모 김영훈 2026.01.20 171
281 [바이브코딩 - 클로드] kospiAlarm 작업 메모 김영훈 2025.10.29 109
280 [바이브코딩 - 클로드] fullstack_template 작업 메모 김영훈 2025.10.18 243
279 [바이브코딩 - 클로드] reminder_android 작업 메모 김영훈 2025.10.17 85
278 [바이브코딩 - 클로드] bingbingsubway 작업 메모 김영훈 2025.10.12 165
쓰기 태그
 첫 페이지 1 2 3 4 5 6 7 8 9 10 끝 페이지