[GH-ISSUE #2729] [Bug]: gfx1100 (RX 7900 XT 20 GB, 31 GiB RAM): amdkfd SVM restore hangs and kswapd order-0 alloc failures persist with HSA_USERPTR_FOR_PAGED_MEM=0; suspend with the SVM mapping active never resumes #1090

Closed
opened 2026-11-04 01:48:25 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Smuggz69 on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2729

What happened

Four kernel-level events on one box, all in the amdkfd/SVM restore paths, on a 31 GiB RAM / 20 GB VRAM machine. Two of them are evidence the published workaround does not cover: HSA_USERPTR_FOR_PAGED_MEM=0 removes the amdkfd hang, but not the reclaim pressure behind it, and suspend/resume with the SVM mapping active never returns.

This is a second machine for the mechanism in #1705 (that box had 125 GiB RAM and the env var ended everything there). We are filing a new issue that links it, per the closing note there, because the new evidence below is not in #1705. Related: #750, #920, and the compaction-stall docs section being added in #2413.

Environment

  • Engine 0.1.43.1, HIP backend (build-hip, archs gfx1100), args --resident-experts --vram-reserve-mib 3072 --kv int8
  • AMD Radeon RX 7900 XT 20 GB (gfx1100), one GPU, also drives the desktop (Wayland)
  • CachyOS (Arch), kernel 7.2.9-2-cachyos PREEMPT, 31 GiB RAM, zram swap, zswap off, model files on NVMe
  • Qwen3.8-Flash-Next, 131072 ctx, expert pool 14.2-20.6 GiB held as one paged SVM region (STRATA_RESIDENT_PIN=0, per the ~32 GB box guidance in TROUBLESHOOTING #649)
  • One long-lived engine process; expert pages migrate RAM<->GPU under normal inference load

Events 1 and 2 - 2026-10-12, before the env var was set

1. 12:38:28 - kworker in D state inside svm_range_restore_work, then the box died (boot ended 12:38:47, manual reboot 12:42):

Workqueue: events_freezable svm_range_restore_work [amdgpu]
Call Trace:
 ? walk_pgd_range+0x460/0xea0
 ? walk_page_range_mm_unsafe+0x149/0x330
 ? hmm_range_fault+0x78/0xb0
 ? amdgpu_hmm_range_get_pages+0xcb/0x160 [amdgpu]
 ? svm_range_validate_and_map+0x633/0x18c0 [amdgpu]
 ? svm_range_restore_work+0xe1/0x370 [amdgpu]
 ? process_scheduled_works+0x1fa/0x690

followed by warn_alloc / kswapd0: page allocation failure: order:0.

2. 19:32:25 (also 13:03:10, 15:48:59) - hung task, engine unkillable until reboot:

INFO: task kworker/1:67:15296 blocked for more than 122 seconds.
Workqueue: events_freezable amdgpu_amdkfd_restore_userptr_worker [amdgpu]
Call Trace:
 __schedule+0x753/0x2270
 schedule+0x55/0x810
 schedule_preempt_disabled+0x30
 __mutex_lock+0x1e9/0x5d0
 amdgpu_amdkfd_restore_userptr_worker+0x82/0xad0 [amdgpu]

The mutex is held by svm_range_restore_work -> amdgpu_hmm_range_get_pages -> hmm_range_fault -> filemap_fault -> folio_wait_bit: the GPU's SVM expert restore waits inside a model-file page fault. At user level that is the prompt watchdog plus a 60-162 s freeze, then SIGABRT:

reading the prompt (batched): waiting for the GPU (attention, router) at layer 21
host idle 242 s, 7/7 workers parked, 24/24 jobs done, 0 threads on disk
no progress for 60 s during a request (issue #29)

The engine then exits -6 and the server restarts it. ~10 stalls/day on the Q2_0 tier.

Event 3 - 22:46:26, suspend with the engine loaded never resumed

Oct 12 22:46:26 systemd-logind[697]: suspend requested from client PID 1531 ('org_kde_powerde')
Oct 12 22:46:26 kernel: PM: suspend entry (deep)

Nothing after - no resume line, no amdgpu line. The box needed a hard power cycle (reboot 22:51:35). Third time suspend/resume with the Strata SVM mapping active has failed to come back, same class as event 1. This one is independent of the env var, so we stop the engine before suspend via a system-sleep hook.

Event 4 - 2026-10-13 12:53:52, WITH the workaround set

HSA_USERPTR_FOR_PAGED_MEM=0 and GPU_PINNED_MIN_XFER_SIZE=1048576 were both in the engine's env block for this run, and the reclaim pressure is still there:

Oct 13 12:53:52 kernel: kswapd0: page allocation failure: order:0,
  mode:0xc0de0(GFP_KERNEL|__GFP_HIGH|__GFP_ZERO|__GFP_COMP|__GFP_NOMEMALLOC)
Oct 13 12:53:52 kernel: PID: 141 Comm: kswapd0 Tainted: G U 7.2.9-2-cachyos
  warn_alloc <- __alloc_pages_slowpath <- __alloc_frozen_pages_noprof
  <- folio_alloc <- isolate_lock_cluster <- cluster_alloc_swap_entry
  <- folio_alloc_swap <- shrink_folio_list <- evict_folios <- kswapd

Same boot: coder tier (IQ1_M, expert pool 17.14 GiB, STRATA_RESIDENT_HEADROOM_GIB=8, --kv int8), 0 file-tier expert reads, MemAvailable 10 GiB, swap 0 used. 31 order-0 allocation failures in that boot. So on this box the env var removes the amdkfd hang (events 1-2 have not recurred with it set) but not the RAM side of the same subsystem.

What we would like upstream

  1. A note in the docs/AMD_HIP.md reclaim section that on a ~31 GiB box the env var ends the hang but not the order-0 reclaim failures, and that suspend with the SVM mapping active is a separate failure class - so people do not read "set the env var" as a complete fix.
  2. If it is cheap: a load-time warning when the resident expert complement plus headroom exceeds usable RAM, which is exactly the condition that produced events 1, 2 and 4 here.
  3. Nothing here is a request for new engine behaviour on the GPU side - the traces are kernel-side, and our box is now stable on the coder tier (0 file reads, 0 stalls).

Notes for triage

  • All four traces are in the SVM/amdkfd restore paths (svm_range_restore_work, amdgpu_amdkfd_restore_userptr_worker) - one subsystem.
  • The paged pool is one large SVM region (tens of GiB); page-ins/outs happen under normal inference load, not only during fault storms.
  • Bisect hint: events 1-2 predate HSA_USERPTR_FOR_PAGED_MEM=0; event 3 is the suspend path and is independent of it; event 4 is with it set.
  • We are on 0.1.43.1, not 0.1.44 - happy to re-test on 0.1.44 and reopen/comment here if any of the four classes still reproduces.
Originally created by @Smuggz69 on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2729 ## What happened Four kernel-level events on one box, all in the amdkfd/SVM restore paths, on a 31 GiB RAM / 20 GB VRAM machine. Two of them are evidence the published workaround does **not** cover: `HSA_USERPTR_FOR_PAGED_MEM=0` removes the amdkfd hang, but not the reclaim pressure behind it, and suspend/resume with the SVM mapping active never returns. This is a second machine for the mechanism in #1705 (that box had 125 GiB RAM and the env var ended everything there). We are filing a new issue that links it, per the closing note there, because the new evidence below is not in #1705. Related: #750, #920, and the compaction-stall docs section being added in #2413. ### Environment - Engine **0.1.43.1**, HIP backend (`build-hip`, archs `gfx1100`), args `--resident-experts --vram-reserve-mib 3072 --kv int8` - **AMD Radeon RX 7900 XT 20 GB (gfx1100)**, one GPU, also drives the desktop (Wayland) - **CachyOS** (Arch), kernel `7.2.9-2-cachyos` PREEMPT, **31 GiB RAM**, zram swap, zswap off, model files on NVMe - Qwen3.8-Flash-Next, 131072 ctx, expert pool 14.2-20.6 GiB held as one paged SVM region (`STRATA_RESIDENT_PIN=0`, per the ~32 GB box guidance in TROUBLESHOOTING #649) - One long-lived engine process; expert pages migrate RAM<->GPU under normal inference load ### Events 1 and 2 - 2026-10-12, before the env var was set **1. `12:38:28` - `kworker` in D state inside `svm_range_restore_work`, then the box died** (boot ended 12:38:47, manual reboot 12:42): ```text Workqueue: events_freezable svm_range_restore_work [amdgpu] Call Trace: ? walk_pgd_range+0x460/0xea0 ? walk_page_range_mm_unsafe+0x149/0x330 ? hmm_range_fault+0x78/0xb0 ? amdgpu_hmm_range_get_pages+0xcb/0x160 [amdgpu] ? svm_range_validate_and_map+0x633/0x18c0 [amdgpu] ? svm_range_restore_work+0xe1/0x370 [amdgpu] ? process_scheduled_works+0x1fa/0x690 ``` followed by `warn_alloc` / `kswapd0: page allocation failure: order:0`. **2. `19:32:25` (also `13:03:10`, `15:48:59`) - hung task, engine unkillable until reboot:** ```text INFO: task kworker/1:67:15296 blocked for more than 122 seconds. Workqueue: events_freezable amdgpu_amdkfd_restore_userptr_worker [amdgpu] Call Trace: __schedule+0x753/0x2270 schedule+0x55/0x810 schedule_preempt_disabled+0x30 __mutex_lock+0x1e9/0x5d0 amdgpu_amdkfd_restore_userptr_worker+0x82/0xad0 [amdgpu] ``` The mutex is held by `svm_range_restore_work` -> `amdgpu_hmm_range_get_pages` -> `hmm_range_fault` -> `filemap_fault` -> `folio_wait_bit`: **the GPU's SVM expert restore waits inside a model-file page fault.** At user level that is the prompt watchdog plus a 60-162 s freeze, then SIGABRT: ```text reading the prompt (batched): waiting for the GPU (attention, router) at layer 21 host idle 242 s, 7/7 workers parked, 24/24 jobs done, 0 threads on disk no progress for 60 s during a request (issue #29) ``` The engine then exits `-6` and the server restarts it. ~10 stalls/day on the Q2_0 tier. ### Event 3 - 22:46:26, suspend with the engine loaded never resumed ```text Oct 12 22:46:26 systemd-logind[697]: suspend requested from client PID 1531 ('org_kde_powerde') Oct 12 22:46:26 kernel: PM: suspend entry (deep) ``` Nothing after - no resume line, no amdgpu line. The box needed a hard power cycle (reboot 22:51:35). Third time suspend/resume with the Strata SVM mapping active has failed to come back, same class as event 1. **This one is independent of the env var**, so we stop the engine before suspend via a system-sleep hook. ### Event 4 - 2026-10-13 12:53:52, WITH the workaround set `HSA_USERPTR_FOR_PAGED_MEM=0` and `GPU_PINNED_MIN_XFER_SIZE=1048576` were both in the engine's `env` block for this run, and the reclaim pressure is still there: ```text Oct 13 12:53:52 kernel: kswapd0: page allocation failure: order:0, mode:0xc0de0(GFP_KERNEL|__GFP_HIGH|__GFP_ZERO|__GFP_COMP|__GFP_NOMEMALLOC) Oct 13 12:53:52 kernel: PID: 141 Comm: kswapd0 Tainted: G U 7.2.9-2-cachyos warn_alloc <- __alloc_pages_slowpath <- __alloc_frozen_pages_noprof <- folio_alloc <- isolate_lock_cluster <- cluster_alloc_swap_entry <- folio_alloc_swap <- shrink_folio_list <- evict_folios <- kswapd ``` Same boot: coder tier (IQ1_M, expert pool 17.14 GiB, `STRATA_RESIDENT_HEADROOM_GIB=8`, `--kv int8`), **0 file-tier expert reads**, MemAvailable 10 GiB, swap 0 used. 31 order-0 allocation failures in that boot. So on this box the env var removes the amdkfd hang (events 1-2 have not recurred with it set) but not the RAM side of the same subsystem. ### What we would like upstream 1. A note in the `docs/AMD_HIP.md` reclaim section that on a ~31 GiB box the env var ends the *hang* but not the order-0 reclaim failures, and that suspend with the SVM mapping active is a separate failure class - so people do not read "set the env var" as a complete fix. 2. If it is cheap: a load-time warning when the resident expert complement plus headroom exceeds usable RAM, which is exactly the condition that produced events 1, 2 and 4 here. 3. Nothing here is a request for new engine behaviour on the GPU side - the traces are kernel-side, and our box is now stable on the coder tier (0 file reads, 0 stalls). ### Notes for triage - All four traces are in the SVM/amdkfd restore paths (`svm_range_restore_work`, `amdgpu_amdkfd_restore_userptr_worker`) - one subsystem. - The paged pool is one large SVM region (tens of GiB); page-ins/outs happen under normal inference load, not only during fault storms. - Bisect hint: events 1-2 predate `HSA_USERPTR_FOR_PAGED_MEM=0`; event 3 is the suspend path and is independent of it; event 4 is with it set. - We are on 0.1.43.1, not 0.1.44 - happy to re-test on 0.1.44 and reopen/comment here if any of the four classes still reproduces.
Author
Owner

@Smuggz69 commented on GitHub (Oct 16, 2026):

Re-tested on 0.1.44.1 (compiled from source here, engine/BUILD.json version 0.1.44.1, archs gfx1100, source hash 7dfd34378bd2d32a) on the same box, 2026-10-16 00:0x CDT, one 31,064-token prompt through the same server config:

  • prefill 1144.9 tok/s, decode 46.4 tok/s (drafts 163 of 223 accepted) — on 0.1.43.1 the same config measured 1149.5 / 41.3, so prefill is flat and decode is +12%
  • expert cache hit 81.2% (140,292 / 172,800 lookups) — was 75.1% on 0.1.43.1
  • resident 17.14 GiB of experts, 12,850 exchanged with the VRAM tier, 0 blob reads from the file tier
  • hipBLASLt tuning enabled (26 rows, gfx1100, version 100200); PLE direct read probe 21,870 rows/s; ulimit -l unlimited, --ple-io left at its default direct
  • kernel journal since the upgrade: 0 amdkfd / svm_range lines, 0 hung-task reports, 0 page allocation failure (order:0). Events 1, 2 and 4 have not recurred, with HSA_USERPTR_FOR_PAGED_MEM=0 and GPU_PINNED_MIN_XFER_SIZE=1048576 still set

Caveats so this is read right: that is one request window, not a full day of load, and event 4 only ever showed up under sustained reclaim pressure — we will update here if an order-0 failure appears on 0.1.44.1. Event 3 (suspend with the SVM mapping active) is not re-testable in one sitting; the system-sleep hook still stops the engine before suspend, so we keep that as a workaround regardless of version.

Net: the same configuration is clean on this box on 0.1.44.1 for the first time, and the two numbers that matter (0 file-tier reads, 0 kernel events) are unchanged from the coder tier's behaviour on 0.1.43.1.

<!-- gh-comment-id:6208582479 --> @Smuggz69 commented on GitHub (Oct 16, 2026): Re-tested on **0.1.44.1** (compiled from source here, `engine/BUILD.json` version `0.1.44.1`, archs `gfx1100`, source hash `7dfd34378bd2d32a`) on the same box, 2026-10-16 00:0x CDT, one 31,064-token prompt through the same server config: - prefill **1144.9 tok/s**, decode **46.4 tok/s** (drafts 163 of 223 accepted) — on 0.1.43.1 the same config measured 1149.5 / 41.3, so prefill is flat and decode is +12% - expert cache hit **81.2%** (140,292 / 172,800 lookups) — was 75.1% on 0.1.43.1 - resident **17.14 GiB** of experts, 12,850 exchanged with the VRAM tier, **0 blob reads from the file tier** - `hipBLASLt tuning enabled (26 rows, gfx1100, version 100200)`; PLE direct read probe 21,870 rows/s; `ulimit -l` unlimited, `--ple-io` left at its default `direct` - kernel journal since the upgrade: **0** amdkfd / `svm_range` lines, **0** hung-task reports, **0** `page allocation failure` (order:0). Events 1, 2 and 4 have not recurred, with `HSA_USERPTR_FOR_PAGED_MEM=0` and `GPU_PINNED_MIN_XFER_SIZE=1048576` still set Caveats so this is read right: that is one request window, not a full day of load, and event 4 only ever showed up under sustained reclaim pressure — we will update here if an order-0 failure appears on 0.1.44.1. Event 3 (suspend with the SVM mapping active) is not re-testable in one sitting; the system-sleep hook still stops the engine before suspend, so we keep that as a workaround regardless of version. Net: the same configuration is clean on this box on 0.1.44.1 for the first time, and the two numbers that matter (0 file-tier reads, 0 kernel events) are unchanged from the coder tier's behaviour on 0.1.43.1.
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271210466 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1090
No description provided.