gpu-server-management – skill Khác cho agent AI
Thiết lập và quản lý máy chủ GPU NVIDIA cho khối lượng công việc AI
Cài skill gpu-server-management bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/gpu-server-management-e01a6.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /gpu-server-management – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/gpu-server-management-e01a6.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $gpu-server-management – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/gpu-server-management-e01a6.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /gpu-server-management – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/gpu-server-management-e01a6.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /gpu-server-management – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
GPU Server Management
Provision, configure, and monitor NVIDIA GPU servers for AI inference and training workloads.
When to Use This Skill
Use this skill when:
- Setting up a new GPU server for LLM inference or model training
- Installing or upgrading NVIDIA drivers and CUDA toolkit
- Configuring Docker with NVIDIA Container Toolkit for GPU workloads
- Partitioning A100/H100 GPUs with MIG for multi-tenant workloads
- Troubleshooting GPU errors, driver issues, or thermal throttling
Prerequisites
- Ubuntu 22.04 LTS (recommended) or RHEL 8/9
- NVIDIA GPU (A10G, A100, H100, RTX 4090, or L40S recommended)
- Root or sudo access
- Internet access for package downloads
Driver Installation (Ubuntu)
# Inspect the installed driver/CUDA stack and running workloads first.
# Driver removal requires an approved maintenance window and recovery plan;
# do not purge the existing GPU stack as a default installation step.
# Add NVIDIA package repository
distribution=$(. /etc/os-release; echo $ID$VERSION_ID)
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt update
# Historical version example only: select a reviewed driver/CUDA pair from the
# current compatibility matrix for this exact OS/GPU before installation.
sudo apt install -y nvidia-driver-560 cuda-toolkit-12-6
# Install NVIDIA Container Toolkit (Docker GPU support)
sudo apt install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
# Verify
nvidia-smi
nvcc --version
docker run --rm --gpus all nvidia/cuda:12.6.0-base-ubuntu22.04 nvidia-smiPost-Install Configuration
# Enable persistence mode (reduces driver initialization latency)
sudo nvidia-smi -pm 1
# Set power limit (reduce heat/noise on inference servers)
sudo nvidia-smi -pl 350 # watts; check TDP for your GPU model
# Preserve ECC by default; changes require a workload-specific integrity
# assessment and approved maintenance window.
# Enable P2P for multi-GPU NVLink training
sudo nvidia-smi topo -m # check NVLink topologyGPU Health Monitoring
# Real-time monitoring (like htop for GPUs)
watch -n 1 nvidia-smi
# Detailed stats
nvidia-smi --query-gpu=index,name,temperature.gpu,utilization.gpu,\
utilization.memory,memory.used,memory.free,power.draw,clocks.current.graphics \
--format=csv --loop=1
# DCGM — production monitoring daemon (for clusters)
sudo apt install -y datacenter-gpu-manager
sudo systemctl start dcgm
dcgmi discovery -l # list GPUs
dcgmi diag -r 1 # quick health check
dcgmi diag -r 3 # full diagnostic (takes ~20 min)
# Check GPU errors (XID errors — important for stability)
sudo dmesg | grep -i "NVRM\|nvidia\|XID"
nvidia-smi --query-gpu=ecc.errors.corrected.volatile.total \
--format=csv,noheaderPrometheus GPU Metrics (DCGM Exporter)
# Deploy DCGM Exporter for Prometheus scraping
docker run -d \
--name dcgm-exporter \
--gpus all \
--cap-add SYS_ADMIN \
-p 9400:9400 \
--restart unless-stopped \
nvcr.io/nvidia/k8s/dcgm-exporter:latest
# Key metrics exposed:
# DCGM_FI_DEV_GPU_UTIL - GPU utilization %
# DCGM_FI_DEV_MEM_COPY_UTIL - Memory bandwidth utilization
# DCGM_FI_DEV_FB_USED - Framebuffer memory used (MB)
# DCGM_FI_DEV_SM_CLOCK - SM clock speed (MHz)
# DCGM_FI_DEV_GPU_TEMP - Temperature (°C)
# DCGM_FI_DEV_POWER_USAGE - Power draw (W)
# DCGM_FI_DEV_XID_ERRORS - XID error count (0 = healthy)MIG Partitioning (A100/H100)
MIG (Multi-Instance GPU) allows slicing one GPU into isolated smaller GPUs.
# Enable MIG mode (requires reboot or restart of all processes)
sudo nvidia-smi -mig 1
sudo systemctl restart nvidia-persistenced
# List available MIG profiles (A100 80GB example)
nvidia-smi mig -lgip
# 1g.10gb — 1 slice, 10GB (max 7 instances)
# 2g.20gb — 2 slices, 20GB (max 3 instances)
# 3g.40gb — 3 slices, 40GB (max 2 instances)
# 7g.80gb — full GPU, 80GB (max 1 instance)
# Example only if this exact GPU reports the profile and placement as valid:
sudo nvidia-smi mig -cgi 2g.20gb,2g.20gb,2g.20gb -C
# List created instances
nvidia-smi mig -lgi
nvidia-smi mig -lcgi
# Use in Docker
docker run --gpus '"device=MIG-GPU-xxx/0/0"' ...
# Disable MIG
sudo nvidia-smi mig -i 0 -dci
sudo nvidia-smi mig -i 0 -dgi
sudo nvidia-smi -mig 0Kernel & OS Tuning for GPU Servers
# Increase file descriptor limits
echo '* soft nofile 1048576' | sudo tee -a /etc/security/limits.conf
echo '* hard nofile 1048576' | sudo tee -a /etc/security/limits.conf
# Disable transparent huge pages (reduces latency jitter)
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag
# Persistence: prepare a dedicated reviewed systemd unit/drop-in, preserving
# existing boot configuration. Do not overwrite /etc/rc.local.
# Validate on the actual kernel/workload and retain a rollback plan.
# PCIe performance mode
sudo nvidia-smi --auto-boost-default=0
sudo nvidia-smi --auto-boost-permission=0Multi-GPU Topology Check
# Check NVLink and PCIe topology
nvidia-smi topo -m
# Output shows interconnect type:
# NV# denotes the number of bonded NVLinks, not the NVLink generation.
# PHB = PCIe bus (slower; avoid for tensor parallel training)
# PIX = same PCIe switch (fast)
# Bandwidth test between GPUs
/usr/local/cuda/samples/bin/x86_64/linux/release/p2pBandwidthLatencyTestCommon Issues
| Issue | Cause | Fix |
|-------|-------|-----|
| nvidia-smi: command not found | Driver not installed | Follow driver installation steps above |
| Driver version mismatch | CUDA/driver incompatibility | Check compatibility matrix at developer.nvidia.com |
| GPU temperature >85°C | Poor airflow or fan failure | Check nvidia-smi -q -d TEMPERATURE; reseat cooler |
| XID 79 errors | GPU hardware error | Run dcgmi diag -r 3; may need GPU replacement |
| failed to open device in container | Container toolkit not configured | Run nvidia-ctk runtime configure --runtime=docker |
| Low PCIe bandwidth | Wrong slot or power limit | Check nvidia-smi -q | grep PCIe; use x16 slot |
Best Practices
- Always enable persistence mode (
nvidia-smi -pm 1) — reduces first-request latency. - Monitor XID errors; persistent XID 79/94 indicates hardware failure.
- For training: use NVLink-connected GPUs; for inference: PCIe is usually fine.
- Set up DCGM alerts on temperature >80°C and power draw near TDP.
- Use MIG for multi-tenant inference to provide GPU isolation between models.
Related Skills
- vllm-server (
vllm-server) - LLM inference on GPUs - llm-fine-tuning (
llm-fine-tuning) - GPU training setup - linux-hardening (
linux-hardening) - Secure the host OS - prometheus-grafana (
prometheus-grafana) - Metrics dashboards
Limitations
- Infrastructure commands can disrupt services: confirm target host/scope and have backups/snapshots before mutating state.
- Docs-only import: upstream scripts and templates not bundled.
Power/clock/THP and MIG changes can interrupt active jobs; inspect exact device IDs, supported profiles and workloads first, then apply only the approved settings. nvidia-smi topo -m observes topology and does not enable P2P. Review and pin repository keys/packages/container digests before privileged installation; the historical package URLs/versions are not a current compatibility guarantee. See the [NVIDIA MIG profiles](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/supported-mig-profiles.html).
Skill liên quan
- graceful-shutdown – Triển khai graceful shutdown cho server và worker: drain kết nối, hoàn tất công việc…
- grafana-dashboards – Tạo và quản lý dashboard Grafana sẵn sàng cho production để giám sát toàn diện hệ thống.
- hashicorp-vault – Quản lý secrets và PKI với HashiCorp Vault.
- headline-psychologist – Soạn thảo và so sánh các tiêu đề phù hợp với đối tượng, giúp nội dung liên quan và hấp…
- health-trend-analyzer – Phân tích xu hướng và mô hình của dữ liệu sức khỏe theo thời gian. Tìm mối liên hệ giữa…
- health-wellness – Sổ ghi nhận kiểm tra sức khỏe: cờ ẩn danh, phòng ban, ngày kiểm tra, điểm sức khỏe, mức…
- hig-components-layout – Apple Human Interface Guidelines cho các thành phần bố cục và điều hướng.
- hig-components-search – Hướng dẫn HIG của Apple cho các thành phần điều hướng, bao gồm ô tìm kiếm, điều khiển…