Review fixes for --cpu-balanced: the HOST PERFORMANCE line said
preference=performance even when the Intel requests took the balanced
preference, and the boot processor's second request added its new
minimum to the range beside its first, so requested_minimum read
lowest-highest. request_again now replaces that processor's minimum
(Tally::replace_minimum) without counting it again, while it is the only
processor recorded; the line names preference=balanced under
INTEL_BALANCED where a processor took an HWP request.
(PR #53)
On a 15 W Intel laptop (i5-1235U, Iris Xe) every core is held at its
highest HWP level, so the package sits at PL1 and the integrated GPU
runs at 100 MHz. WindowServer then fills its GPU memory budget and is
killed during Setup Assistant (as in #35).
--cpu-balanced keeps each core's highest level but sets the minimum to
its lowest and the energy preference to 0x80 (balanced), so idle cores
drop their clocks and the package budget reaches the GPU. The boot
processor asks again once the options are read; the APs take the
balanced request from the start. Off unless given.
(PR #53)
rqffael's Latitude 5340 (i7-1365U, Iris Xe 8086:a7a1) drew corrupted UI
and lost its GPU to "context reset due to GPU hang" until he set
INTEL_DEBUG=noccs in the C library's environment beside
ANV_SYS_MEM_LIMIT; after it the session ran more than 13 minutes and
8,465 submissions with no hang, ENOMEM or crash. RADV already runs with
DCC off for the same unified layouts, where an image a copy fills and a
shader samples read back blank.
getenv now answers INTEL_DEBUG=noccs unless the boot keeps CCS on
(stela_libc_intel_ccs, from the hand-written --intel-ccs option); nothing
else sets INTEL_DEBUG. The display's scanout buffers and the shared
IOSurface images are linear-modifier images, so nothing assumes a CCS
modifier. The kernel fixes his issue lists are in the series already:
0236 takes the guc_id before the lock and 0237 the i915_active node
before the tree's lock, as his patches do.
Reported-by: rqffael <https://github.com/rqffael>
With \EFI\stela\choices.cfg on the stick, stela.efi boots the chosen
entry's options line (NAME, a tab, the options) and reads none of
stela.cfg's; stela.cfg holds the default entry for a boot without
choices. The boot log now says which line ran, and test 7's instructions
name choices.cfg.
MGKFN's i5-1235U Iris Xe hung with the GPU at 400 MHz of the 1200 RPS
asked for, which only the reset's line said. The render engine's
heartbeat now reads the actual and requested frequency, the RPS range and
the package's limit reasons (PROCHOT, thermal, RATL, VR thermal alert,
VR TDC, PL4, PL1, PL2 and the sticky log above them) and says them in one
line: at most every 30 s while it beats, and at each beat that finds a
heartbeat request stuck. Engines other than render say nothing.
link_varyings links an input to an output of the same identifier, scalar
type and component count. Its refusal now carries, once for each pipeline
line, VARYINGS unlinked fragment inputs [identifier:TypexN (the output of
its identifier is ... | no output of its identifier)] of N inputs; vertex
or mesh outputs [...]. The matching is unchanged: whether Metal links a
half output to a float input, or a fragment input with fewer components,
is not established, so nothing new links until a log shows what RenderBox
asks for.
The stencil resolve that follows a min or max depth resolve resolves
copies of the stencil's samples, which take multisampled storage images,
which ANV reports on no Intel GPU. Unless the boot asks for the strict
families, Apple5 now takes the stencil resolve alone, as Apple4 and Apple1
already went without their multisampled parts; render_pass refuses a
pass that asks for the following resolve, which a test holds on ANV's
capabilities.
Apple6 takes sparse textures, vertex amplification, function pointers
and dynamic libraries in render pipelines, texture atomics and ASTC HDR
sampling, none of which takes multisampled storage, so it holds or not by
its own checks. On i915, ANV has sparse residency through TR-TT on Gen12
and multiview; ASTC HDR is sampled decoded. The ANV fixture holds Apple6,
and Apple7 still takes Metal3. The boot log's family note names what is
claimed without multisampled storage images and the first family the
GPU is out of, with what it lacks of it. NVIDIA and AMD derive what they
did.
recover() reopened a lost device only once no connection held an object
of it. MGKFN's test 6 boot lost its Iris Xe at 414 s; a connection of the
lost epoch, likely the Language Chooser, kept 47 objects of 227 MiB, the
device never reopened, and WindowServer crashed in a loop until the end.
dev64 recovered only because his clients closed.
The next connection or close after a loss now reopens. A connection of
the lost epoch keeps its objects with the lost device, which the
reopened one replaces: its calls but releases are refused as before, a
release lets go of its handle alone, and its close leaves the reopened
device untouched. The lost device retires as before: one whose backend
cannot prove its queue idle keeps every handle and its memory, so no DMA
reaches freed memory. A reopen despite held objects says how many
connections and objects stayed with the lost device.
After test 4's GPU loss the reopened device held 0 MiB, yet Linux held
3500 MiB of the GPU's 7598 MiB share and the memory the guest works in
fell from 5590 MiB to 2949 MiB. A replaced lost device whose backend
cannot prove its queue idle, as a lost Vulkan device's idle wait cannot,
is dropped with every handle and its memory kept, so that no DMA the
GPU may still run reaches freed memory. That stays as it is; the GPU
MEMORY line now says lost_devices=retiring:N/kept:N/MiB.
New and recycled textures are cleared at the start of the next
submission, and a heap's memory is filled with zero bytes when the heap
takes it, but a texture placed in an automatic heap was neither: a range
freed by an earlier texture of the heap reached the next one with its
bytes, and in a layout the driver compresses (AMD's DCC, NVIDIA's
compression tags, Intel's CCS) zero bytes do not read as zero texels.
Testers on AMD and NVIDIA see dark or garbage rectangles around round
elements such as the login avatar where they should be transparent;
that this is their cause is not proven.
A placement heap's textures stay as they were: they alias what the
client placed there, as on a Mac. The GPU MEMORY line counts the clears
(heap_cleared=), one per texture an automatic heap places.
The bundle opens each report with getprogname()[getpid()]; the service
keeps the first one each connection sends, and GPU HEAP NIL lines say
process=name[pid], or process=unnamed before the connection reported
anything.
RenderBox asks for Apple4 in com.apple.dock.extra, iconservicesagent,
ControlCenter and SecurityAgent on dev64's Iris Xe in tests 4 and 5, and
the device said it was not in it. dev64's icons draw in the Clear and
Tinted styles and stay blank in Default.
ANV reports shaderStorageImageMultisample on no Intel GPU. Apple4 took
multisampled framebuffer reads, which take multisampled storage views,
and Apple1 took multisampled 16-bit packed render targets, which a
driver that cannot render a packed format itself writes through
multisampled storage views of its raw texels. Unless the boot asks for
the strict families, such a device now claims Apple1, Apple2 and Apple4
with single-sample framebuffer reads and packed targets, as Apple3
already reads single-sample framebuffers; a pipeline that reads or tiles
a multisampled framebuffer (framebuffer_reads_at) and a multisampled
texture of a packed format without MSAA are refused one at a time, as
before. Apple5 still takes the stencil resolve that follows a depth
resolve, which takes multisampled storage images, so ANV stops at
Apple4.
The boot log names the claim, or what keeps a device in Apple3 out of
Apple4, after the family line, and --gpu-strict-families, a hand-written
stela.cfg option setup never writes, restores the strict families. A
device with multisampled storage images derives what it did.
dev64's Iris Xe hung in an execbuffer (0x40406469) once in test 4 and
twice in test 5. In test 4, i915 printed "context reset due to GPU hang"
5.6 s after the call was first reported; the call failed, the device was
lost and WindowServer restarted. In both test 5 boots the 10 s stop came
first, with no i915 line between the report and the stop, and "Fence
expiration time out" only after it.
i915 with GuC submission finds a stuck engine at a heartbeat (2.5 s),
raises its priority at the next one, and GuC then waits the Gen12 render
engine's preemption timeout (DRM_I915_PREEMPT_TIMEOUT_COMPUTE, 7.5 s)
before it resets the context: up to 12.5 s, longer than the stop. The
stop is now 30 s, twice that, and a test keeps it so. The waiting PE's
report says how long it waits, and a call that ends after the report
says when and with what result. i915's timeouts are unchanged.
Espresso, which mediaanalysisd runs its models with when there is no
Neural Engine, makes 16-byte no-copy buffers 8 bytes into a page
(0x781827ff58 at 725.9 s of dev64's test 4 boot). The frontend wired
[bytes, bytes + 16 KiB), the gate refused ranges that are not whole
pages, Metal answered nil and mediaanalysisd crashed 0.5 s later. It
crashed five times in 30 minutes, ReportCrashService restarting eleven
times to report them.
The frontend now imports the whole pages around the bytes and asks for a
buffer offset bytes into them. The VkBuffer starts at the driver's buffer
alignment below the bytes and the Metal buffer where they are: commands
take the start as the buffer's offset in its VkBuffer, as they do for
upload suballocations, and its address is the bytes'. Textures over such
a buffer are refused, as their rows are addressed from the VkBuffer's
start. A page-aligned address imports as before.