Skip to content

drm/asahi g17: multiview query timestamps wrong on main (regression since 11-16, J700) #3243

In progress

Description

@DjDeveloperr

What happens: on a J700 (G17P), Vulkan multiview query/timestamp CTS cases now fail with Fail (timestamp). They pass on the 7.3.0-41 kernel from 11-16.

Cases:

  • dEQP-VK.multiview.{renderpass2,dynamic_rendering}.{queries_and_timestamps,non_precise_queries_and_timestamps,non_precise_queries_with_availability_and_timestamps}.{get_query_pool_results,cmd_copy_query_pool_results}.*, plus readback_explicit_clear.no_queries.*. 48 cases in all.
  • First failure: dEQP-VK.multiview.dynamic_rendering.non_precise_queries_and_timestamps.get_query_pool_results.1_2_4_8.

Measured on the J700, same session, system Mesa 26.3.0-30, cases run one at a time:

  • 7.3.0-41 (11-16): 48/48 Pass.
  • main 255761f1d55f (+ unrelated security PRs): 42 Fail, 6 Pass. All failures are "Fail (timestamp)".
  • main 7be48f37 + an unrelated PR: the same failures.
  • With hard faults enabled: 0 MMU faults, 0 recoveries, 0 WARN/BUG. Nothing is refused; the timestamp values themselves are wrong.

Suspects (G17 timestamp-path merges between 11-16 and now): #2531 (timestamp window), #3139 (publication overlap), #2552 (cross-engine overlap), and c139054181d2.

Not yet known:

  • whether G17S (J714s) and G16 are affected too;
  • which of the merges is the cause.

Activity

  1. DjDeveloperr commented on Nov 26, 2026

    @DjDeveloperr
    ContributorAuthor

    Culprit: the #2552 merge, f0c5cb1a80eb ("drm/asahi: overlap cross-engine commands with timestamped producers on G17", merged 11-24). It was bisected on the J700 (MacBook Neo, G17P) with one-shot kernels built from the Neo config.

    Every boot ran the same 48 cases, one at a time: dEQP-VK.multiview.{renderpass2,dynamic_rendering}.*queries*timestamps*, the matching cmd_copy_query_pool_results cases and readback_explicit_clear.no_queries. The Mesa was the same throughout (stock 26.3.0-30), with soft faults. Every failure is Fail (timestamp).

    boot kernel 48 cases
    stock 7.3.0-41 (11-16) 48 Pass
    control main 255761f + other PRs, without #3225 42 Fail / 6 Pass
    ts2 main 255761f with #2531 reverted 42 Fail / 6 Pass
    ts3 main cb7ea62102a8 (11-24), the first parent of the #2552 merge 48 Pass
    ts4 main f0c5cb1a80eb, the #2552 merge 42 Fail / 6 Pass
  2. added
    area:gpu
    on Nov 27, 2026
  3. RyanTheTide commented on Nov 27, 2026

    @RyanTheTide
    Contributor

    #3246 is the repair for timestamp publication ordering. Keep this linked through the multiview timestamp suite and a concurrent submit row on G17P.

  4. added
    tracking
    on Nov 29, 2026
  5. RyanTheTide commented on Nov 29, 2026

    @RyanTheTide
    Contributor

    The A/B in #3246 reproduced the same timestamp failures on both J714s and J700, and the change was withdrawn. The multiview regression remains open for a root-cause fix and a rerun of both GPU rows.

  6. RyanTheTide commented on Nov 30, 2026

    @RyanTheTide
    Contributor

    I checked the exact-head J700 row and J714s row on #3443. The J700 list covers synchronization, command buffers, render-pass suballocation and occlusion-query copies. The J714s list includes multiview.queries.* and pipeline.monolithic.timestamp.basic_graphics_tests.*. The failing multiview.dynamic_rendering and multiview.renderpass2 query-and-timestamp groups listed here still need a direct run.

    For the next GPU batch, please keep the existing J700 and J714s slots and record the exact case lists and result on both boards, with the kernel and Mesa revisions. Include non_precise_queries_and_timestamps.get_query_pool_results.1_2_4_8 and keep the copy-query and explicit-clear controls from the original report. #3246's failed A/B and #2552's first-parent bisect remain the reference points.

  7. RyanTheTide commented on Dec 5, 2026

    @RyanTheTide
    Contributor

    Code audit of origin/main (9a89b412ca50c), the bisected #2552 merge (f0c5cb1a80eb), and Borealis/VK-GL-CTS traces the root cause to a pre-mesa#578 Borealis bug on in-pass timestamp copies rather than a bug in g17/queue/mod.rs:

    Root cause

    1. What the CTS test records: vktMultiViewRenderTests.cpp:3300-3320 issues two vkCmdWriteTimestamp(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, ...) calls inside the same multiview render pass — first to timestampStartQueryPool, then after drawing to timestampEndQueryPool — and checks m_timestampEndValues[ndx] > 0 && m_timestampEndValues[ndx] >= m_timestampStartValues[ndx] (:3086).
    2. Pre-mesa#578 Borealis mis-flagged the copy as NO_QUERY_ACCESS: Both the J714s system Mesa (vk-aac82bea8e, 2026-11-14) tested on #3246 and the J700 stock Mesa (26.3.0-30) predate aurora-silicon/mesa#578 (f424007470e9, merged 2026-11-21). In src/asahi/vulkan/hk_sync.c:1353-1356 at aac82bea8e, the second in-pass timestamp emits libagx_copy_timestamp(..., AGX_BARRIER_ALL | AGX_POSTGFX, req.addr, gfx->timestamp.end.addr) into post_gfx without setting cs->query_access = true. asahi_fill_cdm_command() (hk_queue.c:154) then checks !cs->query_access and sets DRM_ASAHI_COMPUTE_NO_QUERY_ACCESS on a compute command that reads gfx->timestamp.end.addr (timestampStartQueryPool[i]), which is host-published when the render retires.
    3. Why #2552 exposed it and #3246 did not fix it:
      • Before #2552 (cb7ea62102a8), cross-engine consumers waited on fences.ready, which was fences.completed for timestamped renders, so the kernel ignored DRM_ASAHI_COMPUTE_NO_QUERY_ACCESS cross-engine and masked the missing flag in Borealis.
      • #2552 (f0c5cb1a80eb) honored DRM_ASAHI_COMPUTE_NO_QUERY_ACCESS cross-engine, letting libagx_copy_timestamp run in firmware before the render published timestampStartQueryPool[i] on the host. It copied LIBAGX_QUERY_UNAVAILABLE (UINT64_MAX) into timestampEndQueryPool[i]. Because vktMultiViewRenderTests.cpp:3397 calls getQueryPoolResults without VK_CHECK, Borealis hit the idle-unavailable fallback (0), failing m_timestampEndValues[ndx] > 0 with Fail (timestamp). (In dEQP-VK.pipeline.*.timestamp.*, waiting on the copied LIBAGX_QUERY_UNAVAILABLE hit the 2 s timeout / VK_ERROR_DEVICE_LOST seen in #3246.)
      • #3246 only added writes_timestamps (has_outputs) to cross_engine_wait_completed(); the post_gfx libagx_copy_timestamp command has has_outputs == false and (in pre-#578 Borealis) query_access == false, so it still overlapped.
      • On J714s, cmd_copy_query_pool_results passed 48/48 because vktMultiViewRenderTests.cpp:3339-3385 copies only occlusionQueryPool into queryBuffer and memcpys that buffer into both timestampStartQueryResultsBuffer and timestampEndQueryResultsBuffer.

    Current status

    • Kernel (origin/main 9a89b412ca50c): EnqueueOrdering::build() in drivers/gpu/drm/asahi/g17/queue/mod.rs already host-waits any compute command with query_access == true (no DRM_ASAHI_COMPUTE_NO_QUERY_ACCESS) behind pending host-timestamp writers. No kernel change or #2552 revert is needed.
    • Borealis: Fixed in aurora-silicon/mesa#578 (f424007470e9, tracking query ranges on timestamp copies so overlapping copies omit DRM_ASAHI_COMPUTE_NO_QUERY_ACCESS), further covered by aurora-silicon/mesa#918 (aa14512c8f72, verified 1,094/1,094 pass on dEQP-VK.pipeline.*.timestamp.* + dEQP-VK.multiview.*timestamp* on J714s), aurora-silicon/mesa#1368 (23a93d988ef3), and aurora-silicon/mesa#1561.
    • Next step: Re-run the 48 J700 and 112 J714s multiview query/timestamp cases on current main paired with Borealis >= f424007470e9 (current aurora-wip) to confirm and close.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:gputracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions