On 28 August a release test wedged the GPU driver on one of our machines. The guard on that card watched memory, and memory barely moved. Then every command we ran to check on the card got stuck as well, and the monitoring became the second fault.
What happened
The test started five copies of a desktop app at once, each in its own virtual display, to check a release. Each copy runs an embedded browser engine, and each engine opens its own context on the GPU.
The driver wedged. Load average on the machine reached 134.
What the guard saw
Our guard on that card watched two numbers: GPU memory and utilisation. Utilisation stopped reporting at all. Memory read 23,387 MiB of 24,463. Before the test it had been 23,022, so all five copies together had added about 365 MiB.
Memory was never the constraint. What ran out was GPU contexts and the address space that comes with them, one per browser. Nothing the guard measured would have moved before the failure.
A guard pointed at the wrong resource reads green right up to the moment the machine stops.
It wasn't the first time. Five days earlier, parallel browsers had run the card out of contexts, and we made a rule against running them side by side. This test launched app instances instead, and the rule didn't name them.
Then the checking made it worse
The natural move is to ask the card how it's doing. Every nvidia-smi run to check on it hung, permanently, in uninterruptible sleep (state D in ps). Ten of them stacked up. A process in that state can't be killed, and the only thing that clears it is a reboot.
Wrapping the check in timeout 30 didn't help, and how it failed is worth remembering. A timeout that fires and changes nothing is itself proof of uninterruptible sleep: the signal it sends can't be delivered. So each check didn't just fail to answer. It added another stuck process to the pile.
What answered instantly
Three things kept answering immediately the whole time, because none of them touch the card:
- the load average, read from
/proc/loadavg - the number of processes stuck in state D, from
ps - the service's own HTTP status
Between them they told us what we needed: how loaded the machine was, how many processes were stuck on the driver, and whether the service on top was still responding. None of them made anything worse.
What changed, and what's underneath
Browsers and app instances on that machine now run one at a time, because the limit is contexts, not memory, and a card with free memory doesn't relax it. A gate we added after the first incident refuses to start another browser past set ceilings on GPU clients, concurrent browsers, load, free memory and swap. It was already running on the day of this test, and it let all five app instances through, because it only recognises browsers.
The cause underneath was in the test itself. Killing the app didn't kill the browser-engine processes it had started, and those were what held the GPU contexts. On 7 November we closed the first gap: the gate now counts app instances alongside browsers, and it reads the driver's state from the kernel's process table before it touches the card, so a wedged driver gets a refusal instead of another stuck check. One thing is still open: the harness doesn't yet clean up after itself. It was the same shape as before: a rule that didn't name the thing that broke.
What to do
For each scarce resource you own, whether that's GPU hosts, storage arrays or licence pools, ask two questions.
Which resource actually runs out first under the workload you're worried about? It's often not the one on the dashboard. Measure it under load rather than assuming.
And when that resource wedges, how will you diagnose it without touching it? Decide in advance which readings are safe: ones that come from the operating system or from the service above, and that answer even when the device doesn't. Keep the device's own tools for when it's healthy again.
Working out which resource really runs out, and how to check on it without making things worse, is the work I've done through twenty years leading infrastructure. See the leadership record, or get in touch.