<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Altostratus Amihai</title>
    <description>The latest articles on DEV Community by Altostratus Amihai (@altostratus_amihai_71d88f).</description>
    <link>https://dev.to/altostratus_amihai_71d88f</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3827694%2Febd977e4-72f0-49c0-8157-5225a763fc53.png</url>
      <title>DEV Community: Altostratus Amihai</title>
      <link>https://dev.to/altostratus_amihai_71d88f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/altostratus_amihai_71d88f"/>
    <language>en</language>
    <item>
      <title>A first-pass checklist for a hanging NCCL all-reduce on a multi-node GPU cluster</title>
      <dc:creator>Altostratus Amihai</dc:creator>
      <pubDate>Sat, 28 Nov 2026 03:24:38 +0000</pubDate>
      <link>https://dev.to/altostratus_amihai_71d88f/a-first-pass-checklist-for-a-hanging-nccl-all-reduce-on-a-multi-node-gpu-cluster-4d3a</link>
      <guid>https://dev.to/altostratus_amihai_71d88f/a-first-pass-checklist-for-a-hanging-nccl-all-reduce-on-a-multi-node-gpu-cluster-4d3a</guid>
      <description>&lt;p&gt;When a multi-node training job hangs in an all-reduce, the cause is usually in the network setup, not in the training code. A first pass that rules out the common cases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Turn on logging. Set NCCL_DEBUG=INFO (and NCCL_DEBUG_SUBSYS=INIT,NET if you want less noise). The log shows which transport NCCL picked (InfiniBand/RoCE vs plain sockets) and which interface it bound to.&lt;/li&gt;
&lt;li&gt;Reproduce without your model. Run nccl-tests (all_reduce_perf) across the same nodes. If it hangs or is far below expected bandwidth, the problem is the fabric or the config, not your job.&lt;/li&gt;
&lt;li&gt;Check interface selection. On multi-homed nodes NCCL can pick the wrong NIC. Pin it with NCCL_SOCKET_IFNAME, and for InfiniBand/RoCE with NCCL_IB_HCA.&lt;/li&gt;
&lt;li&gt;Check the fabric itself. Verify link state and speed on every node (for example ibstat), and look for a single node with a degraded or down port.&lt;/li&gt;
&lt;li&gt;Check that GPU Direct RDMA is actually in use if you expect it. The NCCL log tells you whether it fell back to a slower path.&lt;/li&gt;
&lt;li&gt;Check Kubernetes-side limits: pod network mode, whether the RDMA devices are exposed to the pod, and memlock limits.&lt;/li&gt;
&lt;li&gt;Compare versions. Mismatched NCCL, driver or OFED versions across nodes are a frequent cause of hangs that only show at scale.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of this is exotic, but the order matters: logs first, then a model-free reproduction, then the network.&lt;/p&gt;

&lt;p&gt;Disclosure: I am affiliated with Altostratus (altostratus.bot), an AI assistant for GPU and Kubernetes troubleshooting. The checklist above stands on its own and works without it. Treat any assistant, including that one, as a starting point and check your own logs. Questions about this checklist are welcome in the comments.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>nvidia</category>
      <category>devops</category>
      <category>ai</category>
    </item>
    <item>
      <title>vLLM in production on Kubernetes: the startup probe, the /dev/shm trap, and autoscaling on queue depth</title>
      <dc:creator>Altostratus Amihai</dc:creator>
      <pubDate>Fri, 27 Nov 2026 06:28:46 +0000</pubDate>
      <link>https://dev.to/altostratus_amihai_71d88f/vllm-in-production-on-kubernetes-the-startup-probe-the-devshm-trap-and-autoscaling-on-queue-3877</link>
      <guid>https://dev.to/altostratus_amihai_71d88f/vllm-in-production-on-kubernetes-the-startup-probe-the-devshm-trap-and-autoscaling-on-queue-3877</guid>
      <description>&lt;p&gt;&lt;strong&gt;Key takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Give vLLM a startupProbe sized from a measured cold model load (failureThreshold x periodSeconds), or the pod crash-loops on rollout.&lt;/li&gt;
&lt;li&gt;Mount a memory-backed emptyDir at /dev/shm; the 64Mi default breaks tensor-parallel workers.&lt;/li&gt;
&lt;li&gt;Autoscale the HPA on queue depth (&lt;code&gt;vllm:num_requests_waiting&lt;/code&gt;), not GPU utilization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Getting an LLM running on a GPU is easy. &lt;code&gt;vllm serve&lt;/code&gt; and you have an OpenAI-compatible endpoint in five minutes. Running it in production is where the days disappear, and they disappear in three specific places.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The startup probe, or why your pods keep dying on rollout
&lt;/h2&gt;

&lt;p&gt;A 70B model takes minutes to load into GPU memory. The default Kubernetes liveness probe kills the container after 30 seconds, the load restarts, and the pod crash-loops forever. The fix is a startup probe with a window sized for your actual model load:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;startupProbe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/health&lt;/span&gt;
    &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8000&lt;/span&gt;
  &lt;span class="na"&gt;failureThreshold&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;
  &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;    &lt;span class="c1"&gt;# 10 minutes of patience for big models
&lt;/span&gt;&lt;span class="na"&gt;readinessProbe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/health&lt;/span&gt;
    &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8000&lt;/span&gt;
  &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Size &lt;code&gt;failureThreshold * periodSeconds&lt;/code&gt; from a measured cold load, then add headroom for model download on a fresh node. Only after startup succeeds do the liveness and readiness probes take over.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The /dev/shm trap with tensor parallelism
&lt;/h2&gt;

&lt;p&gt;vLLM workers communicate over shared memory. Kubernetes gives containers a 64Mi &lt;code&gt;/dev/shm&lt;/code&gt; by default, and tensor-parallel setups crash or hang with inscrutable NCCL or shared-memory errors. The fix is one volume:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shm&lt;/span&gt;
  &lt;span class="na"&gt;emptyDir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;medium&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Memory&lt;/span&gt;
    &lt;span class="na"&gt;sizeLimit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;8Gi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;mounted at &lt;code&gt;/dev/shm&lt;/code&gt; in every vLLM container. Everyone hits this exactly once, and it costs hours because the error message never says "shared memory" in a way you can grep for.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Autoscale on queue depth, not GPU utilization
&lt;/h2&gt;

&lt;p&gt;The HPA's default instinct, scale on GPU utilization, is wrong for LLM serving. A vLLM server at 95% GPU utilization with an empty queue is healthy and fast; one at 40% utilization with 50 requests queued is drowning. The signal that predicts user-visible latency is &lt;code&gt;vllm:num_requests_waiting&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;vLLM exposes Prometheus metrics out of the box; you scale on queue depth through the prometheus-adapter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# HPA custom metric (via prometheus-adapter)
&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pods&lt;/span&gt;
  &lt;span class="na"&gt;pods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metric&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;vllm_num_requests_waiting&lt;/span&gt;
    &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AverageValue&lt;/span&gt;
      &lt;span class="na"&gt;averageValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"5"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The part most setups get wrong is the adapter glue: the series name, the pod-level aggregation, and the resource association. When it is wired right, replicas scale with actual demand instead of a proxy for it.&lt;/p&gt;

&lt;p&gt;Two more production basics people skip: a ServiceMonitor so Prometheus actually scrapes the metrics you are scaling on, and a PodDisruptionBudget so a node drain never takes your last warm replica. And request GPUs correctly, &lt;code&gt;nvidia.com/gpu: 2&lt;/code&gt; with the model's tensor-parallel size matching, or the scheduler will make creative decisions for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why does my vLLM pod keep restarting while the model loads?&lt;/strong&gt; The liveness probe fires before a large model finishes loading. A startupProbe holds off liveness and readiness until the first success.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What /dev/shm size does vLLM need on Kubernetes?&lt;/strong&gt; Kubernetes defaults to 64Mi. Tensor-parallel setups need a memory-backed emptyDir mounted at /dev/shm; the example above uses 8Gi, so size it to your model and parallelism.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What metric should the HPA scale vLLM on?&lt;/strong&gt; The number of waiting requests (&lt;code&gt;vllm:num_requests_waiting&lt;/code&gt;, exposed to the HPA through prometheus-adapter), because it tracks user-visible latency better than GPU utilization.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shortcut
&lt;/h2&gt;

&lt;p&gt;This is all packaged as a production starter kit: the deployment with the right probes and shm, the ServiceMonitor, the PDB, the prometheus-adapter config, and a setup guide covering model/GPU right-sizing and OOM fixes. Every manifest is kubeconform-validated. $39: &lt;a href="https://probizgen.gumroad.com/l/ProductionvLLMonKubernetes" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/ProductionvLLMonKubernetes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Black Friday:&lt;/strong&gt; 30% off this pack (and everything else in the store, including the $79 three-pack bundle) with code &lt;strong&gt;BF30&lt;/strong&gt; through Monday Nov 30: &lt;a href="https://probizgen.gumroad.com/l/ProductionvLLMonKubernetes/BF30" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/ProductionvLLMonKubernetes/BF30&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I built and sell this pack. The three gotchas above are the real content; the pack is the working deployment you don't have to debug.&lt;/p&gt;

&lt;p&gt;Pairs with the GPU monitoring pack, because the first thing you want after serving works is to know what your GPUs are doing: &lt;a href="https://probizgen.gumroad.com/l/GPUMonitoringStarterPack" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/GPUMonitoringStarterPack&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>llm</category>
      <category>ai</category>
      <category>devops</category>
    </item>
    <item>
      <title>Your GPUs are idle more than you think: building a safe idle-GPU reaper from DCGM metrics</title>
      <dc:creator>Altostratus Amihai</dc:creator>
      <pubDate>Fri, 27 Nov 2026 06:28:31 +0000</pubDate>
      <link>https://dev.to/altostratus_amihai_71d88f/your-gpus-are-idle-70-of-the-time-building-a-safe-idle-gpu-reaper-from-dcgm-metrics-1c4o</link>
      <guid>https://dev.to/altostratus_amihai_71d88f/your-gpus-are-idle-70-of-the-time-building-a-safe-idle-gpu-reaper-from-dcgm-metrics-1c4o</guid>
      <description>&lt;p&gt;&lt;strong&gt;Key takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Idle means a sustained low-utilization window, low framebuffer use, and an allocation still held by a pod, not just a momentary dip in &lt;code&gt;DCGM_FI_DEV_GPU_UTIL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A safe reaper has two gates: warn and notify first, then evict only workloads that opted in with a label.&lt;/li&gt;
&lt;li&gt;Never kill on sight; the reaper itself becomes the outage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A single H100 is a five-figure purchase, or a few dollars an hour to rent, depending on provider. On many clusters a large share of allocated GPU-hours sit idle: jobs that finished but kept their allocation, notebooks left open over the weekend, inference deployments sized for a peak that happened once.&lt;/p&gt;

&lt;p&gt;The fix is not another dashboard. Dashboards show you the waste; they don't remove it. The fix is a reaper.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: measure what "idle" actually means
&lt;/h2&gt;

&lt;p&gt;dcgm-exporter gives you per-GPU utilization (&lt;code&gt;DCGM_FI_DEV_GPU_UTIL&lt;/code&gt;) and memory usage. The naive query, utilization &amp;lt; 5%, is wrong on its own: it catches pods mid-data-load, inference servers between requests, and anything with bursty compute. Idle has to be a sustained condition:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GPU utilization under ~5% for a sustained window (hours, not minutes), and&lt;/li&gt;
&lt;li&gt;framebuffer usage low or flat (a loaded model is not idle even at 0% util), and&lt;/li&gt;
&lt;li&gt;the allocation still held by a pod.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Prometheus can express all three. The reaper is a small controller that evaluates this on a loop and labels offending pods.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: the double gate, or how the reaper doesn't cause the outage
&lt;/h2&gt;

&lt;p&gt;The failure mode of every homegrown reaper is the same: it kills something a human was about to use, and now the team routes around it forever. The design that survives contact with reality has two gates:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Warn, don't kill.&lt;/strong&gt; First idle window crossed: annotate the pod, post to the team's channel with the owner, the GPU count, and the burn rate. Humans clean up most of these within a day.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evict only the opted-in.&lt;/strong&gt; Workloads carry an explicit label saying the reaper may evict them after a second, longer idle window. No label, no eviction. Batch training and dev notebooks opt in; anything a human is interactively using does not have to.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This sounds overly cautious until the first time the reaper would have killed a VP's demo. Then it sounds like the only way it could ever have shipped.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: what you get back
&lt;/h2&gt;

&lt;p&gt;Reclaimed GPUs show up either as cloud spend you stop paying or as queue time your researchers stop waiting on. Your own numbers will depend on your fleet, so measure idle hours for a week before you decide what to reclaim.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How do I detect an idle GPU in Kubernetes?&lt;/strong&gt; Combine three conditions in Prometheus: &lt;code&gt;DCGM_FI_DEV_GPU_UTIL&lt;/code&gt; low for hours, framebuffer usage low or flat, and the GPU still allocated to a pod.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe to auto-evict idle GPU pods?&lt;/strong&gt; Only with guardrails: annotate and notify the owner first, and evict only pods that carry an explicit opt-in label after a second, longer idle window.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does this need dcgm-exporter?&lt;/strong&gt; Yes. The utilization and memory metrics come from NVIDIA's dcgm-exporter.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shortcut
&lt;/h2&gt;

&lt;p&gt;The full implementation, the Prometheus queries, the controller logic, the two-gate policy, and the manifests validated against upstream Kubernetes, is in my GPU Cost-Optimization Pack ($39, free updates): &lt;a href="https://probizgen.gumroad.com/l/GPUCost-OptimizationPack" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/GPUCost-OptimizationPack&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It pairs with the monitoring pack that gets the DCGM metrics flowing in the first place: &lt;a href="https://probizgen.gumroad.com/l/GPUMonitoringStarterPack" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/GPUMonitoringStarterPack&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Black Friday:&lt;/strong&gt; 30% off this pack (and everything else in the store, including the $79 three-pack bundle) with code &lt;strong&gt;BF30&lt;/strong&gt; through Monday Nov 30: &lt;a href="https://probizgen.gumroad.com/l/GPUCost-OptimizationPack/BF30" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/GPUCost-OptimizationPack/BF30&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I built and sell these packs. The measurement queries and the two-gate design above are the substance; the pack is the days of implementation you skip.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>nvidia</category>
      <category>finops</category>
    </item>
    <item>
      <title>Cutting GPU costs on Kubernetes: time-slicing vs MIG vs spot nodes, and when each one is the right answer</title>
      <dc:creator>Altostratus Amihai</dc:creator>
      <pubDate>Fri, 27 Nov 2026 06:28:11 +0000</pubDate>
      <link>https://dev.to/altostratus_amihai_71d88f/cutting-gpu-costs-on-kubernetes-time-slicing-vs-mig-vs-spot-nodes-and-when-each-one-is-the-right-517o</link>
      <guid>https://dev.to/altostratus_amihai_71d88f/cutting-gpu-costs-on-kubernetes-time-slicing-vs-mig-vs-spot-nodes-and-when-each-one-is-the-right-517o</guid>
      <description>&lt;p&gt;&lt;strong&gt;Key takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time-slicing: shared GPUs for dev and CI, with no memory isolation.&lt;/li&gt;
&lt;li&gt;MIG: hardware-isolated slices (up to 7 on A100/H100 80GB) for multi-tenant work.&lt;/li&gt;
&lt;li&gt;Spot GPUs: biggest price cut, for checkpointed or stateless workloads such as inference.&lt;/li&gt;
&lt;li&gt;Reclaim idle allocations with a double-gated reaper.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Seeing wasted GPUs is not the same as cutting them. GPU budgets are often wasted on idle or over-allocated resources, and the fixes are all documented, but they are documented in four different places with four different caveats. Here is the whole picture in one place.&lt;/p&gt;

&lt;p&gt;There are three levers. They solve different problems and most clusters need two of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lever 1: Time-slicing, for dev and CI
&lt;/h2&gt;

&lt;p&gt;Time-slicing lets N pods share one physical GPU by time-multiplexing it. You configure the NVIDIA device plugin to advertise, say, 8 replicas per GPU:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# nvidia-device-plugin config
&lt;/span&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;sharing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;timeSlicing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nvidia.com/gpu&lt;/span&gt;
      &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now eight dev notebooks or CI jobs can each request &lt;code&gt;nvidia.com/gpu: 1&lt;/code&gt; and land on one card.&lt;/p&gt;

&lt;p&gt;The catch that bites everyone: there is no memory isolation. One pod can OOM the other seven. Time-slicing is right for dev, CI smoke tests, and light inference where the workloads are cooperative. It is wrong for anything tenant-facing or anything that must not die at 3am.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lever 2: MIG, for real isolation on big cards
&lt;/h2&gt;

&lt;p&gt;Multi-Instance GPU splits an A100 or H100 80GB into up to 7 hardware-isolated instances, each with dedicated memory and compute slices. You enable it per node, the GPU operator handles the rest, and pods request &lt;code&gt;nvidia.com/mig-1g.10gb: 1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;MIG is the right answer when you need fault isolation: a crashed job cannot touch its neighbor's memory. It is the wrong answer when workloads need full-card memory or NVLink bandwidth, because the slices are hard partitions. The trap: mixing MIG and non-MIG on the same node, or assuming you can resize partitions without draining. Plan the partition profile per node pool and keep it boring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lever 3: Spot GPUs, for 60-90% off
&lt;/h2&gt;

&lt;p&gt;Spot/preemptible GPU nodes are often the biggest lever: same hardware at a steep discount (the amount varies by provider, region and GPU type). The reason teams avoid them is that a preemption mid-training-run loses hours of work. The pattern that makes spot safe has three parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A node pool of spot GPUs with taints, and a matching toleration only on workloads that checkpoint (or are stateless inference).&lt;/li&gt;
&lt;li&gt;Priority classes so spot preempts nothing important and on-demand preempts spot when you need guaranteed capacity.&lt;/li&gt;
&lt;li&gt;A PDB and a checkpoint cadence that matches the preemption rate of your GPU type in your region.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inference serving is the best spot candidate: replicas are stateless, so preemption costs you one rolling restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fourth problem: GPUs that are allocated and doing nothing
&lt;/h2&gt;

&lt;p&gt;This one isn't a scheduling feature, it's garbage collection. A researcher allocates a 4-GPU node on Friday, the job finishes Saturday, and the allocation sits until someone notices. DCGM already reports utilization; an idle reaper is a small controller that watches &lt;code&gt;DCGM_FI_DEV_GPU_UTIL&lt;/code&gt;, flags GPUs below 5% utilization for N hours, and reclaims them.&lt;/p&gt;

&lt;p&gt;The dangerous version kills pods on sight. The safe version is double-gated: it annotates and notifies first, and only evicts after a second idle window with an opt-in label on the workload. Anything less and the reaper itself becomes the outage cause.&lt;/p&gt;

&lt;h2&gt;
  
  
  The decision, in one paragraph
&lt;/h2&gt;

&lt;p&gt;Dev and CI on shared GPUs: time-slicing. Multi-tenant or memory-isolated workloads on big cards: MIG. Anything checkpointable or stateless: spot. Everything, always: idle reclaim, because the biggest GPU in your fleet is the one doing nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Time-slicing or MIG for sharing a GPU?&lt;/strong&gt; MIG gives hardware-isolated memory and compute, so use it for multi-tenant or fault-isolated workloads. Time-slicing has no memory isolation, so keep it to cooperative dev and CI workloads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe to run GPU workloads on spot nodes?&lt;/strong&gt; Yes for stateless inference and for training that checkpoints often. Taint the spot pool and tolerate it only on workloads that survive preemption.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I mix MIG and non-MIG GPUs on one node?&lt;/strong&gt; It is a trap. Plan a partition profile per node pool and avoid resizing without draining.&lt;/p&gt;

&lt;p&gt;I packaged all four as production manifests with the guardrails built in: time-slicing configs per pool type, MIG profiles, the spot priority/consolidation pattern, and the double-gated idle reaper that reads your DCGM metrics. kubeconform-validated, $39: &lt;a href="https://probizgen.gumroad.com/l/GPUCost-OptimizationPack" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/GPUCost-OptimizationPack&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Black Friday:&lt;/strong&gt; 30% off this pack (and everything else in the store, including the $79 three-pack bundle) with code &lt;strong&gt;BF30&lt;/strong&gt; through Monday Nov 30: &lt;a href="https://probizgen.gumroad.com/l/GPUCost-OptimizationPack/BF30" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/GPUCost-OptimizationPack/BF30&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I built and sell this pack. The decision framework above is the real content; the pack is the implementation you don't have to write.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>nvidia</category>
      <category>cloud</category>
    </item>
    <item>
      <title>GPU monitoring on Kubernetes with dcgm-exporter: the DaemonSet, the 8 alerts that matter, and one dashboard</title>
      <dc:creator>Altostratus Amihai</dc:creator>
      <pubDate>Fri, 27 Nov 2026 06:27:49 +0000</pubDate>
      <link>https://dev.to/altostratus_amihai_71d88f/gpu-monitoring-on-kubernetes-with-dcgm-exporter-the-daemonset-the-8-alerts-that-matter-and-one-mn8</link>
      <guid>https://dev.to/altostratus_amihai_71d88f/gpu-monitoring-on-kubernetes-with-dcgm-exporter-the-daemonset-the-8-alerts-that-matter-and-one-mn8</guid>
      <description>&lt;p&gt;&lt;strong&gt;Key takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run dcgm-exporter as a DaemonSet, pin the image version, and export a curated metrics CSV.&lt;/li&gt;
&lt;li&gt;Alert on XID errors, uncorrectable ECC errors, temperature, throttle reasons, VRAM pressure, NVLink errors, missing GPUs and idle-but-allocated GPUs.&lt;/li&gt;
&lt;li&gt;Utilization alone is not an error condition.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most teams running GPUs on Kubernetes have the same blind spot: they can see CPU and memory, but the GPU is a black box. A training run dies on an XID error at 3am, a node thermal-throttles for a week, or four A100s sit allocated but idle at $2-4/hr each, and nobody knows until the bill or the postmortem.&lt;/p&gt;

&lt;p&gt;NVIDIA's dcgm-exporter fixes the visibility problem. Getting it right takes a few days the first time because the defaults are wrong in small ways: the default metric set misses the errors that actually kill jobs, the alerts everyone copies fire on noise, and the dashboards show utilization without the context that makes it actionable.&lt;/p&gt;

&lt;p&gt;Here is the version that works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The DaemonSet
&lt;/h2&gt;

&lt;p&gt;dcgm-exporter runs as a DaemonSet on GPU nodes. The important parts people get wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dcgm-exporter&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nvcr.io/nvidia/k8s/dcgm-exporter:3.3.0-3.4.0-ubuntu22.04&lt;/span&gt;
  &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-f"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"/etc/dcgm-exporter/dcp-metrics-included.csv"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;securityContext&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runAsNonRoot&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;   &lt;span class="c1"&gt;# DCGM needs the host driver; run read-only instead of fighting this
&lt;/span&gt;    &lt;span class="na"&gt;readOnlyRootFilesystem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;capabilities&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;drop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ALL"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DCGM_EXPORTER_COLLECTORS&lt;/span&gt;
    &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/etc/dcgm-exporter/dcp-metrics-included.csv&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;metrics&lt;/span&gt;
    &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9400&lt;/span&gt;
  &lt;span class="na"&gt;volumeMounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;metrics-config&lt;/span&gt;
    &lt;span class="na"&gt;mountPath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/etc/dcgm-exporter&lt;/span&gt;
    &lt;span class="na"&gt;readOnly&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two decisions matter here. First, pin the image by version, not &lt;code&gt;latest&lt;/code&gt;: the metric set changes between releases and your alerts will silently stop matching. Second, use the included-metrics CSV so you control exactly which of the 30+ fields are exported. DCGM can generate a lot of cardinality; the default set includes per-GPU metrics you will never alert on.&lt;/p&gt;

&lt;p&gt;It is read-only against the driver, so it is safe to run on training nodes and safe to uninstall. It does not need the GPU operator, but it pairs fine with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 8 alerts that actually matter
&lt;/h2&gt;

&lt;p&gt;Most example alert sets fire on utilization thresholds. Utilization is not an error condition. These are the ones that catch real problems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;XID errors&lt;/strong&gt; (&lt;code&gt;DCGM_FI_DEV_XID_ERRORS&lt;/code&gt;). XID 48 (double-bit ECC), 79 (GPU has fallen off the bus), 94/95 (contained/uncontained errors) mean the job on that GPU is already corrupted or about to be. Alert on any of them, page on 79.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Uncorrectable ECC errors&lt;/strong&gt; (&lt;code&gt;DCGM_FI_DEV_ECC_DBE_VOL_TOTAL&lt;/code&gt;). Silent data corruption. If this increments during a training run, the run is suspect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GPU temperature&lt;/strong&gt; (&lt;code&gt;DCGM_FI_DEV_GPU_TEMP&lt;/code&gt; sustained above ~85C). Thermal throttling shows up as a "slow training run" for days before anyone checks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Power / thermal throttling&lt;/strong&gt; (&lt;code&gt;DCGM_FI_DEV_CLOCKS_THROTTLE_REASONS&lt;/code&gt;). Tells you &lt;em&gt;why&lt;/em&gt; clocks dropped, so you stop guessing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VRAM pressure&lt;/strong&gt; (&lt;code&gt;DCGM_FI_DEV_FB_USED / DCGM_FI_DEV_FB_TOTAL &amp;gt; 0.95&lt;/code&gt;). The OOM is coming; alert before it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NVLink errors&lt;/strong&gt; (&lt;code&gt;DCGM_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_TOTAL&lt;/code&gt;). Multi-GPU training degrades quietly when links start erroring.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node-level GPU count mismatch&lt;/strong&gt;: fewer GPUs reporting than the node has. A GPU fell off the bus and the scheduler still thinks it is there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Idle but allocated&lt;/strong&gt;: utilization &amp;lt; 5% while a pod holds the GPU, sustained for 30+ minutes. This is the money alert. See the note below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Rules 1-2 are page-worthy. 3-7 are ticket-worthy. 8 is the one that pays for everything else: on many clusters a large share of allocated GPU-hours sit idle, which at cloud GPU prices adds up fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  The dashboard
&lt;/h2&gt;

&lt;p&gt;One Grafana dashboard, fleet view: per-GPU utilization, framebuffer used/total, temperature, power draw, and XID/ECC counters, grouped by node. Two clicks to import if the JSON is built against the standard dcgm-exporter metric names. The mistake to avoid is ten dashboards: nobody opens ten dashboards, everybody glances at one.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What does dcgm-exporter do?&lt;/strong&gt; It exports NVIDIA GPU metrics (utilization, memory, temperature, power, XID and ECC errors) to Prometheus.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which GPU alerts matter on Kubernetes?&lt;/strong&gt; XID errors and uncorrectable ECC errors should page; temperature, throttling, VRAM pressure, NVLink errors, missing GPUs and idle-but-allocated GPUs should open tickets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which XID errors are serious?&lt;/strong&gt; XID 48 (double-bit ECC) and 79 (GPU fell off the bus) are the ones to alert on first.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that is genuinely annoying
&lt;/h2&gt;

&lt;p&gt;Wiring this by hand is 2-3 days: the metrics CSV tuning, the alert thresholds that don't page you for garbage, the dashboard JSON, and the "why is this metric missing on A100 vs H100" archaeology.&lt;/p&gt;

&lt;p&gt;I packaged the whole thing as a copy-paste kit: the DaemonSet, the tuned metrics list, the 8 alert rules as a PrometheusRule, the Grafana dashboard JSON, and a setup guide for both kube-prometheus-stack and plain Prometheus/Grafana. Every manifest is kubeconform-validated.&lt;/p&gt;

&lt;p&gt;It is $39, free updates for life: &lt;a href="https://probizgen.gumroad.com/l/GPUMonitoringStarterPack" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/GPUMonitoringStarterPack&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Black Friday:&lt;/strong&gt; 30% off this pack (and everything else in the store, including the $79 three-pack bundle) with code &lt;strong&gt;BF30&lt;/strong&gt; through Monday Nov 30: &lt;a href="https://probizgen.gumroad.com/l/GPUMonitoringStarterPack/BF30" rel="noopener noreferrer"&gt;https://probizgen.gumroad.com/l/GPUMonitoringStarterPack/BF30&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I built and sell this pack. Everything above stands on its own; the pack just saves you the days.&lt;/p&gt;

&lt;p&gt;Pairs with the idle-GPU reclaim side of the problem, which is a separate writeup: the monitoring pack shows you the idle GPUs, the cost-optimization pack reclaims them.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>prometheus</category>
      <category>devops</category>
      <category>nvidia</category>
    </item>
  </channel>
</rss>
