61a2efc7d355ed2b0c80d108ee4a3d4f11ca405e
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
61a2efc7d3 |
Fix the GPU test failures seen on the 3090, 5080, XTX, 780M and M3
What and why, per failure (all release, --cfg m2v_gpu): AMD RADV, Ubuntu Mesa 26.0.8 (RX 7900 XTX, Radeon 780M): - generated_executions faulted the GPU (amdgpu gfxhub page fault, ring reset): RADV before 26.2 skips re-emitting a compute pipeline it thinks is bound, so the second execution's implicit preprocess ran our kernel. New RuntimeDriverDefect::ImplicitPreprocessAfterExecutionSet (RADV at every identity but the measured clean 780M at 26.2.4): the runtime preprocesses every execution of a range explicitly, then a barrier, then runs them preprocessed. RUNTIME_VERSION 1183. - The validation executor's generated-commands replay had the same fault; it now preprocesses apart on the same defect (runtime's generated_commands::preprocess_apart, now public). - float_denormals under fast math: the test checked a / b, smoothstep and (a / b) * c bit for bit, but without VK_KHR_shader_fma (26.0.8) the fast reciprocal is the device's OpFDiv(1, y), within 2.5 ulp. Those words are now checked at Metal's edges there, in full elsewhere. NVIDIA 615.71.09 (RTX 3090, RTX 5080 Laptop): - render_commands_and_render_states_run_as_the_executor_compiles_them: the executor used Vulkan device addresses as Metal addresses, and NVIDIA's lie below 2^32, where a record's address names no buffer. An addressed allocation's guest address is now its device address read signed (RADV's are sign-extended) plus 2^47 + 2^32, one translation for every allocation. - the_runtime_probe_measures_the_test_device_consistently: two driver answers Vulkan does not allow (3090: a buffer read after a linear-image copy over the same memory in one submission reads stale bytes; both: an explicit linear pitch the driver does not lay out is moved, not refused) are listed with their evidence in the test; the runtime records neither. - exits (5 tests): vkDestroyDevice takes ~55 ms alone and up to 2 s beside other processes' GPU work on the 3090, so the exit-timing tests run alone (.config/nextest.toml); the 1.5 s limit is unchanged. - pipeline_records (5080): the test assumed the driver finds a pipeline only in byte-identical records, but NVIDIA's bytes vary per compile and the two formats share entry keys. It now copies a compute pipeline's record over the render state's records, which no driver can hit. - compile_worker (5080, under load): a worker faster than the 1 ms sampler left no peak RSS. Each worker now reports its own peak (VmHWM on Linux, ru_maxrss on macOS) and the parent takes the larger. - tests::completion (both, under load): slow rounds were the GPU starting late behind another process's ~200 ms busy kernel, or NVIDIA's vkQueueSubmit returning up to 64 ms late; the completion was seen within 1 ms of the moment it could be. A command buffer is now judged from the later of its GPU end and its submission's return where the device calibrates timestamps (from the commit elsewhere, as before). - first_use::new_resources_wait_for_no_gpu_work (both, under load): the busy kernel's rate came from one wall-clock run, which collapsed under load (3 of 28 calibrations), so the busy work lasted milliseconds. The rate is now the fastest of every run at every size by GPU time, for all four lanes that share it (gpu_times::read_kinds predicts the notice a GPU time read emits, for the neutrals test). Apple M3 Max, MoltenVK 1.4.1: - heap_textures allows the shadowed-texture route for depth on drivers that lay heap depth textures apart. - The argument-buffer intersection-table test states Metal's own metadata. - The indirect lane classifies the deferred pipeline-making failure as compile-failed alike and keeps only the failed pipeline's error; Apple's 33-bit closed-form compiler crash is a known gap in docs/FAST-PATHS.md. Docs: CONTRIBUTING.md and docs/VALIDATION.md say the golden tables and the compile census are re-blessed on development. ENGINE_EXECUTOR_ABI is vulkan-engine-v181 (the RADV replay and the Metal addresses change what the executor submits): every recorded candidate row and the authored compile census go stale and need re-recording (scripts/rerecord-venue per venue, rerecord-commit, corpus-status --c3, corpus-triage --audit authored-compile --bless). Still open: M3 frees_in_flight, XTX bfloat clears, 780M half NaN blur and the 5080's one 2 s rebind_bytes_no_copy did not reproduce; the wall-clock busy calibrations of framebuffer_fetch/storage_forms.rs and queue_storms remain. Verified: - um780 full suites at the AMD fixes (before the executor and NVIDIA commits): XTX 3535/3535, 780M 3535/3535, no amdgpu kernel lines. - Each fix's focused tests before and after on its GPUs (in the agents' commits: e.g. generated/indirect 178/178 on XTX and 780M at 26.0.8 and 26.2.4; candidate 229/229 on 3090, 780M and Iris Xe; the worker peak 0 of 1440 under 24-way load on the 5080). - The combined tip: fmt, clippy (with and without --cfg m2v_gpu) and rustdoc on ms01; clippy of the validation crate on macOS; a focused run on the 3090 was stopped at 333 of 334 passed, none failed. No full suite ran on the combined tip. - The completion and first_use fixes: 3090 load set 1 of 4 runs failed before, 4 of 4 passed after (completion) and 12 runs with no first_use failure (84 calibrations, 10.19M-11.24M loads); 5080 6 of 6 and 12 of 12. fmt and clippy (no cfg, m2v_gpu, m2v_cpu_icd) on ms01. |
||
|
|
ecb80e019d |
Place heap textures needing up to 256 KiB alignment instead of refusing them
A heap's memory started at a multiple of 64 KiB of the runtime's block, and a
heap texture whose image needed a coarser alignment was refused
NotImplemented(HeapTextureAlignment), by heapTextureSizeAndAlign and
newTexture alike. On an RX 7900 XTX that refused nearly every depth texture a
program puts in a heap: four runtime-lane tests failed there on every run,
each with `alignment: 131072`, while the Radeon 780M in the same machine,
under the same driver, passed them.
Measured with a raw Vulkan probe on homelab-um780 (vkGetImageMemoryRequirements,
optimal tiling, attachment|sampled|transfer usage, 11 formats, sides 1 to
16384, 1/2/4/8 samples, one level or full mips), RADV under Mesa 26.0.8:
- RX 7900 XTX: 128 KiB for D16, D32F and D32FS8 images of 8 x 8 texels or
more; 256 KiB for multisample depth, stencil and color images from about
128 x 128 texels; single-sample color, storage and BC1 images at most
64 KiB. Nothing past 256 KiB.
- Radeon 780M: at most 64 KiB for every shape.
The base is now 256 KiB (HEAP_BASE_ALIGNMENT), the largest alignment measured.
The check moves into check_heap_base, which a GPU-free test can reach, and the
typed refusal stays for anything past the base. A heap over host pages
already starts at offset 0 of its own import, which meets any alignment.
Whole units of the base would have pushed the largest heaps past one
allocation: heap_size admits a heap up to maxMemoryAllocationSize in whole
16 KiB, and where that limit is no whole number of 256 KiB the largest heaps
asked more than the device allocates. RADV (4 GiB less 4 bytes) asked a 4 GiB
allocation for every heap from 4 GiB less 240 KiB, with a block's buffer of
addresses past maxBufferSize; MoltenVK (41,747,087,360 on the M3 Max,
9,534,832,640 on the M4, multiples of 128 KiB but not 256 KiB) would have
asked 128 KiB past the limit for its largest 128 KiB of sizes. So a buffer
past half a pooled block (32 MiB) now keeps its own size (buffer.rs's
`placed`). Such a buffer always takes a block of its own, where nothing
follows it; whole units exist only so the next placement in a pooled block
starts where the last ends. Buffers up to half a block still take whole
units, and half a block is a whole number of 256 KiB.
Cost: a heap of up to 32 MiB now starts at a multiple of 256 KiB of its pooled
block and takes whole 256 KiB units of it, up from 64 KiB units, so a small
heap can hold up to 240 KiB more of its block, on every device. A heap or
buffer past 32 MiB takes exactly its size, no longer rounded up. Programs see
no change where their images need 64 KiB or less. On the 7900 XTX the shapes
past 64 KiB now answer 128 or 256 KiB, are placed, and announce
heap-texture-larger-than-metal.
RUNTIME_VERSION 1179 -> 1181: heapTextureSizeAndAlign and newTexture answer
and refuse differently on such devices, heap buffers lie at other offsets in
the runtime's blocks, and every buffer and heap past half a pooled block
allocates its own size (WorkCounts::device_memory_allocated answers it).
runtime-sources.sha256 is re-pinned. docs/REFUSALS.md is regenerated, and the
reach mark's text says 256 KiB.
Tests:
- tests::heap::every_image_alignment_measured_fits_a_heap_s_base (GPU-free):
the measured alignments fit the base, and one past it is refused typed.
With the constant back at 64 KiB it fails (Err(NotImplemented(
HeapTextureAlignment { alignment: 131072 }))).
- tests::heap::the_largest_heap_asks_one_allocation_of_its_device (GPU-free):
every committed profile's largest heap asks at most one allocation and one
buffer. With `placed` rounding every size it fails on amd-780m-radv
(4,294,950,912 bytes asking 4294967296).
- runtime_lane::heaps::the_largest_heap_lies_in_one_allocation: where the
largest heap is at most 4 GiB, making it grows the runtime's memory by at
least its size and at most one allocation, with no validation message.
Without the size fix it failed on the 7900 XTX ("the largest heap,
4294950912 bytes, took 4294967296 bytes, past one allocation of
4294967292"). It reserves the memory without touching it: on Iris Xe a 4 GiB
heap took 0.04 s and a 53 MiB peak RSS; on lavapipe (debug) a 2 GiB heap
took 127 MiB.
Verified (release, --cfg m2v_gpu, one GPU pinned):
- The heap set (`test(/heap/) | test(/rebind/) | test(/no_copy/) |
test(/alias/)`, metal2vulkan-validation and metal2vulkan-runtime), before ->
after: RX 7900 XTX (RADV, Mesa 26.0.8) 176/180 -> 183/183 (the four
refusals pass); Radeon 780M (same host and Mesa), RTX 3090 and RTX 5080
Laptop (NVIDIA 615.71.09) and Iris Xe RPL-P (ANV, Mesa 26.2.4) 180/180 ->
183/183; lavapipe (--cfg m2v_cpu_icd, debug) 134/134. No kernel GPU
messages.
- Apple M3 Max (MoltenVK 1.4.1): the heap set plus `test(/buffer/)`. Every
failure fails identically at the base: heap_textures_answer_and_place_as_
metal_s_do, argument_buffer_intersection_table_is_encoded_at_reflected_field,
frees_while_the_gpu_is_busy_fail_no_command_buffer and
every_case_of_buffers_alone_runs_from_a_command_as_its_dispatch_2.
- Full GPU suites: RX 7900 XTX 3528/3531 and RTX 3090 3526/3531. Every
failure fails at the base or passes on rerun: on the XTX,
float_denormals_read_as_metal_reads_them and the two generated_executions
tests, which fail on the 780M too; on the 3090,
render_commands_and_render_states_run_as_the_executor_compiles_them and
the_runtime_probe_measures_the_test_device_consistently fail at the base,
and three timing tests pass on rerun.
- On the 7900 XTX, the heap lane's output shows answers and placements at
0x20000 and 0x40000 alignment and no HeapTextureAlignment.
- The runtime crate's GPU-free suite: 856/856. Clippy (workspace, all
targets, all features, and --cfg m2v_gpu) and rustdoc are clean,
refusal_surface.py --check passes, and the runtime-sources guard passes.
|
||
|
|
11715e2a3f |
Import no-copy memory a driver refuses from the caller's dma-bufs
RADV imports host pointers through amdgpu userptr with ANONONLY, so it refuses MAP_SHARED memfd pages (QEMU's memory-backend-memfd guest RAM and views of it): every no-copy buffer, heap and rebind over them was refused, and a macOS guest could not boot on AMD. NVIDIA imports the same pages. What: - The five no-copy entry points (new_buffer_with_bytes_no_copy, both new_heap_with_bytes_no_copy calls, Buffer and Heap rebind_bytes_no_copy) take a HostMemory; HostMemory::with_dma_buf adds a retained DmaBufSource. - Where the pointer import is refused, and only there, on any device that lists VK_KHR_external_memory_fd and VK_EXT_external_memory_dma_buf, the runtime asks the source for dma-bufs of the window's pages (chunks cut at the device's sparse granule, sized by the caller within udmabuf's default limits) and binds one buffer over them: plain for one chunk, sparse for several (vkQueueBindSparse signalling queue 0's timeline; later work waits on it, no host wait). Every path that imported before is unchanged. - Textures over such pages get a dedicated DRM_FORMAT_MOD_LINEAR image import of their own pages where the driver takes the plane offset and row pitch (multiples of 256 on RADV), with 64-bit modifier features; elsewhere, or on a source error, the existing shadow path. - The extensions are enabled outside the compile profile: no device's enable set, fingerprint or ARTIFACT_FORMAT_VERSION changes. The translator crate is unchanged. - Imports free inside exit-guard sections; the source is never called with a runtime lock held. WorkCounts gains dma_buf_imports, dma_buf_sparse_buffers, dma_buf_images and dma_buf_image_fallbacks. Verified: - Product suites 4553/4553, validation suite 1289/1289, clippy in every configuration, rustdoc -D warnings, scripts/api-docs. - runtime_lane::dma_buf_imports and rebinds on RADV Mesa 26.2.4 (validation layer clean), the RTX 3090 and lavapipe (pointer imported, source never called), and dma_buf_imports on RADV Mesa 26.0.8. - reims-vgpu on the Radeon 780M (RADV 26.0.8, udmabuf at its defaults): a macOS 26 guest cold-boots to the desktop and runs Safari; 5,119 dma-buf requests, none refused. - 64 MiB on RADV 26.2.4, release: pointer import 187 us; one chunk 665 us; 16 chunks 16.9 ms, about half of it the refused pointer attempt. The old host-fence bind waited 1.26 s behind queue-0 work on RADV 26.0.8. |
||
|
|
13b279df1b |
Squash 11203 commits of translator, runtime, and validation work
Rolls up everything since
|