What actually hangs a DGX Spark (and the guard that stopped it)
My DGX Spark (GB10, 128 GB of unified memory) runs local models for vision, speech and text. It has no remote power control. If it hard-hangs, somebody has to walk up to it and press the button. That one fact changes how careful you are with every model load. This post is what actually took the machine down, what I got wrong while trying to prevent it, and the guard that works.
Why the usual tools lie on GB10
On a normal server, ps shows you who holds the memory. On GB10 it does not. The CPU and GPU share one pool, and GPU allocations are not attributed to any process. At one point ps showed about 11 GB of resident memory in total while free showed 72 GB used.
So the first rule: free is the only trustworthy signal, and the number that matters is available. Do not count processes. Do not add up RSS. Watch available, and verify a teardown by watching it come back to its baseline.
The process you cannot find by name
vLLM starts a worker process and renames itself to the literal string VLLM::EngineCore. No venv path, no model name in the command line.
I used to stop a test with something like pkill -f '<venv path>.*<model path>'. That kills the API server. It leaves the worker alive, with about 30 GB still resident. Then ps aux | grep with the same pattern reports a clean machine, because the pattern cannot match the renamed worker either. Two tools agreeing on the wrong answer is worse than one tool failing.
The fix is to stop looking for processes by pattern at all:
# at launch: give the whole tree its own process group
setsid ./serve-model.sh &
PGID=$!
# at teardown: kill the group, not a name
kill -9 -"$PGID"
Everything the launcher spawned, including the renamed worker, shares that group id, so one signal reaches all of it. Then you check free, not ps.
The OOM killer will not save you
I assumed that if I made a mistake, the kernel would kill something and the box would recover. It does not work that way here. The memory in play is GPU and pinned memory. It is not reclaimable anonymous memory, so the kernel has nothing it is willing to kill.
What happens instead is a livelock. jbd2 and the journal daemon block for more than 120 seconds. The network daemon dies and cannot restart. SSH goes from "connection dropped" to "operation timed out". The machine is gone, and there is no automatic recovery. A person has to press the power button.
That is the reason the guard cannot be optional. It is the only backstop there is.
A watchdog over SSH goes blind exactly when you need it
My first guard ran on my laptop and polled the box over SSH. The problem is obvious in hindsight: SSH and the network daemon are among the first things to die when the machine thrashes. A monitor that depends on them stops seeing at the moment the situation becomes dangerous.
The guard has to run on the box, as its own process, and act locally. It must not need the network to do its job.
The guard that never fired
My earlier guard killed the job when avail < 3000 MB AND swap_free < 500 MB. It looks reasonable. During the incident it did nothing for two hours, because the real numbers were:
availablearound 150 MB, far past any safe levelswap_freearound 2100 MB, above its threshold
On this machine the swap file barely moves once it is about 87% full. The pressure lands on available. With AND, the second condition was false the whole time, so the guard evaluated false while the machine was dying.
Use OR:
kill if avail < 8000 MB OR swap_free < 512 MB
Either signal alone is enough reason to act. A guard made of AND can only fire when everything is already wrong in the same way, and on this hardware that never happens.
One heavy load at a time
The incident itself was a sequencing mistake. I killed a 30B test's API server, and 16 seconds later started a second, larger model. The orphaned worker from the first still held about 30 GB. The allocations of the second one began failing 37 seconds after that.
The rule now: never start model B until the teardown of model A is confirmed by memory, meaning available is back near the baseline recorded before A started. Not "the process is gone". Not "the port is closed". Memory.
A loader flag that doubles the peak
--load-format fastsafetensors briefly holds the weights twice: a staging buffer plus the copy on the GPU. Next to another resident model, that dropped available to 12.6 GB. If you have to co-load, use --load-format safetensors. It is slower and its peak is lower, and on this box the peak is the thing that kills you.
How the harness is put together
I wrapped all of this into one script with four steps, so I stop hand-rolling it:
- preflight stops heavy services, records the baseline
available, and aborts if less than 40 GB is available afterwards. - launch starts the command in its own process group together with an on-box watchdog using the OR thresholds above.
- teardown kills the whole group and verifies by memory that it came back.
- restore refuses to restart the normal services while memory is still held.
Each step refuses rather than warns. Warnings get ignored at midnight.
Checklist
- Trust
free, specificallyavailable. Ignorepsand RSS for memory. - Never find the vLLM worker by pattern.
setsidat launch,kill -9 -PGIDat teardown. - Run the guard on the box, not over SSH.
- Thresholds are OR:
avail < 8000 MBorswap_free < 512 MB. - One heavy load at a time. Start the next one only after
availablehas recovered. - Co-loading: use
--load-format safetensors, notfastsafetensors. - Check the baseline before you start and compare after you stop.
None of this is clever. Every item is a thing I believed was fine until the box stopped answering.