Build task and mesh shader pipelines without the driver's optimiser on AMD's driver for RDNA 1 and 2, unless vk_noopt says otherwise.

That driver loses the device in play ("No fault detected", a timeout) on RX 6600 to RX 6950 XT cards in every version from 0.6.0 to 0.9.2, with the pipeline library on or off and the lazy write-back on or off (#591, #602, #659, #683, #684, #689, #635, #719, #279, and fourteen of twenty sessions in a player's launcher log of an RX 6800). Where the pass marks name a pass the GPU was in, twelve logs of five reporters, its first draw is a mesh pipeline: mesh shader ba4302f1 with fragment shader f64a96dd in nine, the one-draw pass of 1bbdb17e with 6cc3a476 in three. The five logs of 0.9.1 and 0.9.2 stop between the compute dispatch before such a pass and the pass. vk_noopt = mesh was there as a test switch for this suspicion and no reporter had run with it.

It is now what an unset vk_noopt means on that driver branch; every other driver keeps 0, and vk_noopt = 0 gives the optimised pipelines back. The picture is the same; the mesh and task shaders run slower, by how much is not measured, and those pipelines are built once more because the flag is part of the driver's cache key. That the optimiser is the cause is not shown: no AMD card ran this.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 15:31:56 -05:00
parent 07557fe06c
commit bc256496cb
3 changed files with 25 additions and 6 deletions

View File

@@ -854,6 +854,12 @@
# last one it finished. Unset: on AMD GPUs (VK_AMD_buffer_marker). 1: also on NVIDIA GPUs
# (VK_NV_device_diagnostic_checkpoints), which NVIDIA says costs a little. 0: off.
# pass_crumbs = 1
# Pipelines built without the video driver's shader optimiser: the same picture, slower shaders in those pipelines.
# mesh: only the pipelines with task and mesh shaders (terrain, foliage). 1: all. 0: none.
# Unset (default): mesh on AMD's Windows driver for the RX 5000 and RX 6000 series and older, where the device is lost
# ("driver timeout") in render passes that start with such a pipeline; 0 on every other driver. On those cards 0 gives
# the optimised pipelines back.
# vk_noopt = mesh
# GPU draw marks, for a GPU crash (device lost) that comes back in the same place on an AMD GPU: inside each render pass
# a mark is written wherever the shaders change, and after the crash the log names the shaders of the draws the GPU had
# not finished, not only the pass. It costs a little frame rate, so it is off unless a crash is being tracked down.

View File

@@ -344,7 +344,7 @@ static const CfgMeta metas[] = {
{"VK_RECONVERGE", "1", "0|1", RESTART}, // vk_pipeline.c spirv_reconverge
{"VK_NAN_PRESERVE", "", "0|1", RESTART}, // vk_pipeline.c spirv_nan_preserve; unset: every driver but NVIDIA's
{"VK_NAN_BITS", "", "0|1", RESTART}, // vk_pipeline.c spirv_nan_bits; unset: AMD's driver for RDNA 1 and 2
{"VK_NOOPT", "0", "0|1|mesh", RESTART}, // vk_pipeline.c noopt_flag_for
{"VK_NOOPT", "", "0|1|mesh", RESTART}, // vk_pipeline.c noopt_flag_for; unset: mesh on AMD's driver for RDNA 1 and 2
// diagnostics
{"TRACE", "", NULL, RESTART}, {"FLIGHT", "0", "0|1", RESTART}, {"FLIGHT_SPIKE_MS", "100", "0..60000", RESTART},
{"WB_FENCE_LIMIT", "65536", "0..1073741824", RESTART}, {"WB_MERGE", "1", "0|1", RESTART}, {"WB_EXACT", "1", "0|1", RESTART}, {"MEM_CENSUS", "0", "0|1", RESTART}, {"WB_NO_REUP", "1", "0|1", RESTART}, {"WB_PROBE", "0", "0|1", RESTART}, {"WB_SPLIT", "1", "0|1|2|3", RESTART}, {"WB_LAZY", WB_LAZY_DEFAULT, "0|1", RESTART}, {"HEAP_LAZY", "0", "0|1", RESTART}, {"WB_LAZY_TOUCH", "0", "0..16", RESTART}, {"WB_LAZY_CHUNK", "0", "0|1", RESTART}, {"FLUSH_UPLOAD", "0", "0|1", RESTART}, {"GPA_TWIN_MAX_KB", "0", "0..1048576", RESTART},

View File

@@ -3171,14 +3171,27 @@ static int is_src1(unsigned f) { return f >= NVN_BLEND_FUNC_SRC1_COLOR && f <= N
// which NX2navi never sets (0 of 876 pipelines in the field and fight saves).
// NX2NAVI_VK_NOOPT=1: pipelines built without the driver's optimiser, for a driver whose shader compiler crashes on
// one (the test switch for such a report); slower shaders, the same picture. mesh: only pipelines with task and mesh
// stages, the foliage's, whose optimiser is the suspect in device losses some minutes into a forest on AMD GPUs.
// stages, the terrain's and the foliage's. 0: none.
// Unset: mesh on AMD's Windows driver for RDNA 1 and 2 (vk_caps.amd_sc), 0 elsewhere. That driver loses the device
// ("No fault detected", a timeout) minutes into play on RX 6600 to RX 6950 XT cards in every version from 0.6.0 to
// 0.9.2, with the pipeline library on or off and the lazy write-back on or off. Where the reports' pass marks name a
// pass the GPU was in, twelve logs of five reporters, it is a pass whose first draw is a mesh pipeline (mesh shader
// ba4302f1 with fragment shader f64a96dd in nine, the one-draw pass of 1bbdb17e with 6cc3a476 in three); the five
// logs of 0.9.1 and 0.9.2 stop between the compute dispatch before such a pass and the pass. No reporter ran with
// the optimiser off, so that it is the cause is not shown: it is the one suspect the marks leave, it costs shader
// speed in those pipelines and not the picture, and NX2NAVI_VK_NOOPT=0 gives the optimised ones back. The flag is
// part of what the driver's cache keys a pipeline by, so those pipelines are built once more after the change.
static VkPipelineCreateFlags noopt_flag_for(int mesh) {
static int on = -1;
if (on < 0) {
const char *v = cfg_value("NX2NAVI_VK_NOOPT");
on = !strcmp(v, "mesh") ? 2 : strcmp(v, "0") != 0;
if (on) rt_log("vk_pipeline: %s built without the driver's optimiser (NX2NAVI_VK_NOOPT)",
on == 2 ? "pipelines with task and mesh stages" : "pipelines");
const char *v = cfg_get("NX2NAVI_VK_NOOPT");
int by_driver = !v || !*v;
on = by_driver ? (vk_caps.amd_sc ? 2 : 0) : !strcmp(v, "mesh") ? 2 : strcmp(v, "0") != 0;
if (on) rt_log("vk_pipeline: %s built without the driver's optimiser (%s)",
on == 2 ? "pipelines with task and mesh stages" : "pipelines",
by_driver ? "the default on AMD's driver for RDNA 1 and 2, where the device is lost in passes "
"that start with such a pipeline; NX2NAVI_VK_NOOPT=0 builds them optimised"
: "NX2NAVI_VK_NOOPT");
}
return on == 1 || (on == 2 && mesh) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0;
}