223% CPU on a NAS: Moving an Electron Container Onto the iGPU
Five llvmpipe Threads Eating 223% CPU
That DSM box exists to serve files and a few light containers, yet its host load1 sat at 10.83. The machine was simply busy all the time, and the work was not where I expected it.
I traced most of it to one container:
$ docker stats --no-stream --format '{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}'
grass-node 223% 293MiB / 1GiB
223% is 2.2 of 8 threads, sustained. The workload is a bandwidth-sharing client built as an Electron application, so it carries a Chromium renderer and draws a UI. With a working GPU path that UI costs under 1% CPU. On a host with no GPU path, every frame is rasterised by the CPU.
What told me which path it was on was the thread names inside the container, and whether a GPU device node existed at all:
# thread names live in /proc/<pid>/task/<tid>/comm, not in /proc/<pid>/maps
docker exec grass-node sh -c '
ls /dev/dri 2>&1
for t in /proc/[0-9]*/task/[0-9]*/comm; do cat "$t" 2>/dev/null; done \
| sort -u | grep -E "llvmpipe|SkiaGPUWorker"
'
# ls: /dev/dri: No such file or directory
The thread list on DSM came back with five entries, llvmpipe-1 through
llvmpipe-5, and no SkiaGPUWorker. The container had no /dev/dri, so Mesa
fell back to its software rasteriser and ran five raster threads to draw the
UI.
Two things I keep separate here, because they get conflated:
- The CPU number is real work. Rasterisation is not a stall; it is the CPU doing exactly what it was asked to do.
topwas not lying, the workload was misconfigured. - The fix is not a bigger CPU limit. Raising
cpus:only changes how fast the wrong path runs. The path itself has to change.
Passing /dev/dri Into grass-node on unRaid
The node shares a stack with two other containers. One was worth moving on its own numbers; the other had to follow because it reaches the node by container name:
| Container | Role | Verdict |
|---|---|---|
grass-node | Electron UI and sharing client, 223% CPU | move — this is the renderer |
grass-web | noVNC viewer, CPU not sampled on its own | move — it finds the node by its docker network name, so left behind it is useless |
honeygain | Up 9 days, untouched | stays — no reason to disturb it |
The last row was a deliberate non-move. honeygain had been Up for nine days
on DSM stack 295, and rebuilding a stable idle container just to keep a stack
tidy buys nothing.
The destination is my unRaid host (stack 319): an i9-13900K with an Intel UHD 770 — the integrated GPU that was already there and idle, not a discrete card. On top of the existing service definition I changed four settings:
services:
grass-node:
image: grass-node # unchanged from the DSM stack
devices:
- /dev/dri:/dev/dri # the point of the move
group_add: ["18"] # host GPU device group GID
cpus: "2.5"
mem_limit: 1024m
The data directory went to /mnt/ssd/docker/grass/ on that host.
What made this a comparison instead of a before/after anecdote was the sampling
rule: same workload state, same sample length, both hosts. Three minutes
each. On the unRaid run grass-sdk/sharing=on was active with NetIO at 2.9 MB
in and 2.4 MB out, which confirms the node was not idle while it was sampled:
| DSM (8 threads, no /dev/dri) | unRaid (i9-13900K + UHD 770) | |
|---|---|---|
grass-node CPU | 223% (2.2 of 8 threads) | 0.11–0.63% |
| RSS | 293 MiB | 68–273 MiB |
| Host load1 | 10.83 | 5.52 |
| Render path | five llvmpipe raster threads | libEGL_mesa mapped, 0 llvmpipe threads |
| GPU worker | no SkiaGPUWorker in the thread list | SkiaGPUWorker present |
The two load1 numbers are not a before/after pair. 10.83 was measured on DSM with grass-node running there; 5.52 was measured on the unRaid host after the move, with grass-node using under 1% CPU on it. Different hardware, and I did not re-sample DSM after removing the container.
RSS ranged from 68 to 273 MiB on unRaid against 293 MiB on DSM, while CPU went from 223% to 0.11–0.63%.
Verifying the Render Path and Rollback State
Up proves nothing about whether the UI works, so I checked three things:
- The UI answers: noVNC returns
HTTP 200at192.168.1.6:5800, and the node’s own log shows it registered. - The render path is the GPU: no
llvmpipethread names inside the container,libEGL_mesamapped,SkiaGPUWorkerpresent. - Rollback is intact:
/volume1/docker/grass/{config,data}on DSM was left untouched, so adocker compose upon the old host brings it back.
Two costs I am recording here rather than dressing up. The node registered a
new device identity on the unRaid host (created=true in its log) —
wipe-then-register is expected behaviour, and it means the dashboard shows a
new device while network quality warms up over 15–30 minutes. And the 90 KB
auth state now lives under /mnt/ssd/docker/grass/, outside unRaid Appdata
Backup coverage, so it currently has no automated backup.
🔍 View the measurement and render-path checks (both hosts, 3-minute window)
# on each host, with the workload in the same state
for i in $(seq 1 3); do
docker stats --no-stream --format \
'{{.Name}} cpu={{.CPUPerc}} mem={{.MemUsage}} net={{.NetIO}}' grass-node
sleep 60
done
uptime # host load1, for the box-level view
# render path: thread names first, then the graphics libraries each process mapped
docker exec grass-node sh -c '
for t in /proc/[0-9]*/task/[0-9]*/comm; do cat "$t" 2>/dev/null; done \
| sort -u | grep -E "llvmpipe|SkiaGPUWorker"
for p in /proc/[0-9]*; do
h=$(grep -o "libEGL[a-z_]*" "$p/maps" 2>/dev/null | sort -u)
[ -n "$h" ] && echo "$(cat "$p/comm"): $h"
done
'
223% Down to Under 1%, With Two Caveats
- 223% → 0.11–0.63% for the same workload, same sharing state, three-minute samples on both hosts.
- Five llvmpipe rasteriser threads → zero, with
libEGL_mesamapped and aSkiaGPUWorkerrunning. - load1 10.83 on DSM, 5.52 on the unRaid host that took over — different hardware, and no post-removal DSM sample.
- Hard limits stay on unRaid (
cpus: "2.5",mem_limit: 1024m), so a second fallback to software rendering is capped at 2.5 cores and 1024 MiB rather than whatever the host happens to allow. - Rollback stayed intact the whole time, and the one service that did not need to move was not touched.
What I take from this is narrower than “move things to a machine with a GPU”.
In this migration an Electron container without /dev/dri fell back silently
to llvmpipe software rendering; container health checks and CPU caps did not
flag the fallback — checking the running process’s loaded graphics libraries
and worker threads did.
Want a 24/7 bot or automation pipeline that never drops a lead?
Don't let customer inquiries slip away at midnight or on weekends. I build custom Telegram/WhatsApp AI assistants and deterministic workflows that connect directly to your catalogue, CRM, and order fulfillment.