fix(agc): keep pipeline layout alive during background LTO #2869
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2869"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T17:06:33Z.
What
Fixes #2777 by making the background link-time-optimization job use the pipeline layout retained by the pipeline-library store. The previous job captured a
Pipeline-owned layout, which can be destroyed after the job passes its released check but beforevkCreateGraphicsPipelinesuses it. The store-owned layout is the same layout used to create the libraries and remains alive until pending links finish.This change is based on Silverash-i8's candidate commit
758eeb9f, cherry-picked with its original author preserved. Silverash's report on #2777 includes repeatable Intel Windows faults inigc-default64.dlland successful runs of the affected tests with the fix. AMD reports a separate issue in the LTO path that this layout lifetime fix does not address.Tested
agc_driver_recorder_testssuccessfully.ctest --test-dir /tmp/AnyPS5-2777-build --output-on-failure -R '^agc_pipeline_library$'passed (1/1).python3 tools/check_conventions.py --base upstream/mainpassed;git diff --checkpassed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by Zurisen on 2026-10-10T17:50:31Z.
Native NVIDIA run: the fault in #2777 is not Intel-only, and this change fixes it here too.
Setup: Windows 11 Home (26200), RTX 4070 Laptop GPU (Ada, driver 32.0.15.9636), i7-14650HX, WinLibs GCC 15.2.0 r7, Release,
-DBUILD_TESTING=ON,main57f96fd2. This PR's51078717was cherry-picked onto the samemainand rebuilt in the same tree.Reproducing it reliably on NVIDIA: with warm caches and the default
-j6the faults are rare (4 crashed tests in 5 full-suite runs, 1 in 160 runs of four of the tests), which is probably why it hasn't shown up on NVIDIA before. With every cache cold and more parallelism the background link reliably outlives thePipeline:agc_driver_tests per batch, conditions above)mainmainwithAPS5_NO_PIPELINE_LTO=1main+51078717Every crash is a SEGFAULT inside NVIDIA's driver: 50 at
nvoglv64.dll+0xed5110and 4 atnvoglv64.dll+0x4cd96a, all reading0xffffffffffffffffexcept one read of0x161:Crashed tests on
main(times out of 5 batches):prepared_exports,pixel_wave_reduction,pixel_uint16_export,pixel_helper_lanes,pixel_barycentric_emulation5;packed_unorm_color_target,depth_bias_per_face4;srgb8_color_target,pixel_fixed_point_position3;pixel_valid_mask,ngg_vertex_wave_info,mesh,dual_source_blend2;pixel_interlock,exec_host_lanes,draw_offset_indices1.