Skip to content

drm/asahi: g17: wait for render backing as long as for a compute queue - #1852

Open
DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/g17-capacity-waits
Open

DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/g17-capacity-waits

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

G17P clients lost their device with no GPU fault and no recovery while several of them created and destroyed devices concurrently: the kernel logged GPU work of a client failed (EBUSY, ...) right after the shared lower GPU VA window started refusing allocations, and the client saw VK_ERROR_DEVICE_LOST.

A render whose pair or free-list backing does not fit the shared lower VA window waits for capacity: idle backing is reclaimed and the publisher sleeps until a pair, lease or owner returns. That wait was bounded at one job poll (2 s). Under concurrent clients, other owners' backing comes back only as their pairs and pools are released, which regularly takes longer, so the unpublished render failed with EBUSY. A compute publication waits up to QUEUE_WAIT_NS for the same kind of capacity, as does a render waiting for a channel.

This bounds the render capacity wait the same way (QUEUE_WAIT_NS from its start, still at most the recovery wait). It only lengthens a wait for unpublished work, which the scheduler's timeout already treats as not hung; nothing changes in what is published or how. tools/asahi/g17-capacity-backoff-tests.py now checks the new bound (its storm and quiet cases end at the wait's bound with attempt limits scaled to the longer wait; the release case and both negative controls are unchanged).

Testing (Neo, J700/G17P, test boot of the default kernel's module with this change on top):

  • Four concurrent dEQP-VK synchronization2 clients for 60 s: no lost device, no EBUSY, no GPU kernel line. The shared lower window peaked at 963 MiB of 1.94 GiB with no refusal, so this run did not reach the exhaustion that triggered the lost device; it shows no regression, not the fix under pressure. A heavier run that drives the window into refusals follows before merge.
  • A 984-case synchronization2 sample on three concurrent processes: all pass, no GPU kernel line.
  • Host: g17-capacity-backoff-tests, g17-compute-deadline-tests, g17-compute-growth-deadline-tests and g17-compute-constructor-tests pass.

🤖 Generated with Claude Code

A render whose pair or free-list backing does not fit the shared lower
GPU VA window (ENOSPC) waits for capacity: idle backing is reclaimed and
the publisher sleeps until a pair, lease or owner returns. That wait
gave up after one job poll (2 s) and failed the unpublished render with
EBUSY, which the client sees as a lost device. Under concurrent clients
that create and destroy devices, other owners' backing comes back only
as their pairs and pools are released, which regularly takes longer: a
client then lost its device with no GPU fault at all, right after the
window's first refusals.

Bound the wait like a compute publication's wait for a queue, and like
a render's wait for a channel (QUEUE_WAIT_NS from its start, still at
most the recovery wait). The host test of the production wait now
checks that bound; its attempt limits scale with the longer wait.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/g17-capacity-waits branch from ac881e8 to e8ba050 Compare November 13, 2026 19:03
@DjDeveloperr DjDeveloperr changed the title drm/asahi: g17: don't lose a client's device on a short capacity wait drm/asahi: g17: wait for render backing as long as for a compute queue Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant