AGC (RTX 5090, Windows): agc_driver_depth_storage leaks 63 VkDeviceMemory objects at device destroy (VUID-vkDestroyDevice-device-05137 reoccurrence) #24620

Closed
opened 2026-11-20 21:11:40 +00:00 by haadeej084 · 0 comments
haadeej084 commented 2026-11-20 21:11:40 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by haadeej084 on 2026-11-20T21:11:40Z.


Summary

agc_driver_depth_storage leaks 63 VkDeviceMemory objects that are not freed before vkDestroyDevice. The validation layer reports VUID-vkDestroyDevice-device-05137. This is the same VUID that #1236 fixed for host-import VkBuffer/VkDeviceMemory pairs, but depth_storage was not in the original list of 23 affected tests, and the leaked objects here are all VkDeviceMemory (no VkBuffer), suggesting a different code path — likely image memory allocations rather than host imports.

Title, test or build step

agc_driver_depth_storage

AnyPS5 commit

main 223b1645d2 (Merge pull request #24052)

System

Windows 11 Home 10.0.26200, 13th Gen Intel Core i7-13700KF, NVIDIA GeForce RTX 5090 (32 GB, Blackwell), driver 610.88, WinLibs GCC 15.2.0 UCRT posix-seh r7, Ninja, Release, BUILD_TESTING=ON.

Steps to reproduce

set VK_LAYER_PATH=C:\VulkanSDK\1.4.357.0\Bin
set VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation
set ANYPS5_REQUIRE_VULKAN=1
set ANYPS5_NO_SHADER_CACHE=1
set ANYPS5_GPU=RTX 5090
ctest --test-dir build -R "^agc_driver_depth_storage$" -V --output-on-failure

Validation output

Validation Error: [ VUID-vkDestroyDevice-device-05137 ] | MessageID = 0x4872eaa0
vkDestroyDevice(): VkDevice 0xfc009800d0 has 63 leaked objects that have not been destroyed.
(Only printing the first 10 objects, but can be increased by raising the VK_LAYER_DUPLICATE_MESSAGE_LIMIT/'duplicate_message_limit' setting value)
VkDeviceMemory 0x2a000000002a, VkDeviceMemory 0x410000000041, VkDeviceMemory 0x280000000028,
VkDeviceMemory 0x430000000043, VkDeviceMemory 0x570000000057, VkDeviceMemory 0x100000000010,
VkDeviceMemory 0x3a000000003a, VkDeviceMemory 0x2e000000002e, VkDeviceMemory 0x380000000038,
VkDeviceMemory 0x460000000046

The test itself also fails (without the validation layer):

AGC graphics: a two-layer 2D array view over the depth plane's guest layer pitch was not taken as a storage image

Relationship to #1236

#1236 fixed the same VUID for host-import leaks (VkBuffer + VkDeviceMemory pairs from GuestBufferMemory.cpp's import registry). That fix covered 23 tests, all in the flat/global/image-store/scalar family.

depth_storage was not in that set, and the leaked objects here are exclusively VkDeviceMemory (no VkBuffer), pointing to image memory allocations in the depth/storage path rather than host imports. This appears to be either:

  • An incomplete fix (depth/storage image cleanup was not covered by ClearHostImports)
  • A separate leak in the depth storage path
  • A regression introduced after the #1236 fix

Additional validation finding

In the same validation run, agc_driver_batch_cap reports VUID-vkGetInstanceProcAddr-instance-parameter ("Invalid instance") at shutdown, after all test work has completed. This is a use-after-destroy of the VkInstance handle, unrelated to the device memory leak above.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6519737212 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/24620). Originally posted by [haadeej084](https://github.com/haadeej084) on 2026-11-20T21:11:40Z. --- ### Summary `agc_driver_depth_storage` leaks 63 `VkDeviceMemory` objects that are not freed before `vkDestroyDevice`. The validation layer reports `VUID-vkDestroyDevice-device-05137`. This is the same VUID that #1236 fixed for host-import `VkBuffer`/`VkDeviceMemory` pairs, but `depth_storage` was not in the original list of 23 affected tests, and the leaked objects here are all `VkDeviceMemory` (no `VkBuffer`), suggesting a different code path — likely image memory allocations rather than host imports. ### Title, test or build step `agc_driver_depth_storage` ### AnyPS5 commit `main` `223b1645d2` (Merge pull request #24052) ### System Windows 11 Home 10.0.26200, 13th Gen Intel Core i7-13700KF, NVIDIA GeForce RTX 5090 (32 GB, Blackwell), driver 610.88, WinLibs GCC 15.2.0 UCRT posix-seh r7, Ninja, Release, `BUILD_TESTING=ON`. ### Steps to reproduce ``` set VK_LAYER_PATH=C:\VulkanSDK\1.4.357.0\Bin set VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation set ANYPS5_REQUIRE_VULKAN=1 set ANYPS5_NO_SHADER_CACHE=1 set ANYPS5_GPU=RTX 5090 ctest --test-dir build -R "^agc_driver_depth_storage$" -V --output-on-failure ``` ### Validation output ``` Validation Error: [ VUID-vkDestroyDevice-device-05137 ] | MessageID = 0x4872eaa0 vkDestroyDevice(): VkDevice 0xfc009800d0 has 63 leaked objects that have not been destroyed. (Only printing the first 10 objects, but can be increased by raising the VK_LAYER_DUPLICATE_MESSAGE_LIMIT/'duplicate_message_limit' setting value) VkDeviceMemory 0x2a000000002a, VkDeviceMemory 0x410000000041, VkDeviceMemory 0x280000000028, VkDeviceMemory 0x430000000043, VkDeviceMemory 0x570000000057, VkDeviceMemory 0x100000000010, VkDeviceMemory 0x3a000000003a, VkDeviceMemory 0x2e000000002e, VkDeviceMemory 0x380000000038, VkDeviceMemory 0x460000000046 ``` The test itself also fails (without the validation layer): ``` AGC graphics: a two-layer 2D array view over the depth plane's guest layer pitch was not taken as a storage image ``` ### Relationship to #1236 #1236 fixed the same VUID for host-import leaks (`VkBuffer` + `VkDeviceMemory` pairs from `GuestBufferMemory.cpp`'s import registry). That fix covered 23 tests, all in the flat/global/image-store/scalar family. `depth_storage` was not in that set, and the leaked objects here are exclusively `VkDeviceMemory` (no `VkBuffer`), pointing to image memory allocations in the depth/storage path rather than host imports. This appears to be either: - An incomplete fix (depth/storage image cleanup was not covered by `ClearHostImports`) - A separate leak in the depth storage path - A regression introduced after the #1236 fix ### Additional validation finding In the same validation run, `agc_driver_batch_cap` reports `VUID-vkGetInstanceProcAddr-instance-parameter` ("Invalid instance") at shutdown, after all test work has completed. This is a use-after-destroy of the VkInstance handle, unrelated to the device memory leak above. AI-assisted: yes.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#24620
No description provided.