vk: RX_VK_NOOPT=1 builds pipelines without the driver's optimizer (AMD compiler crash on RX 6900 XT) #166

Merged
lev92 merged 1 commit from rx-vk-noopt into main 2026-11-07 14:23:00 +00:00
lev92 commented 2026-11-07 14:17:49 +00:00 (Migrated from github.com)

What this fixes

An RDNA2 data point, since the AMD path was only tested by forcing it on an NVIDIA card:

RX 6900 XT, AMD proprietary driver 32.0.21045.16010 (2026-10-16), Windows 11 Pro 26300, i7-9700K, 32 GB. Game 0400486024DEC000 v131072, build e0f3ccfa, built with the lighting-fix HookshotBuilder (bundled source identical to da030c5, checked file by file).

The title screen and menus run at 58-60 fps. Loading a save (Kokiri Forest) ends like this:

[hos host] vk: matrix multiplies in software (the cooperative matrices lack 16x8x16 f16)
[hos host] vk: AMD Radeon RX 6900 XT, Vulkan 1.4, driver 0x800161; mesh shaders yes, host memory import yes, pipeline libraries yes
...
[hos ModuleSystemWorker1] vk: NVN2 program 2d6b101e5868b4ea (stage 0) lowered with extended registers (1132 REGMAP words)
[hos ModuleSystemWorker1] vk: NVN2 program b81f83fe05a2a32a (stage 0) lowered with extended registers (939 REGMAP words)
[hos host] vk: graphics pipeline for 5fa56485a6b07619 not made (-13)

-13 is guarded_graphics's answer to an access violation inside vkCreateGraphicsPipelines: the driver's shader compiler crashed. After that line nothing is presented any more (black window, GPU engine at 0 %), one thread spins at 100 % in amdvlk64.dll/amdxc64.dll, and the log stays silent; I waited 7 minutes. This looks like the same AMD compiler bug Lichii hit for Ocarina's shaders (zortos293/Lichii#101, #200, #210: an access violation at amdvlk64.dll+0xaff2e7 and 6-18 minute builds of two compute shaders), where building the affected pipelines with VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT avoids both.

Change

RX_VK_NOOPT=1 sets VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT on every graphics and compute pipeline the game's programs produce (build_graphics and the compute program path in vk_draw.cpp). Off unless the variable is set, so nothing changes for NVIDIA.

Testing

Same PC, same build folder, only hookshot_vk.dll rebuilt. With RX_VK_NOOPT=1 the same save loads: no not made, no stall, 40 fps in Kokiri Forest (vi: ... fps over the last 5.0 s) with the first-time shader stutter the README describes. Not tested further than the forest on this run.

Possibly related: #72 (RX 6600 XT, also RDNA2, stuck after the Deku Tree scene).

## What this fixes An RDNA2 data point, since the AMD path was only tested by forcing it on an NVIDIA card: **RX 6900 XT, AMD proprietary driver 32.0.21045.16010 (2026-10-16), Windows 11 Pro 26300, i7-9700K, 32 GB.** Game `0400486024DEC000` v131072, build `e0f3ccfa`, built with the `lighting-fix` HookshotBuilder (bundled source identical to `da030c5`, checked file by file). The title screen and menus run at 58-60 fps. Loading a save (Kokiri Forest) ends like this: ``` [hos host] vk: matrix multiplies in software (the cooperative matrices lack 16x8x16 f16) [hos host] vk: AMD Radeon RX 6900 XT, Vulkan 1.4, driver 0x800161; mesh shaders yes, host memory import yes, pipeline libraries yes ... [hos ModuleSystemWorker1] vk: NVN2 program 2d6b101e5868b4ea (stage 0) lowered with extended registers (1132 REGMAP words) [hos ModuleSystemWorker1] vk: NVN2 program b81f83fe05a2a32a (stage 0) lowered with extended registers (939 REGMAP words) [hos host] vk: graphics pipeline for 5fa56485a6b07619 not made (-13) ``` `-13` is `guarded_graphics`'s answer to an access violation inside `vkCreateGraphicsPipelines`: the driver's shader compiler crashed. After that line nothing is presented any more (black window, GPU engine at 0 %), one thread spins at 100 % in `amdvlk64.dll`/`amdxc64.dll`, and the log stays silent; I waited 7 minutes. This looks like the same AMD compiler bug Lichii hit for Ocarina's shaders (zortos293/Lichii#101, #200, #210: an access violation at `amdvlk64.dll+0xaff2e7` and 6-18 minute builds of two compute shaders), where building the affected pipelines with `VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT` avoids both. ## Change `RX_VK_NOOPT=1` sets `VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT` on every graphics and compute pipeline the game's programs produce (`build_graphics` and the compute program path in `vk_draw.cpp`). Off unless the variable is set, so nothing changes for NVIDIA. ## Testing Same PC, same build folder, only `hookshot_vk.dll` rebuilt. With `RX_VK_NOOPT=1` the same save loads: no `not made`, no stall, 40 fps in Kokiri Forest (`vi: ... fps over the last 5.0 s`) with the first-time shader stutter the README describes. Not tested further than the forest on this run. Possibly related: #72 (RX 6600 XT, also RDNA2, stuck after the Deku Tree scene).
shayderrr commented 2026-11-07 14:22:55 +00:00 (Migrated from github.com)

Merged, Thanks.

Merged, Thanks.
Commenting is not possible because the repository is archived.
No description provided.