[NVIDIA] DEVICE_LOST in Astro's Playroom — R32_SFLOAT color image sampled with depth comparison (VUID-vkCmdDrawIndexed-None-06479) #1476

Closed
opened 2026-11-26 09:57:36 +00:00 by github-bot · 2 comments
Owner

@⁠HenriqueBicudo on GitHub · 2026-10-13 13:26 UTC · original

Environment

  • Build: Official build KytyPS5-2026-10-12-df5b9b9
  • Game: ASTRO's PLAYROOM (PPSA01325), contentVersion 01.905.000
  • CPU: AMD Ryzen 5 3600 (AMD CPU patch enabled)
  • GPU: NVIDIA GeForce RTX 4060 Ti, latest driver
  • RAM: 16 GB
  • OS: Windows

Symptom

The game boots, plays the intro video, then crashes while loading the hub:

Not implemented (result != vk::Result::eSuccess) in src\graphics\host_gpu\renderer\masterSemaphore.cpp:53
  • The crash point varies between runs (somewhere between PS 55 and PS 80 shaders compiled).
  • Windows logs nvlddmkm Event ID 153 (GPU reset / TDR) at the time of each crash, so this is a real VK_ERROR_DEVICE_LOST.
  • Raising TdrDelay/TdrDdiDelay doesn't help. Changing shader optimization, accurate texture sync, present mode or disabling implicit Vulkan layers doesn't help either.
  • Build 5b54137 (2026-09-16) fails earlier with unsupported MIMG opcode 0xe6 in ShaderCFG.cpp, so I can't test an older build.

Root cause (Vulkan validation)

With Vulkan validation enabled (LunarG SDK installed), the emulator stops at:

vkCmdDrawIndexed(): the sampled image descriptor [Set 0, Binding 80, Index 0, variable "image_24"]
has VkImageView with format of VK_FORMAT_R32_SFLOAT which doesn't support
VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT.
VUID-vkCmdDrawIndexed-None-06479

NVIDIA doesn't expose SAMPLED_IMAGE_DEPTH_COMPARISON for R32_SFLOAT (AMD does, which is probably why this doesn't show up on AMD GPUs). Using a comparison sampler on it is undefined behavior and hangs the GPU here.

Where it seems to happen (from reading the source at df5b9b9)

In src/graphics/host_gpu/renderer/pipeline/descriptors.cpp:

  1. For a k32Float texture with resource.depth_compare, pixel_format is correctly switched to eD32Sfloat via FindGuestDepthFormatPolicy (~line 583).
  2. But TextureCache::FindImage (non-exact format) can return an existing color R32_SFLOAT image at the same address. This could be a color render target the game wrote depth into, or the destination of CopyDepthToColor.
  3. That image isn't IsDepth(), so it takes the color branch (SelectSampledColorView, ~line 655), and it ends up bound as an R32_SFLOAT view with a sampler that has compareEnable = VK_TRUE (samplerCache.cpp:133).

Possible fix

When depth_compare is set and the resolved image is a color format without SAMPLED_IMAGE_DEPTH_COMPARISON_BIT on the host, bind a D32_SFLOAT image instead. For example, a shadow D32 copy of the R32 image via vkCmdCopyImage (color→depth copies are available here through VK_KHR_maintenance8; the log reports Vulkan depth/color copy support: true).

yuzu hit the same problem and fixed it by treating R32F textures sampled with depth compare as Z32F surfaces: git.openpunk.com/OpenPunk/yuzu@b0aa8ad736

**@⁠HenriqueBicudo** on GitHub · 2026-10-13 13:26 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1476) ### Environment - **Build:** Official build KytyPS5-2026-10-12-df5b9b9 - **Game:** ASTRO's PLAYROOM (PPSA01325), contentVersion 01.905.000 - **CPU:** AMD Ryzen 5 3600 (AMD CPU patch enabled) - **GPU:** NVIDIA GeForce RTX 4060 Ti, latest driver - **RAM:** 16 GB - **OS:** Windows ### Symptom The game boots, plays the intro video, then crashes while loading the hub: ``` Not implemented (result != vk::Result::eSuccess) in src\graphics\host_gpu\renderer\masterSemaphore.cpp:53 ``` - The crash point varies between runs (somewhere between PS 55 and PS 80 shaders compiled). - Windows logs `nvlddmkm` Event ID 153 (GPU reset / TDR) at the time of each crash, so this is a real `VK_ERROR_DEVICE_LOST`. - Raising `TdrDelay`/`TdrDdiDelay` doesn't help. Changing shader optimization, accurate texture sync, present mode or disabling implicit Vulkan layers doesn't help either. - Build `5b54137` (2026-09-16) fails earlier with `unsupported MIMG opcode 0xe6` in ShaderCFG.cpp, so I can't test an older build. ### Root cause (Vulkan validation) With Vulkan validation enabled (LunarG SDK installed), the emulator stops at: ``` vkCmdDrawIndexed(): the sampled image descriptor [Set 0, Binding 80, Index 0, variable "image_24"] has VkImageView with format of VK_FORMAT_R32_SFLOAT which doesn't support VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT. VUID-vkCmdDrawIndexed-None-06479 ``` NVIDIA doesn't expose `SAMPLED_IMAGE_DEPTH_COMPARISON` for `R32_SFLOAT` (AMD does, which is probably why this doesn't show up on AMD GPUs). Using a comparison sampler on it is undefined behavior and hangs the GPU here. ### Where it seems to happen (from reading the source at df5b9b9) In `src/graphics/host_gpu/renderer/pipeline/descriptors.cpp`: 1. For a `k32Float` texture with `resource.depth_compare`, `pixel_format` is correctly switched to `eD32Sfloat` via `FindGuestDepthFormatPolicy` (~line 583). 2. But `TextureCache::FindImage` (non-exact format) can return an **existing color `R32_SFLOAT` image** at the same address. This could be a color render target the game wrote depth into, or the destination of `CopyDepthToColor`. 3. That image isn't `IsDepth()`, so it takes the color branch (`SelectSampledColorView`, ~line 655), and it ends up bound as an `R32_SFLOAT` view with a sampler that has `compareEnable = VK_TRUE` (`samplerCache.cpp:133`). ### Possible fix When `depth_compare` is set and the resolved image is a color format without `SAMPLED_IMAGE_DEPTH_COMPARISON_BIT` on the host, bind a `D32_SFLOAT` image instead. For example, a shadow D32 copy of the R32 image via `vkCmdCopyImage` (color→depth copies are available here through `VK_KHR_maintenance8`; the log reports `Vulkan depth/color copy support: true`). yuzu hit the same problem and fixed it by treating R32F textures sampled with depth compare as Z32F surfaces: https://git.openpunk.com/OpenPunk/yuzu/commit/b0aa8ad73625941fe08b2d9df36e8319bb958dd0
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:57:36 +00:00
Author
Owner

@⁠ricardocacco on GitHub · 2026-10-17 22:22 UTC · original

Update: reproduced on a newer build and a different shader stage, and I think the FindImage aliasing hypothesis in the OP is mechanically impossible. Details below — please correct me if I'm misreading the code.

Reproducer

  • Build: PR #1528 head, bd8f0da (logs as Fork build MIKL99999/KytyPS5 bd8f0da), Windows 11 x64.
  • Game: ASTRO BOT / PPSA21567 (v01.019.000), same title as the OP.
  • GPU/driver: RTX 5060 Ti 16 GB, NVIDIA 617.42. Vulkan loader 1.4.363 (Khronos SDK 1.4.363.0); VK_LAYER_KHRONOS_validation present and explicitly enabled by Kyty.
  • kyty_emulator.exe --game "<...>\PPSA21567-app" --vulkan-validation true --printf-direction File --printf-output-file _kyty-vulkan.txt

With that build the SRT-walker access violation is gone, the shader compilation completes, ~3600 assets load, and then the first fatal validation error terminates the process. Notably there is no masterSemaphore.cpp:53 and no nvlddmkm 153 in this capture: the validation callback exits before the hang turns into a device lost. That alone makes this a ~1 minute triage loop, worth recommending as the default diagnostic.

Exact VUID

[Vulkan][E][2]: vkCmdDispatch(): the sampled image descriptor [Set 0, Binding 24, Index 0, variable "image_24"]
has VkImageView 0xa400000000a4 with format of VK_FORMAT_R32_SFLOAT which doesn't support
VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT.
(supported features: VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT|...|VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT|...)
VUID-vkCmdDispatch-None-06479
 in ...\src\graphics\presentation\window\vulkanWindow.cpp:800

Two things differ from the OP and I believe they matter:

  1. It is vkCmdDispatch, not vkCmdDrawIndexed. In this capture the offending call is a compute shader (the exit log reports VS 15 | PS 22 | CS 40 | GS 1). So this is not draw-specific — the invalid descriptor is reaching the GPU through the shared binding path.
  2. The binding index differs (80 in the OP, 24 here). That varies per shader, which is what you'd expect if the bug lives in the shared descriptor-binding code rather than in one particular pipeline.

Also: the same VUID had already been reported about 10 times earlier in the run — the layer hits duplicate_message_limit and says so ("this will be the last time reporting it") long before the fatal occurrence.

The FindImage / exact_format hypothesis

The OP suggests the D32 request may be satisfied by an existing R32 colour image because exact_format is false. Reading bd8f0da, I don't see how that can happen:

  • NativeTextureCache::FindImage → SameBacking(image.info, desc.info, exact_format) (textureCache.cpp:1250).
  • SameBacking (textureCache.cpp:145-180) gates on address, size, extent, levels/layers, samples, bytes_per_block, tile_mode (:166), colour transform, and then ImageViewOps::FormatsCompatible(cached.pixel_format, requested.pixel_format) at :172. exact_format only adds strictness at :176; it cannot turn a failing FormatsCompatible into a pass.
  • FormatsCompatible (imageView.cpp:298-305) is view_class != None && (base_class & view_class) == view_class, with FormatClass as the classifier.
  • FormatClass(vk::Format::eR32Sfloat) is Bit32 (imageView.cpp:204 → :213), while FormatClass(vk::Format::eD32Sfloat) is D32 (imageView.cpp:277). Bit32 & D32 != D32, so the function returns false.

So a colour R32_SFLOAT image can never be returned to satisfy a D32_SFLOAT view request, and the tile_mode check would independently block a colour↔depth backing match anyway. I believe the shadow-copy remedy proposed in the OP is fixing a path that isn't being taken.

Worth ruling out too: FindGuestDepthFormatPolicy(k32Float) does exist (imageInfo.h:218-229: kZ16/k16UNorm → eD16Unorm, kZ32F/k32Float → eD32Sfloat), so the substitution table is not the missing piece either.

What the evidence does point at

The explanation I can defend from the source is that the image and the sampler disagree about whether this is a depth-compare sample, inside a single program:

  • The image side comes from the shader IR: AddImage sets const bool depth = (memory.image_sample_flags & Decoder::ImageSampleFlagCompare) != 0 and stores it as image.depth_compare (ResourceTracking.cpp:2206 / :2226; field at ShaderIR.h:152; it is also part of the image dedup key at :2207-2215).
  • The sampler side comes from compareEnable = (r.DepthCompareFunc() != 0 ? VK_TRUE : VK_FALSE) (samplerCache.cpp:133), and nothing clears it afterwards: descriptors.cpp:668-670 clears the depth-compare bit only when !sampler.depth_compare.
  • The D32 substitutions at descriptors.cpp:582-587 are keyed on resource.depth_compare (the image side), not on the sampler.

Result: resource.depth_compare == false → the image keeps R32_SFLOAT, no D32 view/substitution is attempted → but the sampler resolved for that binding has compareEnable = VK_TRUE and it survives. The descriptor then carries a comparison sampler over a colour view, and the layer fires 06479 on first use.

Consistently, ShaderIR.h:380 / :387 also pick the binding type and the numeric-class requirement from image.depth_compare, i.e. the image flag is treated as the single source of truth on that side while the sampler keeps its own independent value.

Suggestion

I'd take (1) regardless, because it converts a GPU hang / device-lost into a precise, nameable failure:

  1. Guard. Where the descriptor is assembled, if sampler.depth_compare is true but the resolved image is not a depth format, clear the compare bit and log set/binding/format. It is behaviour-preserving (the sample would be UB anyway) and it names the offending binding. Sketch near the sampler handling in PrepareBindings / the descriptor-write assembly (descriptors.cpp:662-670 neighbourhood):
// Sampler says "depth compare" but the image is a colour format: the pair is invalid
// (VUID-vkCmdDispatch-None-06479 and friends) and would be UB / device-lost.
if (sampler.depth_compare && !image->info.IsDepth()) {
    LOGF("[Vulkan][W] depth-compare sampler over colour image: set=%u binding=%u format=%d\n",
         /* ... */);
    sampler.depth_compare = false;                       // demote, keep going
    // descriptor.fields[0] &= ~(0x7u << 12u);           // same mask as the existing !depth path
}
  1. Fix the source of the disagreement. Either derive image.depth_compare from both the sample flag and the sampler it is paired with (and log when they conflict), or, when the sampler is a comparison sampler, force the D32 substitution regardless of resource.depth_compare — but only when the surface is sampled-only in that pass; otherwise use the R32 → D32 shadow copy the OP proposed (VK_KHR_maintenance8 is reported as supported in my log, so vkCmdCopyImage is available).

Related, cheap: MasterSemaphore currently throws the VkResult away (EXIT_NOT_IMPLEMENTED(result != vk::Result::eSuccess)), which is why the OP needed the Windows event log to confirm DEVICE_LOST. Printing the actual VkResult would make the next report self-contained.

Caveat: I can't compile Kyty on this machine (no MSVC C++ workload, no Qt 6 SDK, no vcpkg/glslang), so the above is a source read plus a proposal, not a tested patch. I'm happy to open a PR with (1) since it's small, but I'd rather you pick the direction first.

**@⁠ricardocacco** on GitHub · 2026-10-17 22:22 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1476#issuecomment-6242162374) Update: reproduced on a newer build and a *different shader stage*, and I think the `FindImage` aliasing hypothesis in the OP is mechanically impossible. Details below — please correct me if I'm misreading the code. ### Reproducer - Build: PR #1528 head, `bd8f0da` (logs as `Fork build MIKL99999/KytyPS5 bd8f0da`), Windows 11 x64. - Game: ASTRO BOT / PPSA21567 (v01.019.000), same title as the OP. - GPU/driver: RTX 5060 Ti 16 GB, NVIDIA 617.42. Vulkan loader 1.4.363 (Khronos SDK 1.4.363.0); `VK_LAYER_KHRONOS_validation` present and explicitly enabled by Kyty. - `kyty_emulator.exe --game "<...>\PPSA21567-app" --vulkan-validation true --printf-direction File --printf-output-file _kyty-vulkan.txt` With that build the SRT-walker access violation is gone, the shader compilation completes, ~3600 assets load, and then the first fatal validation error terminates the process. Notably there is **no** `masterSemaphore.cpp:53` and **no** `nvlddmkm` 153 in this capture: the validation callback exits before the hang turns into a device lost. That alone makes this a ~1 minute triage loop, worth recommending as the default diagnostic. ### Exact VUID ``` [Vulkan][E][2]: vkCmdDispatch(): the sampled image descriptor [Set 0, Binding 24, Index 0, variable "image_24"] has VkImageView 0xa400000000a4 with format of VK_FORMAT_R32_SFLOAT which doesn't support VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT. (supported features: VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT|...|VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT|...) VUID-vkCmdDispatch-None-06479 in ...\src\graphics\presentation\window\vulkanWindow.cpp:800 ``` Two things differ from the OP and I believe they matter: 1. **It is `vkCmdDispatch`, not `vkCmdDrawIndexed`.** In this capture the offending call is a compute shader (the exit log reports `VS 15 | PS 22 | CS 40 | GS 1`). So this is not draw-specific — the invalid descriptor is reaching the GPU through the shared binding path. 2. **The binding index differs** (80 in the OP, 24 here). That varies per shader, which is what you'd expect if the bug lives in the shared descriptor-binding code rather than in one particular pipeline. Also: the same VUID had already been reported about 10 times earlier in the run — the layer hits `duplicate_message_limit` and says so ("this will be the last time reporting it") long before the fatal occurrence. ### The `FindImage` / `exact_format` hypothesis The OP suggests the D32 request may be satisfied by an existing R32 colour image because `exact_format` is false. Reading `bd8f0da`, I don't see how that can happen: - `NativeTextureCache::FindImage` → `SameBacking(image.info, desc.info, exact_format)` (`textureCache.cpp:1250`). - `SameBacking` (`textureCache.cpp:145-180`) gates on address, size, extent, levels/layers, samples, bytes_per_block, **`tile_mode`** (`:166`), colour transform, and then `ImageViewOps::FormatsCompatible(cached.pixel_format, requested.pixel_format)` at `:172`. `exact_format` only adds *strictness* at `:176`; it cannot turn a failing `FormatsCompatible` into a pass. - `FormatsCompatible` (`imageView.cpp:298-305`) is `view_class != None && (base_class & view_class) == view_class`, with `FormatClass` as the classifier. - `FormatClass(vk::Format::eR32Sfloat)` is `Bit32` (`imageView.cpp:204` → `:213`), while `FormatClass(vk::Format::eD32Sfloat)` is `D32` (`imageView.cpp:277`). `Bit32 & D32 != D32`, so the function returns false. So a colour `R32_SFLOAT` image can never be returned to satisfy a `D32_SFLOAT` view request, and the `tile_mode` check would independently block a colour↔depth backing match anyway. I believe the shadow-copy remedy proposed in the OP is fixing a path that isn't being taken. Worth ruling out too: `FindGuestDepthFormatPolicy(k32Float)` **does** exist (`imageInfo.h:218-229`: `kZ16/k16UNorm → eD16Unorm`, `kZ32F/k32Float → eD32Sfloat`), so the substitution table is not the missing piece either. ### What the evidence does point at The explanation I can defend from the source is that **the image and the sampler disagree about whether this is a depth-compare sample, inside a single program**: - The image side comes from the shader IR: `AddImage` sets `const bool depth = (memory.image_sample_flags & Decoder::ImageSampleFlagCompare) != 0` and stores it as `image.depth_compare` (`ResourceTracking.cpp:2206` / `:2226`; field at `ShaderIR.h:152`; it is also part of the image dedup key at `:2207-2215`). - The sampler side comes from `compareEnable = (r.DepthCompareFunc() != 0 ? VK_TRUE : VK_FALSE)` (`samplerCache.cpp:133`), and nothing clears it afterwards: `descriptors.cpp:668-670` clears the depth-compare bit only when `!sampler.depth_compare`. - The D32 substitutions at `descriptors.cpp:582-587` are keyed on **`resource.depth_compare`** (the image side), not on the sampler. Result: `resource.depth_compare == false` → the image keeps `R32_SFLOAT`, no D32 view/substitution is attempted → but the sampler resolved for that binding has `compareEnable = VK_TRUE` and it survives. The descriptor then carries a comparison sampler over a colour view, and the layer fires 06479 on first use. Consistently, `ShaderIR.h:380` / `:387` also pick the binding type and the numeric-class requirement from `image.depth_compare`, i.e. the image flag is treated as the single source of truth on that side while the sampler keeps its own independent value. ### Suggestion I'd take (1) regardless, because it converts a GPU hang / device-lost into a precise, nameable failure: 1. **Guard.** Where the descriptor is assembled, if `sampler.depth_compare` is true but the resolved image is not a depth format, clear the compare bit and log set/binding/format. It is behaviour-preserving (the sample would be UB anyway) and it names the offending binding. Sketch near the sampler handling in `PrepareBindings` / the descriptor-write assembly (`descriptors.cpp:662-670` neighbourhood): ```cpp // Sampler says "depth compare" but the image is a colour format: the pair is invalid // (VUID-vkCmdDispatch-None-06479 and friends) and would be UB / device-lost. if (sampler.depth_compare && !image->info.IsDepth()) { LOGF("[Vulkan][W] depth-compare sampler over colour image: set=%u binding=%u format=%d\n", /* ... */); sampler.depth_compare = false; // demote, keep going // descriptor.fields[0] &= ~(0x7u << 12u); // same mask as the existing !depth path } ``` 2. **Fix the source of the disagreement.** Either derive `image.depth_compare` from *both* the sample flag and the sampler it is paired with (and log when they conflict), or, when the sampler is a comparison sampler, force the D32 substitution regardless of `resource.depth_compare` — but only when the surface is sampled-only in that pass; otherwise use the `R32 → D32` shadow copy the OP proposed (`VK_KHR_maintenance8` is reported as supported in my log, so `vkCmdCopyImage` is available). Related, cheap: `MasterSemaphore` currently throws the `VkResult` away (`EXIT_NOT_IMPLEMENTED(result != vk::Result::eSuccess)`), which is why the OP needed the Windows event log to confirm `DEVICE_LOST`. Printing the actual `VkResult` would make the next report self-contained. **Caveat:** I can't compile Kyty on this machine (no MSVC C++ workload, no Qt 6 SDK, no vcpkg/glslang), so the above is a source read plus a proposal, not a tested patch. I'm happy to open a PR with (1) since it's small, but I'd rather you pick the direction first.
Author
Owner

@⁠Nmzik on GitHub · 2026-10-18 16:46 UTC · original

Duplicate of #1552.

Consolidating compatibility evidence for PPSA01325 in the newer report #1552. This older report has no posted screenshots or video in its body or comments. Its logs and discussion remain available here; this closure consolidates reports and does not mark the reported behavior as fixed.

**@⁠Nmzik** on GitHub · 2026-10-18 16:46 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1476#issuecomment-6252481717) Duplicate of #1552. Consolidating compatibility evidence for PPSA01325 in the newer report #1552. This older report has no posted screenshots or video in its body or comments. Its logs and discussion remain available here; this closure consolidates reports and does not mark the reported behavior as fixed.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/KytyPS5--KytyPS5#1476
No description provided.