test(agc): keep the Vulkan drivers loaded across the pipeline journal test #11721
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11721"
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 jotitadev on 2026-10-27T05:28:56Z.
What
agc_driver_pipeline_journalfails onmainon a Linux host that has the NVIDIA ICD and a second ICD (here lavapipe), withthe oversized record was not counted as a write failure. With only one ICD it passes.The test opens and closes about fifteen
VulkanDevices in one process. Each one creates and destroys its own instance, and the loader unloads every ICD when an instance is destroyed, then loads them again for the next one. glibc does not give back the static TLS that a library with initial-exec TLS takes, and NVIDIA'slibnvidia-tls.sois such a library. With two ICDs the block runs out after about ten cycles; from then on the loader logsand enumerates only lavapipe (
Physical device count=1). The next device opens on lavapipe, the journal saysbelongs to another device; the journal is off for this run, and the oversized-record check fails. Device selection is not the cause: the driver's selection andANYPS5_GPUsee only what the loader enumerates, and withANYPS5_GPU=NVIDIAthe same run stops withVulkan: no usable device whose name contains ANYPS5_GPU="NVIDIA"; devices: llvmpipe (LLVM 21.1.8, 256 bits). Production opens one device per process, so this only shows in a test that cycles devices.The same thing reproduces outside AnyPS5 with a 25-line C loop (
dlopenthe loader,vkCreateInstance, enumerate,vkDestroyInstance,dlclose): NVIDIA drops out at cycle 10 with both ICDs, and at cycle 26 with only the NVIDIA ICD. Keeping one instance alive for the whole loop keeps both devices for all 30 cycles. Not unloading the loader is not enough; the ICDs go when the last instance goes.GLIBC_TUNABLES=glibc.rtld.optional_static_tls=2048also makes the test pass, which confirms the cause.The test now holds one instance for the life of the process on glibc, before it opens its first device, so the ICDs stay loaded and each device reuses them. Only this test changes.
Tested
Ubuntu 26.04, glibc 2.43, GCC 15.2, Release,
ninja -j3. NVIDIA GeForce RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same host.ANYPS5_REQUIRE_VULKAN=1,ctest -R '^agc_driver_pipeline_journal$' -j1. Basemain4297464b1; the branch is that change rebased onto currentmainwith no conflict and no change to the files involved.mainthe oversized record was not counted as a write failureVK_ICD_FILENAMES)VK_ICD_FILENAMES)ANYPS5_GPU=llvmpipeWith both ICDs, the binary run directly with
VK_LOADER_DEBUG=error: onmain10 devices open on the 3070 and 2 on lavapipe, with 2 static-TLS errors; with this change all 15 open on the 3070, 0 errors, 0belongs to another device. WithANYPS5_GPU=llvmpipeall 15 open on lavapipe.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T05:34:22Z.
Review: CHANGES_REQUESTED
The test-only workaround matches the reported glibc/NVIDIA TLS exhaustion, and I syntax-checked the changed
PipelineJournal.cppwith this target's configured GCC flags successfully. The author also provides a detailed same-machine main-vs-change run across both ICDs and each ICD separately.One Linux build portability issue remains: this change adds direct
dlopen/dlsymreferences, butagc_driver_pipeline_journal_testsdoes not link${CMAKE_DL_LIBS}. The generated target link line has no-ldl; this works with glibc 2.34+ because libdl was integrated into libc, but not with glibc 2.33 and earlier where the symbols live in libdl. The project build requirements do not set a glibc 2.34 minimum. Please add${CMAKE_DL_LIBS}to this test target and rerun its link/test. I could not run the Vulkan runtime test locally; the current hosted product-build jobs are skipped by path policy.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T06:42:15Z.
Review: APPROVED
The requested link dependency is now added to the test target, and the author reports the rebuilt link line includes plus successful focused runs with both ICDs, each ICD separately, and CTest. I inspected the exact two-file diff and the targeted policy checks pass. Hosted product build jobs remain skipped; I did not run this Vulkan test locally.