📌 Part of Blueprint: Production Self-Hosted Infrastructure → L1: Compute, Storage & Hybrid Network

223% CPU on a NAS: Moving an Electron Container Onto the iGPU

· 6 min read · Case Studies dockerelectronigpullvmpipecpu-profilingsynologyunraidcontainers

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:

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:

ContainerRoleVerdict
grass-nodeElectron UI and sharing client, 223% CPUmove — this is the renderer
grass-webnoVNC viewer, CPU not sampled on its ownmove — it finds the node by its docker network name, so left behind it is useless
honeygainUp 9 days, untouchedstays — 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 CPU223% (2.2 of 8 threads)0.11–0.63%
RSS293 MiB68–273 MiB
Host load110.835.52
Render pathfive llvmpipe raster threadslibEGL_mesa mapped, 0 llvmpipe threads
GPU workerno SkiaGPUWorker in the thread listSkiaGPUWorker 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:

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

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.

🚀 Automation & Custom AI Systems

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.

Lee Teong Hoe

Lee Teong Hoe · Mr Hoelee

Full-stack developer & DevOps engineer based in Malaysia. I run my own production infrastructure and build web systems for small businesses — this blog is the living record.

Hiring? Profile & stack · Malaysian SME? Website design & development ↗ · All posts