[GH-ISSUE #4912] [Engine] dsv41: GPU page fault (SIGABRT) after a pinned 37K-token prompt read on RX 9070 XT #2254

Open
opened 2026-11-04 01:57:57 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @PhialsBasement on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4912

Problem: the DeepSeek engine stopped at "reading the prompt: 36,942 of 37,719 tokens" (the prompt's pin= checkpoint position) for about 5 minutes, then exited with code -6. The kernel log shows a GPU page fault in strata-dsv41 at the start of that stall. The ROCm runtime then wrote a 15 GB GPU core dump into the Terminal folder (gpucore.<pid>), which accounts for about 2 minutes of the stall.

Environment:

  • Strata 0.1.55 (c62d5e3a), engine package 0.1.55-linux-x86_64-hip-rx9070 (stock binary)
  • CachyOS, kernel 7.3.0-4-cachyos
  • Radeon RX 9070 XT 16 GB (gfx1201), Ryzen 7 5800X3D, 64 GB DDR4, PCIe 3.0 NVMe
  • Model: deepseek-v4.1-flash-ist-das-1.75bpw, --max-context 1048576, --reserve-mib 2150, env DS4_READERS=4 DS4_READAHEAD_MB=64
  • Client: OpenCode 1.18.34 through /v1/chat/completions

Reproduce: one occurrence. A 37,719-token prompt with pin=36942, read from 0 reused tokens. I did not reproduce it on demand: a synthetic 40,100-token prompt with a pin and a 35K-token tail later completed normally on a locally built engine that includes the change below, and a 12,500-token prompt pinned at 11,205 completed on the stock engine.

Expected: the prompt finishes reading, or a readable error.

Actual: the server log printed the same progress line ("36,942 of 37,719 tokens") from about 290 s on, then:

[strata] the engine stopped unexpectedly (exit code -6). The usual cause is running out of RAM ...

There was no OOM in the kernel log. It had this instead (first block of several identical ones):

amdgpu 0000:0b:00.0: [gfxhub] page fault (src_id:0 ring:24 vmid:8 pasid:7221)
amdgpu 0000:0b:00.0:  Process strata-dsv41 pid 2839332 thread strata-dsv41 pid 2839332
amdgpu 0000:0b:00.0:   in page starting at address 0x00007edfaf3fb000 from client 10
amdgpu 0000:0b:00.0: GCVM_L2_PROTECTION_FAULT_STATUS:0x00801031
amdgpu 0000:0b:00.0:          Faulty UTCL2 client ID: TCP (0x8)
amdgpu 0000:0b:00.0:          MORE_FAULTS: 0x1
amdgpu 0000:0b:00.0:          WALKER_ERROR: 0x0
amdgpu 0000:0b:00.0:          PERMISSION_FAULTS: 0x3
amdgpu 0000:0b:00.0:          MAPPING_ERROR: 0x0
amdgpu 0000:0b:00.0:          RW: 0x0

A shader read (TCP, RW 0) of a page that was mapped but denied. The address is about 3.7 GB above the highest VRAM segment in the GPU core dump, so it looks like host-mapped memory.

Suspected path (unconfirmed static analysis): PP 36942 is printed only after the first feed (36,942 tokens) and checkpoint(3) return, so the fault came during feed_mark(777, slot 1) or from GPU work of the first run that was still queued. The first run is multi-chunk, so it likely ran layer-major (lm_begin), which allocates the pinned lm_state (about 2.4 GB here) and the RAM layer cache c.lc. lm_end frees both after synchronizing devs[di].st and c.cs only. Work queued on another stream that still reads them would read freed host memory, which fits the fault above.

Proposed change (one line in lm_end, before the frees):

cudaDeviceSynchronize();   // wait for all streams before freeing

With it, no fault in the sessions since (several 37K-54K-token OpenCode prompts, a 40K-token synthetic one). That is absence of a rare failure, so I would welcome a maintainer's view on whether another stream can still hold work at that point. DS4_LAYER_MAJOR=0 should avoid the path entirely if someone can reproduce it.

Reproduction status: observed once in normal use (logs above); the root cause is a hypothesis from reading the code.

Originally created by @PhialsBasement on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4912 Problem: the DeepSeek engine stopped at "reading the prompt: 36,942 of 37,719 tokens" (the prompt's `pin=` checkpoint position) for about 5 minutes, then exited with code -6. The kernel log shows a GPU page fault in `strata-dsv41` at the start of that stall. The ROCm runtime then wrote a 15 GB GPU core dump into the Terminal folder (`gpucore.<pid>`), which accounts for about 2 minutes of the stall. Environment: - Strata 0.1.55 (c62d5e3a), engine package `0.1.55-linux-x86_64-hip-rx9070` (stock binary) - CachyOS, kernel 7.3.0-4-cachyos - Radeon RX 9070 XT 16 GB (gfx1201), Ryzen 7 5800X3D, 64 GB DDR4, PCIe 3.0 NVMe - Model: deepseek-v4.1-flash-ist-das-1.75bpw, `--max-context 1048576`, `--reserve-mib 2150`, env `DS4_READERS=4 DS4_READAHEAD_MB=64` - Client: OpenCode 1.18.34 through `/v1/chat/completions` Reproduce: one occurrence. A 37,719-token prompt with `pin=36942`, read from 0 reused tokens. I did not reproduce it on demand: a synthetic 40,100-token prompt with a pin and a 35K-token tail later completed normally on a locally built engine that includes the change below, and a 12,500-token prompt pinned at 11,205 completed on the stock engine. Expected: the prompt finishes reading, or a readable error. Actual: the server log printed the same progress line ("36,942 of 37,719 tokens") from about 290 s on, then: ``` [strata] the engine stopped unexpectedly (exit code -6). The usual cause is running out of RAM ... ``` There was no OOM in the kernel log. It had this instead (first block of several identical ones): ``` amdgpu 0000:0b:00.0: [gfxhub] page fault (src_id:0 ring:24 vmid:8 pasid:7221) amdgpu 0000:0b:00.0: Process strata-dsv41 pid 2839332 thread strata-dsv41 pid 2839332 amdgpu 0000:0b:00.0: in page starting at address 0x00007edfaf3fb000 from client 10 amdgpu 0000:0b:00.0: GCVM_L2_PROTECTION_FAULT_STATUS:0x00801031 amdgpu 0000:0b:00.0: Faulty UTCL2 client ID: TCP (0x8) amdgpu 0000:0b:00.0: MORE_FAULTS: 0x1 amdgpu 0000:0b:00.0: WALKER_ERROR: 0x0 amdgpu 0000:0b:00.0: PERMISSION_FAULTS: 0x3 amdgpu 0000:0b:00.0: MAPPING_ERROR: 0x0 amdgpu 0000:0b:00.0: RW: 0x0 ``` A shader read (TCP, RW 0) of a page that was mapped but denied. The address is about 3.7 GB above the highest VRAM segment in the GPU core dump, so it looks like host-mapped memory. Suspected path (unconfirmed static analysis): `PP 36942` is printed only after the first feed (36,942 tokens) and `checkpoint(3)` return, so the fault came during `feed_mark(777, slot 1)` or from GPU work of the first run that was still queued. The first run is multi-chunk, so it likely ran layer-major (`lm_begin`), which allocates the pinned `lm_state` (about 2.4 GB here) and the RAM layer cache `c.lc`. `lm_end` frees both after synchronizing `devs[di].st` and `c.cs` only. Work queued on another stream that still reads them would read freed host memory, which fits the fault above. Proposed change (one line in `lm_end`, before the frees): ```cpp cudaDeviceSynchronize(); // wait for all streams before freeing ``` With it, no fault in the sessions since (several 37K-54K-token OpenCode prompts, a 40K-token synthetic one). That is absence of a rare failure, so I would welcome a maintainer's view on whether another stream can still hold work at that point. `DS4_LAYER_MAJOR=0` should avoid the path entirely if someone can reproduce it. Reproduction status: observed once in normal use (logs above); the root cause is a hypothesis from reading the code.
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#2254
No description provided.