Files
mac_linuxgpu/scripts
geramyloveless deae4a3615 CodeSync (selector 90): a code-object load's cache invalidate, without a launch
Each hsa_executable_load_agent_code_object invalidated the GPU's code
caches by running a ComputeDispatch of an s_endpgm kernel. That cost
9.8-10 ms on an idle R9700, and a new LSE pass width loads 55-60 code
objects. The dispatch did three things:
1. rt_compute_cache_sync: the compute ring's upstream ACQUIRE_MEM, which
   invalidates and writes back the instruction, scalar, vector, GL1 and
   GL2 caches, waited for on its fence.
2. A KFD queue created for the launch (MES ADD_QUEUE), the kernel kicked,
   and its completion polled in 1 ms sleeps.
3. The queue destroyed again (MES REMOVE_QUEUE).
Only the first is cache work. The GCR invalidates it issues reach the
caches every queue uses, which the old path already relied on, since its
launch ran on a queue of its own.

CodeSync runs only that: rt_compute_cache_sync with the caller's timeout,
as a session client's async call. It touches no client memory, so a ring
that does not finish in time is reported as ETIMEDOUT and left to the
ring's own timeout and recovery, without freezing the device.
DEXT_RUNTIME_BUILD becomes 258, from which the runtime uses it.

test-dext-compute-production code-sync: one cache sync and no launch,
the timeout bounds, and a sync that times out reported without freezing
the device.
2026-10-06 10:31:02 -07:00
..